From 899a15f90c2845cd44e0e6aa1dc4eae5dcc68f2b Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 4 Oct 2011 18:19:15 +0000 Subject: converter: added preset editor git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2378 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/converter/preseteditor.cpp | 30 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'src/plugins/General/converter/preseteditor.cpp') diff --git a/src/plugins/General/converter/preseteditor.cpp b/src/plugins/General/converter/preseteditor.cpp index 36228f37f..4a1865d92 100644 --- a/src/plugins/General/converter/preseteditor.cpp +++ b/src/plugins/General/converter/preseteditor.cpp @@ -21,14 +21,34 @@ #include "preseteditor.h" #include "ui_preseteditor.h" -PresetEditor::PresetEditor(QWidget *parent) : - QDialog(parent), - ui(new Ui::PresetEditor) +PresetEditor::PresetEditor(const QString &name, const QVariantMap &data, QWidget *parent) : + QDialog(parent), m_ui(new Ui::PresetEditor) { - ui->setupUi(this); + m_ui->setupUi(this); + m_ui->nameLineEdit->setText(name); + m_ui->extensionLineEdit->setText(data.value("ext").toString()); + 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()); } PresetEditor::~PresetEditor() { - delete ui; + delete m_ui; +} + +const QString PresetEditor::name() const +{ + return m_ui->nameLineEdit->text(); +} + +const QVariantMap PresetEditor::data() const +{ + QVariantMap data; + data.insert("ext", m_ui->extensionLineEdit->text()); + data.insert("command", m_ui->commandLineEdit->text()); + data.insert("use_16bit", m_ui->us16bitCheckBox->isChecked()); + data.insert("tags", m_ui->tagsCheckBox->isChecked()); + data.insert("read_only", false); + return data; } -- cgit v1.2.3-13-gbd6f