dabo Commit
Revision 2776
Date: 2007-02-03 18:32:59 -0800 (Sat, 03 Feb 2007)
Author: Paul

Changed:
U   trunk/dabo/ui/uiwx/dForm.py

Log:
Added a prompt clause to dForm.delete(), so that user code can call it without
the automatic areYouSure() box popping up.


Diff:
Modified: trunk/dabo/ui/uiwx/dForm.py
===================================================================
--- trunk/dabo/ui/uiwx/dForm.py 2007-02-04 01:25:53 UTC (rev 2775)
+++ trunk/dabo/ui/uiwx/dForm.py 2007-02-04 02:32:59 UTC (rev 2776)
@@ -403,7 +403,7 @@
                return ret
                
 
-       def delete(self, dataSource=None, message=None):
+       def delete(self, dataSource=None, message=None, prompt=True):
                """ Ask the bizobj to delete the current record."""
                bizobj = self.getBizobj(dataSource)
                if bizobj is None:
@@ -426,7 +426,7 @@
                if message is None:
                        message = _("This will delete the current record from 
%s, and cannot "
                                        "be canceled.\n\n Are you sure you want 
to do this?") % ds
-               if dabo.ui.areYouSure(message, defaultNo=True):
+               if not prompt or dabo.ui.areYouSure(message, defaultNo=True):
                        try:
                                bizobj.delete()
                                self.setStatusText(_("Record Deleted."))




_______________________________________________
Post Messages to: Dabo-dev@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to