Skip to content

Commit c34be40

Browse files
committed
rti and normals check before overwriting
1 parent 52f4c1e commit c34be40

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

relightlab/imagelist.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <QFileInfo>
55
#include <QStyledItemDelegate>
6+
#include <QMouseEvent>
67
#include <assert.h>
78

89
class RightDelegate : public QStyledItemDelegate {

relightlab/normalsframe.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ void NormalsFrame::save() {
9292
return;
9393
}
9494
}
95+
//check for existing normals:
96+
if(QFile::exists(parameters.path)) {
97+
int answer = QMessageBox::question(this, parameters.path + " already exists.", "Do you wish to overwrite it?", QMessageBox::Yes, QMessageBox::No);
98+
if(answer == QMessageBox::No)
99+
return;
100+
}
101+
95102
NormalsTask *task = new NormalsTask();
96103
try {
97104

relightlab/rtiframe.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,20 @@ void RtiFrame::exportRti() {
116116
QMessageBox::warning(this, "Destination path is missing.", "Fill in the output folder or the filename for the RTI.");
117117
return;
118118
}
119+
120+
//check for existing normals:
121+
if(QFile::exists(parameters.path)) {
122+
int answer = QMessageBox::question(this, parameters.path + " already exists.", "Do you wish to overwrite it?", QMessageBox::Yes, QMessageBox::No);
123+
if(answer == QMessageBox::No)
124+
return;
125+
}
126+
119127
RtiTask *rti_task = new RtiTask();
120128
try {
121129
rti_task->setProject(project);
122130
rti_task->setParameters(parameters);
123131
rti_task->output = parameters.path;
124132

125-
126133
} catch(QString error) {
127134
QMessageBox::critical(this, "Something went wrong", error);
128135
delete rti_task;
@@ -134,6 +141,7 @@ void RtiFrame::exportRti() {
134141

135142
emit processStarted();
136143
}
144+
137145
void RtiFrame::updateNPlanes() {
138146
// PLANES
139147

0 commit comments

Comments
 (0)