commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r8824 - in trunk/gnue-forms/src: . GFObjects


From: reinhard
Subject: [gnue] r8824 - in trunk/gnue-forms/src: . GFObjects
Date: Tue, 17 Oct 2006 11:59:36 -0500 (CDT)

Author: reinhard
Date: 2006-10-17 11:59:36 -0500 (Tue, 17 Oct 2006)
New Revision: 8824

Modified:
   trunk/gnue-forms/src/GFForm.py
   trunk/gnue-forms/src/GFObjects/GFBlock.py
Log:
Better solution for focus-out and focus-in at change to/from query mode.


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2006-10-17 16:50:23 UTC (rev 8823)
+++ trunk/gnue-forms/src/GFForm.py      2006-10-17 16:59:36 UTC (rev 8824)
@@ -1141,8 +1141,7 @@
 
         try:
             if self._currentBlock is not None:
-                if self._currentBlock.autoCommit:
-                    self.execute_commit()
+                self._currentBlock._focus_out()
 
             if not self.__must_save():
                 # Notify the UI to not show the query button pressed in
@@ -1170,8 +1169,7 @@
 
         try:
             if self._currentBlock is not None:
-                if self._currentBlock.autoCommit:
-                    self.execute_commit()
+                self._currentBlock._focus_out()
 
             if not self.__must_save():
                 # Notify the UI to not show the query button pressed in
@@ -1203,6 +1201,9 @@
             for block in self._logic._blockList:
                 block.cancel_query()
 
+            if self._currentBlock is not None:
+                self._currentBlock._focus_in()
+
             self.status_message(u_('Query canceled.'))
         finally:
             self.beginEditing()
@@ -1235,11 +1236,12 @@
                     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()
 

Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFBlock.py   2006-10-17 16:50:23 UTC (rev 
8823)
+++ trunk/gnue-forms/src/GFObjects/GFBlock.py   2006-10-17 16:59:36 UTC (rev 
8824)
@@ -269,7 +269,7 @@
 
     # FIXME: If an exception appears here, we have a problem: it is probably
     # too late to cancel the operation.
-    self.__focus_out()
+    self._focus_out()
 
     self._resultSet = event.resultSet
 
@@ -288,7 +288,7 @@
 
     self.__current_record_changed(True)
 
-    self.__focus_in()
+    self._focus_in()
 
 
   # ---------------------------------------------------------------------------
@@ -654,11 +654,11 @@
         if self._resultSet.isFirstRecord():
             return
 
-        self.__focus_out()
+        self._focus_out()
 
         self._resultSet.firstRecord()
 
-        self.__focus_in()
+        self._focus_in()
 
   # ---------------------------------------------------------------------------
 
@@ -675,11 +675,11 @@
         if self._resultSet.isFirstRecord():
             return
 
-        self.__focus_out()
+        self._focus_out()
 
         self._resultSet.prevRecord()
 
-        self.__focus_in()
+        self._focus_in()
 
   # ---------------------------------------------------------------------------
 
@@ -701,11 +701,11 @@
                 self.new_record()
             return
 
-        self.__focus_out()
+        self._focus_out()
 
         self._resultSet.nextRecord()
 
-        self.__focus_in()
+        self._focus_in()
 
   # ---------------------------------------------------------------------------
 
@@ -722,11 +722,11 @@
         if self._resultSet.isLastRecord():
             return
 
-        self.__focus_out()
+        self._focus_out()
 
         self._resultSet.lastRecord()
 
-        self.__focus_in()
+        self._focus_in()
 
   # ---------------------------------------------------------------------------
 
@@ -752,12 +752,12 @@
         if record_number == self._resultSet.getRecordNumber():
             return
 
-        self.__focus_out()
+        self._focus_out()
 
         if not self._resultSet.setRecord(record_number):
             self._resultSet.lastRecord()
 
-        self.__focus_in()
+        self._focus_in()
 
   # ---------------------------------------------------------------------------
 
@@ -790,11 +790,11 @@
         if self.mode == 'query':
             return
 
-        self.__focus_out()
+        self._focus_out()
 
         self._resultSet.insertRecord(self._lastValues)
 
-        self.__focus_in()
+        self._focus_in()
 
   # ---------------------------------------------------------------------------
 
@@ -812,11 +812,11 @@
         if self.mode == 'query':
             return
 
-        self.__focus_out()
+        self._focus_out()
 
         self._resultSet.duplicateRecord(exclude=exclude, include=include)
 
-        self.__focus_in()
+        self._focus_in()
 
   # ---------------------------------------------------------------------------
 
@@ -856,7 +856,6 @@
 
   def init_query(self):
 
-        self.__focus_out()
         self.mode = 'query'
         self.__query_values = {}
         self.__query_values.update(self._queryDefaults)
@@ -868,7 +867,6 @@
 
   def copy_query(self):
 
-        self.__focus_out()
         self.__query_values = {}
         self.__query_values.update(self.__last_query_values)
         self.__current_record_changed(True)
@@ -881,7 +879,6 @@
 
         self.mode = 'normal'
         self.__current_record_changed(True)
-        self.__focus_in()
 
   # ---------------------------------------------------------------------------
 
@@ -1075,7 +1072,7 @@
   # Shared code called whenever focus enters or leaves a record
   # ---------------------------------------------------------------------------
 
-  def __focus_in(self):
+  def _focus_in(self):
 
         if self._form.get_focus_block() is self:
             self.focus_in()
@@ -1087,7 +1084,7 @@
 
   # ---------------------------------------------------------------------------
 
-  def __focus_out(self):
+  def _focus_out(self):
 
         if self._form.get_focus_block() is self:
 





reply via email to

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