[node-patches] Change in ovirt-node[master]: ui: Pull out notice area
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Wed Feb 6 09:17:56 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: ui: Pull out notice area
......................................................................
ui: Pull out notice area
Change-Id: I56d31f7684b2f1be42be5d2fa9587af2e9cf662f
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/ui/widgets.py
1 file changed, 23 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/91/11791/1
diff --git a/scripts/tui/src/ovirt/node/ui/widgets.py b/scripts/tui/src/ovirt/node/ui/widgets.py
index 7a95435..6153a49 100644
--- a/scripts/tui/src/ovirt/node/ui/widgets.py
+++ b/scripts/tui/src/ovirt/node/ui/widgets.py
@@ -305,6 +305,29 @@
return self._text
+class NoticeDecoration(urwid.WidgetWrap):
+ _notice_txt = None
+ _notice_widget = None
+
+ notice = property(lambda self: self.__notice_txt,
+ lambda self, v: self.set_notice(v))
+
+ def __init__(self, target):
+ self._target = target
+ self._pile = urwid.Pile([target])
+ super(NoticeDecoration, self).__init__([self._pile])
+
+ def set_notice(self, txt=None):
+ if txt:
+ self._notice_txt = txt
+ if not self._notice_widget:
+ self._notice_widget = urwid.Text(self._notice_txt)
+ self._notice_widget.set_text(txt)
+ self._pile.contents.append(self._notice_widget)
+ else:
+ self._pile.contents = [self._target]
+
+
class Entry(urwid.WidgetWrap):
signals = ['change', 'click']
--
To view, visit http://gerrit.ovirt.org/11791
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I56d31f7684b2f1be42be5d2fa9587af2e9cf662f
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