[node-patches] Change in ovirt-node[master]: ui: Button can be disabled at creation time

fabiand at fedoraproject.org fabiand at fedoraproject.org
Fri Feb 22 12:18:07 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: ui: Button can be disabled at creation time
......................................................................

ui: Button can be disabled at creation time

Change-Id: I8fe76ba826571fb4b8f551636cc9b32feabd0824
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/ui/urwid_builder.py
M scripts/tui/src/ovirt/node/ui/widgets.py
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/09/12309/1

diff --git a/scripts/tui/src/ovirt/node/ui/urwid_builder.py b/scripts/tui/src/ovirt/node/ui/urwid_builder.py
index 66088b4..5b1bd8f 100644
--- a/scripts/tui/src/ovirt/node/ui/urwid_builder.py
+++ b/scripts/tui/src/ovirt/node/ui/urwid_builder.py
@@ -84,7 +84,7 @@
         return self._build_label(ui_header)
 
     def _build_button(self, ui_button):
-        widget = uw.Button(ui_button.text())
+        widget = uw.Button(ui_button.text(), ui_button.enabled())
 
         def on_widget_click_cb(widget, data=None):
             change = {ui_button.path: True}
diff --git a/scripts/tui/src/ovirt/node/ui/widgets.py b/scripts/tui/src/ovirt/node/ui/widgets.py
index 1f8bcba..b740909 100644
--- a/scripts/tui/src/ovirt/node/ui/widgets.py
+++ b/scripts/tui/src/ovirt/node/ui/widgets.py
@@ -428,7 +428,7 @@
     _button_attr = "plugin.widget.button"
     _button_disabled_attr = "plugin.widget.button.disabled"
 
-    def __init__(self, label):
+    def __init__(self, label, is_enabled=True):
         self._button = urwid.Button(label)
 
         def on_click_cb(widget, data=None):
@@ -441,6 +441,8 @@
         self._padding = urwid.Padding(self._button_attrmap,
                                       width=self.width())
 
+        self.enable(is_enabled)
+
         super(Button, self).__init__(self._padding)
 
     def enable(self, is_enabled):


--
To view, visit http://gerrit.ovirt.org/12309
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fe76ba826571fb4b8f551636cc9b32feabd0824
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list