0000777: Shared libraries call exit

This commit is contained in:
wmayer
2012-07-05 15:24:28 +02:00
parent d112755730
commit 41c46bf48b
11 changed files with 132 additions and 110 deletions

View File

@@ -23,6 +23,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <QApplication>
# include <QClipboard>
# include <QDockWidget>
# include <QGridLayout>
@@ -700,12 +701,13 @@ void PythonConsole::runSource(const QString& line)
catch (const Base::SystemExitException&) {
ParameterGrp::handle hPrefGrp = getWindowParameter();
bool check = hPrefGrp->GetBool("CheckSystemExit",true);
if (!check) Base::Interpreter().systemExit();
if (!check) qApp->quit();
int ret = QMessageBox::question(this, tr("System exit"), tr("The application is still running.\nDo you want to exit without saving your data?"),
QMessageBox::Yes, QMessageBox::No|QMessageBox::Escape|QMessageBox::Default);
if (ret == QMessageBox::Yes) {
Base::Interpreter().systemExit();
} else {
qApp->quit();
}
else {
PyErr_Clear();
}
}