summaryrefslogtreecommitdiff
path: root/src/renderdialog.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderdialog.cc')
-rw-r--r--src/renderdialog.cc34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/renderdialog.cc b/src/renderdialog.cc
index 758f99e..5f61eae 100644
--- a/src/renderdialog.cc
+++ b/src/renderdialog.cc
@@ -194,7 +194,7 @@ public:
return QVariant();
}
- if(role == Qt::DecorationRole )
+ if(role == Qt::DecorationRole)
{
if(index.column() == 0)
{
@@ -204,8 +204,14 @@ public:
}
else if(index.row() == current_row)
{
- //return QPixmap(":/icons/task_error.png");
- return QPixmap(":/icons/task_running.png");
+ if(error)
+ {
+ return QPixmap(":/icons/task_error.png");
+ }
+ else
+ {
+ return QPixmap(":/icons/task_running.png");
+ }
}
else
{
@@ -228,6 +234,10 @@ public:
return QVariant();
}
+ void setError()
+ {
+ error = true;
+ }
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
{
@@ -259,6 +269,7 @@ public:
private:
Project& project;
int current_row{-1};
+ bool error{false};
};
RenderDialog::RenderDialog(QWidget* parent, Project& project)
@@ -278,6 +289,8 @@ RenderDialog::RenderDialog(QWidget* parent, Project& project)
auto hl = new QHBoxLayout();
export_path = new QLineEdit(this);
export_path->setText(project.getExportPath());
+ connect(export_path, SIGNAL(textEdited(const QString&)),
+ this, SLOT(exportPathChanged(const QString&)));
auto btn = new QPushButton(tr("..."));
btn->setMaximumWidth(32);
connect(btn, SIGNAL(clicked()), this, SLOT(chooseExportPath()));
@@ -367,11 +380,21 @@ void RenderDialog::progressRenderFinished(int success)
model->setActiveTask(*instrument_id); // note this id is invalid
bar->setValue(task + 1);
+ if(success != 0)
+ {
+ model->setError();
+ }
model->refresh();
}
void RenderDialog::progressFinished(int success)
{
+ if(success != 0)
+ {
+ model->setError();
+ }
+ model->refresh();
+
export_btn->setEnabled(true);
}
@@ -388,3 +411,8 @@ void RenderDialog::chooseExportPath()
project.setExportPath(path);
}
}
+
+void RenderDialog::exportPathChanged(const QString& path)
+{
+ project.setExportPath(path);
+}