[node-patches] Change in ovirt-node[master]: performance_page.py: Using button "Reload" instead of "Reset...
hadong0720 at gmail.com
hadong0720 at gmail.com
Thu Jun 27 07:49:53 UTC 2013
hadong has uploaded a new change for review.
Change subject: performance_page.py: Using button "Reload" instead of "Reset"
......................................................................
performance_page.py: Using button "Reload" instead of "Reset"
Previously the item "Current Active profile" still show old value after
setting it with another profile,so we need "Reload" button to reload all
UI data to the current model.Also "Reset" button wasn't necessary for this
page
Now using button "Reload" instead of "Reset"
Change-Id: I9870e17a098de4045fbdb75c8b02e5cc0f594816
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=978821
Signef-off-by: hadong <hadong0720 at gmail.com>
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/setup/core/performance_page.py
M src/ovirt/node/ui/__init__.py
M src/ovirt/node/ui/urwid_builder.py
3 files changed, 13 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/73/16173/1
diff --git a/src/ovirt/node/setup/core/performance_page.py b/src/ovirt/node/setup/core/performance_page.py
index 74b8b3d..6096c1a 100644
--- a/src/ovirt/node/setup/core/performance_page.py
+++ b/src/ovirt/node/setup/core/performance_page.py
@@ -60,6 +60,7 @@
]
page = ui.Page("page", ws)
self.widgets.add(page)
+ page.buttons = [ui.SaveButton("page.save"), ui.ReloadButton("page.reload")]
return page
def on_change(self, changes):
diff --git a/src/ovirt/node/ui/__init__.py b/src/ovirt/node/ui/__init__.py
index 791886a..2822bbb 100644
--- a/src/ovirt/node/ui/__init__.py
+++ b/src/ovirt/node/ui/__init__.py
@@ -410,6 +410,16 @@
self.on_activate.connect(ReloadAction())
+class ReloadButton(Button):
+ """This button calls the ReloadAction to reload all UI data to the current
+ model.
+ """
+ def __init__(self, path, label="Reload", enabled=True):
+ super(ReloadButton, self).__init__(path, label, enabled)
+ self.on_activate.clear()
+ self.on_activate.connect(ReloadAction())
+
+
class CloseButton(Button):
"""The close button can be used to close the top-most dialog
"""
diff --git a/src/ovirt/node/ui/urwid_builder.py b/src/ovirt/node/ui/urwid_builder.py
index e697996..b1eb16b 100644
--- a/src/ovirt/node/ui/urwid_builder.py
+++ b/src/ovirt/node/ui/urwid_builder.py
@@ -133,7 +133,8 @@
button_widgets = []
for element in children:
assert type(element) in [ui.SaveButton, ui.ResetButton,
- ui.CloseButton, ui.Button, ui.QuitButton]
+ ui.ReloadButton, ui.CloseButton,
+ ui.Button, ui.QuitButton]
widget = self._build_button(element)
button_widgets.append(widget)
max_width = int(1.5 * max([w.width() for w in button_widgets]))
--
To view, visit http://gerrit.ovirt.org/16173
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9870e17a098de4045fbdb75c8b02e5cc0f594816
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>
More information about the node-patches
mailing list