summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2014-04-02 21:12:53 +0200
committerJonas Suhr Christensen <jsc@umbraculum.org>2014-04-02 21:12:53 +0200
commit5f3b212b63418851907b788b6a2bfea69ba570b6 (patch)
tree3c3d7cb3e7a5fd9ab3d0f9fa90cc30a92f9b3bd9
parentd8053dd8e6d38165d9ac6a689081bc4a753ff7ad (diff)
Added file dialog to select export path.
-rw-r--r--dgedit/mainwindow.cc18
-rw-r--r--dgedit/mainwindow.h2
2 files changed, 15 insertions, 5 deletions
diff --git a/dgedit/mainwindow.cc b/dgedit/mainwindow.cc
index 3436c25..15b0171 100644
--- a/dgedit/mainwindow.cc
+++ b/dgedit/mainwindow.cc
@@ -38,6 +38,7 @@
#include <QToolBar>
#include <QAction>
#include <QMenuBar>
+#include <QFileDialog>
#include "canvastool.h"
#include "canvastoolthreshold.h"
@@ -193,11 +194,16 @@ MainWindow::MainWindow()
configs->addWidget(prefix);
configs->addWidget(new QLabel("Export path:"));
- QLineEdit *exportp = new QLineEdit();
+ QHBoxLayout *lo_exportp = new QHBoxLayout();
+ exportp = new QLineEdit();
connect(exportp, SIGNAL(textChanged(const QString &)),
extractor, SLOT(setExportPath(const QString &)));
exportp->setText("/home/deva/tmp/drumgizmoexport");
- configs->addWidget(exportp);
+ lo_exportp->addWidget(exportp);
+ QPushButton *btn_browse = new QPushButton("...");
+ connect(btn_browse, SIGNAL(clicked()), this, SLOT(browse()));
+ lo_exportp->addWidget(btn_browse);
+ configs->addLayout(lo_exportp);
QPushButton *loadbtn = new QPushButton();
loadbtn->setText("Add files...");
@@ -330,7 +336,9 @@ void MainWindow::setPreset(int index)
slider_falloff->setValue(p.falloff);
slider_fadelength->setValue(p.fadelength);
prefix->setText(p.prefix);
-// sorter->setAttackLength(p.attacklength);
-// selections->noiseFloorChanged(p.falloff);
-// selections->fadeoutChanged(p.fadeout);
+}
+
+void MainWindow::browse() {
+ QString path = QFileDialog::getExistingDirectory(this, "Select export path", exportp->text());
+ exportp->setText(path);
}
diff --git a/dgedit/mainwindow.h b/dgedit/mainwindow.h
index fd4af57..cc9bdb8 100644
--- a/dgedit/mainwindow.h
+++ b/dgedit/mainwindow.h
@@ -61,6 +61,7 @@ public slots:
void doExport();
void loadFile(QString filename);
void setPreset(int);
+ void browse();
protected:
void closeEvent(QCloseEvent*);
@@ -83,6 +84,7 @@ private:
QSlider *slider_falloff;
QSlider *slider_fadelength;
QLineEdit *prefix;
+ QLineEdit *exportp;
};
#endif/*__DRUMGIZMO_MAINWINDOW_H__*/