]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/mainframe.cpp
Initial python support
[xonotic/netradiant.git] / radiant / mainframe.cpp
index 11fc3784ad2b49874caf4de899880017bffc55bd..c4712aa1ef88fdd5201250fa066df866cbf3c3e1 100644 (file)
@@ -86,6 +86,9 @@
 #include "pluginmenu.h"
 #include "plugintoolbar.h"
 #include "preferences.h"
+#ifdef _EMBED_PYTHON
+    #include "pythonconsole.h"
+#endif // _EMBED_PYTHON
 #include "qe3.h"
 #include "qgl.h"
 #include "select.h"
@@ -1210,6 +1213,15 @@ void Console_ToggleShow()
     GroupDialog_showPage(g_page_console);
 }
 
+#ifdef _EMBED_PYTHON
+ui::Widget g_page_pythonconsole{ui::null};
+
+void PythonConsole_ToggleShow()
+{
+    GroupDialog_showPage(g_page_pythonconsole);
+}
+#endif // _EMBED_PYTHON
+
 ui::Widget g_page_entity{ui::null};
 
 void EntityInspector_ToggleShow()
@@ -3115,6 +3127,13 @@ void MainFrame::Create()
                                              RawStringExportCaller("Console"));
     }
 
+#ifdef _EMBED_PYTHON
+    if (FloatingGroupDialog()) {
+        g_page_pythonconsole = GroupDialog_addPage("Python", PythonConsole_constructWindow(GroupDialog_getWindow()),
+                                                   RawStringExportCaller("Python"));
+    }
+#endif // _EMBED_PYTHON
+
 #if GDEF_OS_WINDOWS
                                                                                                                             if ( g_multimon_globals.m_bStartOnPrimMon ) {
                PositionWindowOnPrimaryScreen( g_layout_globals.m_position );