[node-patches] Change in ovirt-node[master]: ui: Disable all SaveButtons on invalid data

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue Dec 11 20:09:42 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: ui: Disable all SaveButtons on invalid data
......................................................................

ui: Disable all SaveButtons on invalid data

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/59/9959/1

diff --git a/scripts/tui/src/ovirt/node/ui/builder.py b/scripts/tui/src/ovirt/node/ui/builder.py
index 26ead9e..fc6c50d 100644
--- a/scripts/tui/src/ovirt/node/ui/builder.py
+++ b/scripts/tui/src/ovirt/node/ui/builder.py
@@ -188,11 +188,14 @@
 
 
 def build_button(path, item, tui, plugin):
+    itemtype = type(item)
     widget = ui.widgets.Button(item.text())
+
+    if itemtype in [ui.SaveButton]:
+        plugin.sig_valid.connect(lambda w, v: widget.enable(v))
 
     def on_widget_click_cb(widget, data=None):
         LOGGER.debug("Button click: %s %s" % (path, widget))
-        itemtype = type(item)
         if itemtype is ui.Button:
             plugin._on_ui_change({path: True})
         if itemtype in [ui.Button, ui.SaveButton]:
diff --git a/scripts/tui/src/ovirt/node/ui/tui.py b/scripts/tui/src/ovirt/node/ui/tui.py
index d399ea5..0fc6e91 100644
--- a/scripts/tui/src/ovirt/node/ui/tui.py
+++ b/scripts/tui/src/ovirt/node/ui/tui.py
@@ -80,7 +80,7 @@
                ('plugin.widget.header', 'black, bold'),
                ('plugin.widget.divider', element_styles["text"]),
                ('plugin.widget.button', 'dark blue'),
-               ('plugin.widget.button.disabled', 'light gray'),
+               ('plugin.widget.button.disabled', 'dark gray'),
                ('plugin.widget.label', element_styles["text"]),
                ('plugin.widget.label.keyword', element_styles["label"]),
                ('plugin.widget.progressbar.box', 'light gray'),


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f51340ca1bc0ac8488af8ccd1ef0772b53ad928
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