dabo Commit
Revision 6751
Date: 2011-08-06 16:10:51 -0700 (Sat, 06 Aug 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6751

Changed:
U   trunk/dabo/settings.py
U   trunk/dabo/ui/dDataControlMixinBase.py

Log:
Added global setting autoDisableDataControls to handle new data controls 
behavior on empty dataset.
By default, previous behavior is preserved.

Diff:
Modified: trunk/dabo/settings.py
===================================================================
--- trunk/dabo/settings.py      2011-08-06 20:17:02 UTC (rev 6750)
+++ trunk/dabo/settings.py      2011-08-06 23:10:51 UTC (rev 6751)
@@ -224,6 +224,10 @@
 # callAfter() call?
 saveCallAfterStack = False
 
+# When set to True, data control bound to the dBizobj source is automatically 
disabled
+# if related dataset is empty (RowCount = 0), to prevent user interactions.
+autoDisableDataControls = False
+
 ### Settings - end
 
 

Modified: trunk/dabo/ui/dDataControlMixinBase.py
===================================================================
--- trunk/dabo/ui/dDataControlMixinBase.py      2011-08-06 20:17:02 UTC (rev 
6750)
+++ trunk/dabo/ui/dDataControlMixinBase.py      2011-08-06 23:10:51 UTC (rev 
6751)
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 """dDataControlMixin.py: Provide behavior common to all        data-aware 
dControls."""
-import dabo, dabo.ui
+import dabo
+import dabo.ui
 import dabo.dEvents as dEvents
 import dabo.dException as dException
 from dabo.dObject import dObject
@@ -13,6 +14,7 @@
 class dDataControlMixinBase(dabo.ui.dControlMixin):
        """Provide common functionality for the data-aware controls."""
        def __init__(self, *args, **kwargs):
+               self._disableOnEmptyDataSource = dabo.autoDisableDataControls
                self._fldValidFailed = False
                # Control enabling/disabling on empty data source helper 
attribute.
                self._dsDisabled = False



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to