Skip to content
Snippets Groups Projects
Commit 4ff0e9fc authored by Langella Olivier's avatar Langella Olivier
Browse files

WIP: load combo box

parent c7d95ee0
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@
#include "ui_edit_tandem_preset_dialog.h"
#include <QSettings>
#include <QDir>
#include <QFileDialog>
EditTandemPresetDialog::EditTandemPresetDialog(QWidget * parent):
......@@ -90,6 +91,26 @@ void EditTandemPresetDialog::doCopy() {
_p_tandem_preset_file = new TandemParametersFile(QString("%1/untitled.xml").arg(default_preset_location));
}
void EditTandemPresetDialog::doSelectDir() {
try {
QSettings settings;
QString default_preset_location = settings.value("path/tandemrun_preset_directory", "").toString();
QString directory = QFileDialog::getExistingDirectory(this,tr("Choose preset directory"),default_preset_location );
if (!directory.isEmpty() && ! directory.isNull()) {
settings.setValue("path/tandemrun_preset_directory", directory);
fillPresetComboBox();
}
}
catch (pappso::PappsoException & error) {
//QMessageBox::warning(this,
// tr("Error choosing identification result files : %1").arg(error.qwhat()), error);
}
}
void EditTandemPresetDialog::doSave() {
readUi();
if (_p_tandem_preset_file == nullptr) {
......@@ -98,6 +119,7 @@ void EditTandemPresetDialog::doSave() {
}
_p_tandem_preset_file->setTandemParameters(_tandem_params);
fillPresetComboBox();
populate();
}
void EditTandemPresetDialog::doLoad() {
......
......@@ -53,6 +53,7 @@ public slots:
void doCopy();
void doEdit(QString value);
void doLoad();
void doSelectDir();
private:
void fillPresetComboBox();
void populate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment