commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r9253 - in trunk/gnue-forms/src: . input/displayHandlers


From: johannes
Subject: [gnue] r9253 - in trunk/gnue-forms/src: . input/displayHandlers
Date: Wed, 10 Jan 2007 08:27:47 -0600 (CST)

Author: johannes
Date: 2007-01-10 08:27:45 -0600 (Wed, 10 Jan 2007)
New Revision: 9253

Modified:
   trunk/gnue-forms/src/GFForm.py
   trunk/gnue-forms/src/input/displayHandlers/Cursor.py
Log:
Don't call __updateFieldValue more than once.  This fixes autoquery 
support on wxMSW and QT3


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2007-01-10 12:59:02 UTC (rev 9252)
+++ trunk/gnue-forms/src/GFForm.py      2007-01-10 14:27:45 UTC (rev 9253)
@@ -1098,7 +1098,7 @@
         self.__editing_blocked = True
 
         try:
-            if self._currentEntry:            
+            if self._currentEntry:
                 # Validation triggers
                 self._currentEntry.validate()
                 if pageChange:

Modified: trunk/gnue-forms/src/input/displayHandlers/Cursor.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2007-01-10 
12:59:02 UTC (rev 9252)
+++ trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2007-01-10 
14:27:45 UTC (rev 9253)
@@ -64,6 +64,7 @@
         self.field = entry._field     # The GFField associated with that 
GFEntry
         self.editing = False          # Is handler in edit mode
         self.modified = False         # Have we been modified??
+        self.updating = False         # Is an updateFieldValue already running
         self.display = u""            # The current display-formatted value
         self.subEventHandler = subEventHandler
 
@@ -173,20 +174,17 @@
         # Set editing to False early. The later call to __updateFieldValue()
         # can, if it is an autoquery field, cause a query to run, in which case
         # editing should not be True at that moment.
-        self.editing = False
 
         self._selection1 = None
 
         if self.modified:
-            try:
-                self.__updateFieldValue()
-            except:
-                self.editing = True
-                raise
+            self.__updateFieldValue()
+            self.editing = False
         else:
             # If we don't have to update the field value, we need to refresh
             # the display, because the selection has been deleted, and the
             # display string could be different from editing to non-editing.
+            self.editing = False
             self.generateRefreshEvent()
 
 
@@ -343,7 +341,7 @@
         if hasattr(self.field, 'fk_source'):
             try:
                 self.__updateFieldValue()
-                self.modified = False
+
             except Exception:
                 # We don't care about exceptions now, the user can still
                 # correct the mistake
@@ -578,7 +576,7 @@
         handler.
         """
 
-        if self.isPending ():
+        if self.isPending():
             try:
                 self.__updateFieldValue()
             except:
@@ -586,5 +584,12 @@
 
     def __updateFieldValue(self):
 
-        value = self.parse_display(self.display)
-        self.field.set_value(value)
+        if not self.updating:
+            self.updating = True
+            try:
+                value = self.parse_display(self.display)
+                self.field.set_value(value)
+                self.modified = False
+
+            finally:
+                self.updating = False





reply via email to

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