+ changes to make working with ipython shell
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5162 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
parent
8fa8b4b3df
commit
bb726c4644
|
@ -240,6 +240,7 @@ QWidget* setupMainWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Gui::MainWindow::getInstance()) {
|
if (!Gui::MainWindow::getInstance()) {
|
||||||
|
PyObject* input = PySys_GetObject("stdin");
|
||||||
Gui::MainWindow *mw = new Gui::MainWindow();
|
Gui::MainWindow *mw = new Gui::MainWindow();
|
||||||
QIcon icon = qApp->windowIcon();
|
QIcon icon = qApp->windowIcon();
|
||||||
if (icon.isNull())
|
if (icon.isNull())
|
||||||
|
@ -288,6 +289,7 @@ QWidget* setupMainWindow()
|
||||||
|
|
||||||
Gui::Application::Instance->activateWorkbench(start.c_str());
|
Gui::Application::Instance->activateWorkbench(start.c_str());
|
||||||
mw->loadWindowSettings();
|
mw->loadWindowSettings();
|
||||||
|
PySys_SetObject("stdin", input);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Gui::getMainWindow()->show();
|
Gui::getMainWindow()->show();
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
// FreeCAD Base header
|
// FreeCAD Base header
|
||||||
#include <Base/Exception.h>
|
#include <Base/Exception.h>
|
||||||
|
#include <Base/Uuid.h>
|
||||||
#include <App/Application.h>
|
#include <App/Application.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,6 +113,8 @@ extern "C"
|
||||||
strncpy(argv[0],szFileName,MAX_PATH);
|
strncpy(argv[0],szFileName,MAX_PATH);
|
||||||
argv[0][MAX_PATH-1] = '\0'; // ensure null termination
|
argv[0][MAX_PATH-1] = '\0'; // ensure null termination
|
||||||
#elif defined(FC_OS_LINUX)
|
#elif defined(FC_OS_LINUX)
|
||||||
|
putenv("LANG=C");
|
||||||
|
putenv("LC_ALL=C");
|
||||||
// get whole path of the library
|
// get whole path of the library
|
||||||
Dl_info info;
|
Dl_info info;
|
||||||
int ret = dladdr((void*)initFreeCAD, &info);
|
int ret = dladdr((void*)initFreeCAD, &info);
|
||||||
|
@ -123,6 +126,9 @@ extern "C"
|
||||||
argv[0] = (char*)malloc(PATH_MAX);
|
argv[0] = (char*)malloc(PATH_MAX);
|
||||||
strncpy(argv[0], info.dli_fname,PATH_MAX);
|
strncpy(argv[0], info.dli_fname,PATH_MAX);
|
||||||
argv[0][PATH_MAX-1] = '\0'; // ensure null termination
|
argv[0][PATH_MAX-1] = '\0'; // ensure null termination
|
||||||
|
// this is a workaround to avoid a crash in libuuid.so
|
||||||
|
Base::Uuid uuid;
|
||||||
|
uuid.UuidStr="";
|
||||||
#elif defined(FC_OS_MACOSX)
|
#elif defined(FC_OS_MACOSX)
|
||||||
uint32_t sz = 0;
|
uint32_t sz = 0;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user