commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r9291 - trunk/gnue-forms/src


From: reinhard
Subject: [gnue] r9291 - trunk/gnue-forms/src
Date: Fri, 12 Jan 2007 11:20:18 -0600 (CST)

Author: reinhard
Date: 2007-01-12 11:20:16 -0600 (Fri, 12 Jan 2007)
New Revision: 9291

Modified:
   trunk/gnue-forms/src/GFInstance.py
Log:
Added possibility to keep GFInstance alive without any open form.


Modified: trunk/gnue-forms/src/GFInstance.py
===================================================================
--- trunk/gnue-forms/src/GFInstance.py  2007-01-12 16:08:51 UTC (rev 9290)
+++ trunk/gnue-forms/src/GFInstance.py  2007-01-12 17:20:16 UTC (rev 9291)
@@ -146,6 +146,8 @@
 
         self.__loaded_forms = []        # All loaded forms
 
+        self.__keepalive = False
+
         self._parentContainer = parentContainer
 
         # Load user customized key mappings
@@ -211,6 +213,25 @@
 
 
     # -------------------------------------------------------------------------
+    # Decide whether to keep the GFInstance alive even if no windows are open
+    # any more
+    # -------------------------------------------------------------------------
+
+    def keepalive(self, setting):
+        """
+        Decide whether the main loop should automatically be ended when the
+        last window is closed.
+
+        GNUe-Navigator uses this to keep the application alive even if no form
+        is open any more.
+
+        @param setting: True to keep the application running, False to end it.
+        """
+
+        self.__keepalive = setting
+
+
+    # -------------------------------------------------------------------------
     # Load and run a form
     # -------------------------------------------------------------------------
 
@@ -352,13 +373,14 @@
         This function is called by each form when it is closed.
         """
 
-        any_form_open = False
-        for form in self.__loaded_forms:
-            if form.is_visible():
-                any_form_open = True
-                break
-        if not any_form_open:
-            self._uiinstance._ui_exit_()
+        if not self.__keepalive:
+            any_form_open = False
+            for form in self.__loaded_forms:
+                if form.is_visible():
+                    any_form_open = True
+                    break
+            if not any_form_open:
+                self._uiinstance._ui_exit_()
 
 
     # =========================================================================





reply via email to

[Prev in Thread] Current Thread [Next in Thread]