[node-patches] Change in ovirt-node[ovirt-3.6]: Have TransactionProgressDialog set an event when it's done

fabiand at redhat.com fabiand at redhat.com
Mon Oct 12 21:53:26 UTC 2015


Fabian Deutsch has uploaded a new change for review.

Change subject: Have TransactionProgressDialog set an event when it's done
......................................................................

Have TransactionProgressDialog set an event when it's done

Opening other dialogs (from the hosted engine page, for example)
immediately overwrites what the TUI is doing, and there's no
convenient way to wait. For cases when we want to (like running
transactions), we can use threading.Event events to wait

Change-Id: I4bc11b09a50ee166f7701c4af1e7c1ab2e333b98
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/ui/__init__.py
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/40/47240/1

diff --git a/src/ovirt/node/ui/__init__.py b/src/ovirt/node/ui/__init__.py
index bddacd8..7915d92 100644
--- a/src/ovirt/node/ui/__init__.py
+++ b/src/ovirt/node/ui/__init__.py
@@ -21,6 +21,7 @@
 from ovirt.node import base
 from ovirt.node.utils import console, security
 from ovirt.node.exceptions import InvalidData
+import threading
 
 """
 This contains abstract UI Elements
@@ -913,6 +914,12 @@
 
         self._close_button = CloseButton("button.close")
         self.buttons = [self._close_button]
+        self.buttons[0].on_activate.connect(self._clear_event)
+        self.event = threading.Event()
+
+    def _clear_event(self, *args, **kwargs):
+        self.event.set()
+        self.event.clear()
 
     def add_update(self, txt):
         self.texts.append(txt)
@@ -953,6 +960,7 @@
                              exc_info=True)
             self.add_update("\nAn error occurred while applying the changes:")
             self.add_update("%s" % e)
+            self._clear_event()
 
         if captured.stderr.getvalue():
             se = captured.stderr.getvalue()


-- 
To view, visit https://gerrit.ovirt.org/47240
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4bc11b09a50ee166f7701c4af1e7c1ab2e333b98
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list