mirror of https://github.com/vitalif/openscad
fixed check-before-reload, also for the Reload (F3) function
git-svn-id: http://svn.clifford.at/openscad/trunk@556 b57f626f-c46c-0410-a088-ec61d464b74cstl_dim
parent
fb0f3ed8d1
commit
dfe808e7d4
|
@ -75,6 +75,7 @@ private:
|
||||||
void compile(bool procevents);
|
void compile(bool procevents);
|
||||||
void compileCSG(bool procevents);
|
void compileCSG(bool procevents);
|
||||||
bool maybeSave();
|
bool maybeSave();
|
||||||
|
bool checkModified();
|
||||||
static void consoleOutput(const QString &msg, void *userdata) {
|
static void consoleOutput(const QString &msg, void *userdata) {
|
||||||
static_cast<MainWindow*>(userdata)->console->append(msg);
|
static_cast<MainWindow*>(userdata)->console->append(msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -932,7 +932,7 @@ void MainWindow::actionSaveAs()
|
||||||
|
|
||||||
void MainWindow::actionReload()
|
void MainWindow::actionReload()
|
||||||
{
|
{
|
||||||
load();
|
if (checkModified()) load();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::hideEditor()
|
void MainWindow::hideEditor()
|
||||||
|
@ -991,7 +991,7 @@ void MainWindow::autoReloadSet(bool on)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::actionReloadCompile()
|
bool MainWindow::checkModified()
|
||||||
{
|
{
|
||||||
if (editor->isContentModified()) {
|
if (editor->isContentModified()) {
|
||||||
QMessageBox::StandardButton ret;
|
QMessageBox::StandardButton ret;
|
||||||
|
@ -1001,9 +1001,15 @@ void MainWindow::actionReloadCompile()
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if (ret != QMessageBox::Yes) {
|
if (ret != QMessageBox::Yes) {
|
||||||
designActionAutoReload->setChecked(false);
|
designActionAutoReload->setChecked(false);
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::actionReloadCompile()
|
||||||
|
{
|
||||||
|
if (!checkModified()) return;
|
||||||
|
|
||||||
console->clear();
|
console->clear();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue