summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-06-12 23:30:42 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-06-12 23:30:42 (GMT)
commitdfe808e7d4329dc96e9fa99d7e2561af2180b4ab (patch)
tree79d24bec312bae2fd55e4cafa343c4ca735c0225
parentfb0f3ed8d13ce5c934d3c201eb56e019b3470baf (diff)
fixed check-before-reload, also for the Reload (F3) function
git-svn-id: http://svn.clifford.at/openscad/trunk@556 b57f626f-c46c-0410-a088-ec61d464b74c
-rw-r--r--src/MainWindow.h1
-rw-r--r--src/mainwin.cc12
2 files changed, 10 insertions, 3 deletions
diff --git a/src/MainWindow.h b/src/MainWindow.h
index 6b15889..c0a9844 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -75,6 +75,7 @@ private:
void compile(bool procevents);
void compileCSG(bool procevents);
bool maybeSave();
+ bool checkModified();
static void consoleOutput(const QString &msg, void *userdata) {
static_cast<MainWindow*>(userdata)->console->append(msg);
}
diff --git a/src/mainwin.cc b/src/mainwin.cc
index cdd7c6f..f6b7a53 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -932,7 +932,7 @@ void MainWindow::actionSaveAs()
void MainWindow::actionReload()
{
- load();
+ if (checkModified()) load();
}
void MainWindow::hideEditor()
@@ -991,7 +991,7 @@ void MainWindow::autoReloadSet(bool on)
}
}
-void MainWindow::actionReloadCompile()
+bool MainWindow::checkModified()
{
if (editor->isContentModified()) {
QMessageBox::StandardButton ret;
@@ -1001,9 +1001,15 @@ void MainWindow::actionReloadCompile()
QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) {
designActionAutoReload->setChecked(false);
- return;
+ return false;
}
}
+ return true;
+}
+
+void MainWindow::actionReloadCompile()
+{
+ if (!checkModified()) return;
console->clear();
contact: Jan Huwald // Impressum