Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv31597/src/gui

Modified Files:
        wxOptionsDlg.cpp 
Log Message:
start/stop Python interpreter dynamically when the user changes enable/disable Python 
option in the options dialog

Index: wxOptionsDlg.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxOptionsDlg.cpp,v
retrieving revision 1.400
retrieving revision 1.401
diff -b -u -2 -r1.400 -r1.401
--- wxOptionsDlg.cpp    4 Jan 2004 01:39:04 -0000       1.400
+++ wxOptionsDlg.cpp    14 Jan 2004 00:06:14 -0000      1.401
@@ -70,4 +70,6 @@
 #include "TemplateDialog.h"
 
+#include "InitPython.h"
+
 // ----------------------------------------------------------------------------
 // persistent msgboxes we use here
@@ -3740,4 +3742,26 @@
 }
 
+bool wxOptionsPagePython::TransferDataFromWindow()
+{
+   // currently we still have the old value for "Enable Python" in config
+   const bool usePythonOld = READ_CONFIG_BOOL(m_Profile, MP_USEPYTHON);
+   if ( !wxOptionsPageStandard::TransferDataFromWindow() )
+   {
+      return false;
+   }
+
+   // now we have the new one -- is it different?
+   if ( READ_CONFIG_BOOL(m_Profile, MP_USEPYTHON) != usePythonOld )
+   {
+      // yes, start/stop embedded Python interpreter
+      if ( usePythonOld )
+         FreePython();
+      else
+         InitPython();
+   }
+
+   return true;
+}
+
 #endif // USE_PYTHON
 



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to