summaryrefslogtreecommitdiff
path: root/src/renderdialog.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderdialog.cc')
-rw-r--r--src/renderdialog.cc37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/renderdialog.cc b/src/renderdialog.cc
index 9dc1c05..873e610 100644
--- a/src/renderdialog.cc
+++ b/src/renderdialog.cc
@@ -28,13 +28,34 @@
#include <QPushButton>
#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QLineEdit>
+#include <QFileDialog>
+#include <QLabel>
+
+#include "project.h"
RenderDialog::RenderDialog(QWidget* parent, Project& project)
: QDialog(parent)
, project(project)
, renderer(project)
{
- setLayout(new QVBoxLayout());
+ auto vl = new QVBoxLayout();
+ setLayout(vl);
+
+ layout()->addWidget(new QLabel(tr("Export path:")));
+
+ {
+ auto hl = new QHBoxLayout();
+ export_path = new QLineEdit(this);
+ export_path->setText(project.getExportPath());
+ auto btn = new QPushButton(tr("..."));
+ btn->setMaximumWidth(32);
+ connect(btn, SIGNAL(clicked()), this, SLOT(chooseExportPath()));
+ hl->addWidget(export_path);
+ hl->addWidget(btn);
+ vl->addLayout(hl);
+ }
auto btn = new QPushButton(this);
btn->setText("Click me");
@@ -96,3 +117,17 @@ void RenderDialog::progressRenderFinished(int success)
void RenderDialog::progressFinished(int success)
{
}
+
+void RenderDialog::chooseExportPath()
+{
+ QString path =
+ QFileDialog::getExistingDirectory(
+ this, tr("Choose export directory."),
+ project.getExportPath(), QFileDialog::ShowDirsOnly);
+
+ if(path != "")
+ {
+ export_path->setText(path);
+ project.setExportPath(path);
+ }
+}