aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/converter/preseteditor.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2011-10-10 20:00:44 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2011-10-10 20:00:44 +0000
commit4d9261bf04a49e149f92705fe2e72309ff048c51 (patch)
tree7063c413b4574e6d8aaa49bf38d62b16cb843117 /src/plugins/General/converter/preseteditor.cpp
parentb95c9bd09245efe50741b806ca8ae7d7970b221a (diff)
downloadqmmp-4d9261bf04a49e149f92705fe2e72309ff048c51.tar.gz
qmmp-4d9261bf04a49e149f92705fe2e72309ff048c51.tar.bz2
qmmp-4d9261bf04a49e149f92705fe2e72309ff048c51.zip
converter: added menu to preset editor
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2390 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/converter/preseteditor.cpp')
-rw-r--r--src/plugins/General/converter/preseteditor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/General/converter/preseteditor.cpp b/src/plugins/General/converter/preseteditor.cpp
index e1e75e217..4bf27bf67 100644
--- a/src/plugins/General/converter/preseteditor.cpp
+++ b/src/plugins/General/converter/preseteditor.cpp
@@ -18,6 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
+#include <QMenu>
#include "preseteditor.h"
#include "ui_preseteditor.h"
@@ -30,6 +31,7 @@ PresetEditor::PresetEditor(const QVariantMap &data, QWidget *parent) :
m_ui->commandLineEdit->setText(data.value("command").toString());
m_ui->us16bitCheckBox->setChecked(data.value("use_16bit").toBool());
m_ui->tagsCheckBox->setChecked(data.value("tags").toBool());
+ createMenus();
}
PresetEditor::~PresetEditor()
@@ -48,3 +50,19 @@ const QVariantMap PresetEditor::data() const
data.insert("read_only", false);
return data;
}
+
+void PresetEditor::createMenus()
+{
+ QMenu *commandMenu = new QMenu(this);
+ commandMenu->addAction(tr("Output file"))->setData("%o");
+ commandMenu->addAction(tr("Input file"))->setData("%i");
+
+ m_ui->commandToolButton->setMenu(commandMenu);
+ m_ui->commandToolButton->setPopupMode(QToolButton::InstantPopup);
+ connect(commandMenu, SIGNAL(triggered(QAction *)), SLOT(addCommandString(QAction *)));
+}
+
+void PresetEditor::addCommandString(QAction *a)
+{
+ m_ui->commandLineEdit->insert(a->data().toString());
+}