Core: do not override sys.stdin when using FreeCAD as Python module
This commit is contained in:
@@ -287,19 +287,23 @@ QWidget* setupMainWindow()
|
||||
}
|
||||
|
||||
Base::PyGILStateLocker lock;
|
||||
PyObject* input = PySys_GetObject("stdin");
|
||||
// It's sufficient to create the config key
|
||||
App::Application::Config()["DontOverrideStdIn"] = "";
|
||||
Gui::MainWindow *mw = new Gui::MainWindow();
|
||||
hasMainWindow = true;
|
||||
|
||||
QIcon icon = qApp->windowIcon();
|
||||
if (icon.isNull())
|
||||
if (icon.isNull()) {
|
||||
qApp->setWindowIcon(Gui::BitmapFactory().pixmap(App::Application::Config()["AppIcon"].c_str()));
|
||||
}
|
||||
mw->setWindowIcon(qApp->windowIcon());
|
||||
QString appName = qApp->applicationName();
|
||||
if (!appName.isEmpty())
|
||||
if (!appName.isEmpty()) {
|
||||
mw->setWindowTitle(appName);
|
||||
else
|
||||
}
|
||||
else {
|
||||
mw->setWindowTitle(QString::fromLatin1(App::Application::Config()["ExeName"].c_str()));
|
||||
}
|
||||
|
||||
if (!SoDB::isInitialized()) {
|
||||
// init the Inventor subsystem
|
||||
@@ -350,7 +354,6 @@ QWidget* setupMainWindow()
|
||||
|
||||
Gui::Application::Instance->activateWorkbench(start.c_str());
|
||||
mw->loadWindowSettings();
|
||||
PySys_SetObject("stdin", input);
|
||||
}
|
||||
else {
|
||||
Gui::getMainWindow()->show();
|
||||
|
||||
Reference in New Issue
Block a user