aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/converter/preseteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/General/converter/preseteditor.cpp')
-rw-r--r--src/plugins/General/converter/preseteditor.cpp30
1 files changed, 25 insertions, 5 deletions
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;
}