[node-patches] Change in ovirt-node[master]: tui: Simplify dialog handling

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


Fabian Deutsch has uploaded a new change for review.

Change subject: tui: Simplify dialog handling
......................................................................

tui: Simplify dialog handling

Change-Id: I5dd40de199b50ff05645f0d63f4b05bd102b6bb4
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/ui/tui.py
1 file changed, 9 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/43/9943/1

diff --git a/scripts/tui/src/ovirt/node/ui/tui.py b/scripts/tui/src/ovirt/node/ui/tui.py
index c7e2287..d399ea5 100644
--- a/scripts/tui/src/ovirt/node/ui/tui.py
+++ b/scripts/tui/src/ovirt/node/ui/tui.py
@@ -221,18 +221,15 @@
         return dialog
 
     def __close_dialog(self, dialog):
-        if type(self.__loop.widget) is ovirt.node.ui.widgets.ModalDialog:
-            if dialog == self.__widget_stack[-1]:
-                self.__widget_stack.pop()
-                if len(self.__widget_stack) > 0:
-                    self.__loop.widget = self.__widget_stack[:-1]
-                else:
-                    self.logger.debug("No more dialog, main frame " + \
-                                 "%s" % self.__main_frame)
-                    self.__loop.widget = self.__main_frame
-            self.logger.debug("Loop widget: %s" % self.__loop.widget)
-            self._draw_screen()
-            self.logger.debug("Dialog closed")
+        self.logger.debug("Widget stack: %s" % self.__widget_stack)
+        new_stack = [w for w in self.__widget_stack if w != dialog]
+        self.__widget_stack = new_stack
+        self.logger.debug("New widget stack: %s" % self.__widget_stack)
+        if self.__widget_stack:
+            self.__loop.widget = self.__widget_stack[-1]
+        else:
+            self.__loop.widget = self.__main_frame
+        self.logger.debug("Dialog %s closed" % dialog)
 
     def __filter_hotkeys(self, keys, raw):
         key = str(keys)


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

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