commit-gnue
[Top][All Lists]
Advanced

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

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


From: reinhard
Subject: [gnue] r8826 - trunk/gnue-forms/src
Date: Tue, 17 Oct 2006 12:15:34 -0500 (CDT)

Author: reinhard
Date: 2006-10-17 12:15:34 -0500 (Tue, 17 Oct 2006)
New Revision: 8826

Modified:
   trunk/gnue-forms/src/GFForm.py
Log:
More work on focus-in, focus-out and begin/endEditing.


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2006-10-17 17:03:32 UTC (rev 8825)
+++ trunk/gnue-forms/src/GFForm.py      2006-10-17 17:15:34 UTC (rev 8826)
@@ -1137,7 +1137,7 @@
         Enters the form into Query mode.
         """
 
-        self.endEditing()
+        # self.endEditing()             # happens via _focus_out()
 
         try:
             if self._currentBlock is not None:
@@ -1165,7 +1165,7 @@
         Copies the Query, ie brings back conditions from the last query.
         """
 
-        self.endEditing()
+        # self.endEditing()             # happens via focus_out()
 
         try:
             if self._currentBlock is not None:
@@ -1201,13 +1201,14 @@
             for block in self._logic._blockList:
                 block.cancel_query()
 
+            self.status_message(u_('Query canceled.'))
+        finally:
             if self._currentBlock is not None:
                 self._currentBlock._focus_in()
 
-            self.status_message(u_('Query canceled.'))
-        finally:
-            self.beginEditing()
+            self.beginEditing()         # happens via _focus_in()
 
+
     # -------------------------------------------------------------------------
 
     def execute_query(self):
@@ -1227,25 +1228,24 @@
             self.dispatchEvent('endENTERQUERY', _form=self);
 
             try:
-                try:
-                    self._currentBlock.execute_query()
+                self._currentBlock.execute_query()
 
-                except DBError:
-                    self.__rollback_all_connections()
-                    self.__clear_all_blocks()
-                    raise
+            except DBError:
+                self.__rollback_all_connections()
+                self.__clear_all_blocks()
+                raise
 
-            finally:
-                self._currentBlock._focus_in()
-
-                if self._currentBlock.is_empty ():
-                    self.status_message (u_('Query returned no results.'))
-                else:
-                    self.status_message (u_('Query successful.'))
         finally:
-            self.beginEditing()
+            if self._currentBlock.is_empty ():
+                self.status_message (u_('Query returned no results.'))
+            else:
+                self.status_message (u_('Query successful.'))
 
+            self._currentBlock._focus_in()
 
+            self.beginEditing()             # happens via _focus_in()
+
+
     # -------------------------------------------------------------------------
     # Commit all pending changes
     # -------------------------------------------------------------------------
@@ -1255,10 +1255,8 @@
         Commit all pending changes.
         """
 
-        self.endEditing()
-
         if self._currentBlock is not None:
-            self._currentBlock.focus_out()
+            self._currentBlock._focus_out()
 
         try:
             # Do the actual work
@@ -1266,8 +1264,7 @@
         finally:
 
             if self._currentBlock is not None:
-                self._currentBlock.focus_in()
-            self.beginEditing()
+                self._currentBlock._focus_in()
 
     # -------------------------------------------------------------------------
 





reply via email to

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