dabo Commit
Revision 1376
Date: 2005-09-22 21:01:10 -0700 (Thu, 22 Sep 2005)
Author: paul
Changed:
U trunk/dabo/lib/datanav/Grid.py
U trunk/dabo/lib/datanav/Page.py
U trunk/dabo/ui/uiwx/dForm.py
Log:
Just a few minor fixes. When a record is deleted from a datanav grid, call
fillGrid() so that the grid is immediately notified that a record is gone.
Otherwise, it will seem like the deletion takes quite a while as the grid
won't refresh for another couple seconds.
Moved some code out of a try block, where we are only wanting to react if
the bizobj.new() call raises an exception, not if an exception is raised
in any of those other calls.
Diff:
Modified: trunk/dabo/lib/datanav/Grid.py
===================================================================
--- trunk/dabo/lib/datanav/Grid.py 2005-09-22 23:44:38 UTC (rev 1375)
+++ trunk/dabo/lib/datanav/Grid.py 2005-09-23 04:01:10 UTC (rev 1376)
@@ -145,7 +145,8 @@
def deleteRecord(self, evt=None):
""" Request that the current row be deleted."""
self.Parent.deleteRecord(self.DataSource)
- self.setFocus() ## required or assertion happens on Gtk
+ self.fillGrid()
+# self.setFocus() ## required or assertion happens on Gtk
def pickRecord(self, evt=None):
Modified: trunk/dabo/lib/datanav/Page.py
===================================================================
--- trunk/dabo/lib/datanav/Page.py 2005-09-22 23:44:38 UTC (rev 1375)
+++ trunk/dabo/lib/datanav/Page.py 2005-09-23 04:01:10 UTC (rev 1376)
@@ -72,7 +72,7 @@
class Page(dabo.ui.dPage):
def newRecord(self, ds=None):
- """ Called by a browse grid when the user wants to edit the
current row.
+ """ Called by a browse grid when the user wants to add a new
row.
"""
if ds is None:
self.Form.new()
Modified: trunk/dabo/ui/uiwx/dForm.py
===================================================================
--- trunk/dabo/ui/uiwx/dForm.py 2005-09-22 23:44:38 UTC (rev 1375)
+++ trunk/dabo/ui/uiwx/dForm.py 2005-09-23 04:01:10 UTC (rev 1376)
@@ -276,7 +276,8 @@
return False
self.afterSave()
return True
-
+
+
def cancel(self, dataSource=None):
""" Ask the bizobj to cancel its changes.
@@ -452,18 +453,20 @@
if err:
self.notifyUser(err)
return
+
try:
bizobj.new()
- statusText = self.getCurrentRecordText(dataSource)
- self.setStatusText(statusText)
- self.refreshControls()
-
- # Notify listeners that the row number changed:
- self.raiseEvent(dEvents.RowNumChanged)
-
except dException.dException, e:
self.notifyUser(_("Add new record failed with
response:\n\n%s" % str(e)),
severe=True)
+
+ statusText = self.getCurrentRecordText(dataSource)
+ self.setStatusText(statusText)
+ self.refreshControls()
+
+ # Notify listeners that the row number changed:
+ self.raiseEvent(dEvents.RowNumChanged)
+
self.afterNew()
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev