commit-gnue
[Top][All Lists]
Advanced

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

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


From: reinhard
Subject: [gnue] r8895 - trunk/gnue-forms/src
Date: Sat, 21 Oct 2006 09:33:58 -0500 (CDT)

Author: reinhard
Date: 2006-10-21 09:33:56 -0500 (Sat, 21 Oct 2006)
New Revision: 8895

Modified:
   trunk/gnue-forms/src/GFForm.py
Log:
Made it possible to exit a form without saving even if the current entry
contains invalid data.


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2006-10-21 14:15:50 UTC (rev 8894)
+++ trunk/gnue-forms/src/GFForm.py      2006-10-21 14:33:56 UTC (rev 8895)
@@ -1291,6 +1291,11 @@
         # self.endEditing()             # happens via _focus_out()
 
         try:
+            # We *must* run _focus_out() here: letting the user leave an entry
+            # with an invalid value here would make it possible to enter an
+            # invalid value, switch to query mode, move the focus somewhere
+            # else, cancel the query (and so getting back the original result
+            # set) and then saving the unchecked data.
             if self._currentBlock is not None:
                 self._currentBlock._focus_out()
 
@@ -1795,11 +1800,13 @@
 
     def close(self):
 
-        if self._currentBlock is not None:
-            self._currentBlock._focus_out()
-
+        # FIXME: Changes in the current entry are not yet saved in the field if
+        # this was caused by a click on the close button of the window,
+        # because...
         self.processTrigger('Pre-Exit', ignoreAbort = False)
 
+        # ... we would want to be able to exit here without saving even if the
+        # current entry contains an invalid value.
         if not self.__must_save():
             return
 
@@ -1830,6 +1837,6 @@
             return False
 
         if answer:
-            self.execute_commit()
+            self.commit()
 
         return True





reply via email to

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