summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/ui/event
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2011-08-10 02:23:02 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-08-18 02:57:45 +0200
commit9e5ad1ef6566f609cea1bb09bdec0a73299f93d6 (patch)
tree44292e0e81eec8c183870b06ef320b2a1d3ee89b /wizards/com/sun/star/wizards/ui/event
parent1723ba129281ac791a2e5faad67cd9a7de2b8ab4 (diff)
Implement add button
Diffstat (limited to 'wizards/com/sun/star/wizards/ui/event')
-rw-r--r--wizards/com/sun/star/wizards/ui/event/DataAware.py26
-rw-r--r--wizards/com/sun/star/wizards/ui/event/UnoDataAware.py2
2 files changed, 27 insertions, 1 deletions
diff --git a/wizards/com/sun/star/wizards/ui/event/DataAware.py b/wizards/com/sun/star/wizards/ui/event/DataAware.py
index b611c3a79069..5975dcad9d55 100644
--- a/wizards/com/sun/star/wizards/ui/event/DataAware.py
+++ b/wizards/com/sun/star/wizards/ui/event/DataAware.py
@@ -69,6 +69,22 @@ class DataAware(object):
self.enableControls(data)
'''
+ sets a new data object. Optionally
+ update the UI.
+ @param obj the new data object.
+ @param updateUI if true updateUI() will be called.
+ '''
+
+ def setDataObject(self, obj, updateUI):
+ if obj is not None and not isinstance(obj, type(self._field)):
+ return
+
+ self._dataObject = obj
+
+ if updateUI:
+ self.updateUI()
+
+ '''
updates the DataObject according to
the current state of the UI control.
'''
@@ -85,3 +101,13 @@ class DataAware(object):
self.enableControls(ui)
except Exception:
traceback.print_exc()
+ '''
+ given a collection containing DataAware objects,
+ calls updateUI() on each memebr of the collection.
+ @param dataAwares a collection containing DataAware objects.
+ '''
+
+ @classmethod
+ def updateUIs(self, dataAwares):
+ for i in dataAwares:
+ i.updateUI()
diff --git a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.py b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.py
index 83c61db5a6a1..8afef0a08152 100644
--- a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.py
+++ b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.py
@@ -26,7 +26,7 @@ class UnoDataAware(DataAware):
def enableControls(self, value):
for i in self.disableObjects:
Helper.setUnoPropertyValue(
- i.Model, PropertyNames.PROPERTY_ENABLED, value)
+ i.Model, PropertyNames.PROPERTY_ENABLED, bool(value))
def setToUI(self, value):
if self.isShort: