aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/playlistheadermodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmmpui/playlistheadermodel.cpp')
-rw-r--r--src/qmmpui/playlistheadermodel.cpp19
1 files changed, 18 insertions, 1 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();