aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-04-09 06:45:09 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-04-09 06:45:09 +0000
commit8e25905b2a6782fd554f13d1b485a7fee3b33790 (patch)
treedf3ae9e38ea76f56dcb2e7c662ff1a7758bd8f22 /src/qmmpui
parentcebd61b447dd01d358841b16ee7ec0536f032aaf (diff)
downloadqmmp-8e25905b2a6782fd554f13d1b485a7fee3b33790.tar.gz
qmmp-8e25905b2a6782fd554f13d1b485a7fee3b33790.tar.bz2
qmmp-8e25905b2a6782fd554f13d1b485a7fee3b33790.zip
improved column editor behaviour
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4838 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui')
-rw-r--r--src/qmmpui/playlistheadermodel.cpp19
-rw-r--r--src/qmmpui/playlistheadermodel.h3
2 files changed, 20 insertions, 2 deletions
diff --git a/src/qmmpui/playlistheadermodel.cpp b/src/qmmpui/playlistheadermodel.cpp
index f6e6ccf7f..c39df388e 100644
--- a/src/qmmpui/playlistheadermodel.cpp
+++ b/src/qmmpui/playlistheadermodel.cpp
@@ -136,7 +136,7 @@ void PlayListHeaderModel::move(int from, int to)
emit moved(from, to);
}
-void PlayListHeaderModel::execEditor(int index, QWidget *parent)
+void PlayListHeaderModel::execEdit(int index, QWidget *parent)
{
if(index < 0 || index >= m_columns.size())
{
@@ -157,6 +157,23 @@ void PlayListHeaderModel::execEditor(int index, QWidget *parent)
}
}
+void PlayListHeaderModel::execInsert(int index, QWidget *parent)
+{
+ if(index < 0 || index > m_columns.size())
+ {
+ qWarning("ColumnManager: index is out of range");
+ return;
+ }
+
+ if(!parent)
+ parent = qApp->activeWindow();
+
+ ColumnEditor editor(tr("Title"),"%t",parent);
+ editor.setWindowTitle(tr("Add Column"));
+ if(editor.exec() == QDialog::Accepted)
+ insert(index, editor.name(), editor.pattern());
+}
+
int PlayListHeaderModel::count()
{
return m_columns.count();
diff --git a/src/qmmpui/playlistheadermodel.h b/src/qmmpui/playlistheadermodel.h
index 67310a4ef..ac50d0842 100644
--- a/src/qmmpui/playlistheadermodel.h
+++ b/src/qmmpui/playlistheadermodel.h
@@ -41,7 +41,8 @@ public:
void resize(int index, int size);
void setAutoResize(int index);
void move(int from, int to);
- void execEditor(int index, QWidget *parent = 0);
+ void execEdit(int index, QWidget *parent = 0);
+ void execInsert(int index, QWidget *parent = 0);
int count();
const MetaDataFormatter* titleFormatter(int index) const;