[node-patches] Change in ovirt-node[master]: Put a close button on the ping page

rbarry at redhat.com rbarry at redhat.com
Tue Apr 1 19:02:43 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Put a close button on the ping page
......................................................................

Put a close button on the ping page

Even though the ping page was a normal plugin, switching back to
the regular list of plugins was unintuitive. Add a close button
so users can switch back either way.

Change-Id: I5b925443414df7e538310110e4b7a16d4244fcfd
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1083077
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/setup/core/network_page.py
M src/ovirt/node/setup/core/ping.py
2 files changed, 12 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/38/26338/1

diff --git a/src/ovirt/node/setup/core/network_page.py b/src/ovirt/node/setup/core/network_page.py
index 152e38c..9adcaf8 100644
--- a/src/ovirt/node/setup/core/network_page.py
+++ b/src/ovirt/node/setup/core/network_page.py
@@ -21,7 +21,7 @@
 from ovirt.node import plugins, ui, valid, utils, config
 from ovirt.node.config import defaults
 from ovirt.node.plugins import Changeset
-from ovirt.node.setup.core import ping
+import ping
 from ovirt.node.utils import network
 
 """
@@ -317,7 +317,8 @@
 
         if "button.ping" in changes:
             self.logger.debug("Opening ping page")
-            self.application.switch_to_plugin(ping.Plugin)
+            self.application.switch_to_plugin(
+                ping.Plugin)
             return
 
         if "dialog.nic.identify" in changes:
diff --git a/src/ovirt/node/setup/core/ping.py b/src/ovirt/node/setup/core/ping.py
index 7b01a0c..e877526 100644
--- a/src/ovirt/node/setup/core/ping.py
+++ b/src/ovirt/node/setup/core/ping.py
@@ -20,6 +20,7 @@
 # also available at http://www.gnu.org/copyleft/gpl.html.
 from ovirt.node import plugins, valid, ui
 from ovirt.node.utils import process
+import network_page
 import threading
 
 
@@ -72,6 +73,7 @@
               ui.Entry("ping.count", _("Count:")),
               ui.Divider("divider[1]"),
               ui.SaveButton("ping.do_ping", _("Ping")),
+              ui.Button("ping.close", _("Close")),
               ui.Divider("divider[2]"),
               ui.Label("ping.result", _("Result:")),
               ]
@@ -96,7 +98,13 @@
         case it is called by on_change
         """
 
-        if "ping.address" in self._model:
+        if "ping.close" in effective_changes:
+            if ping.isAlive():
+                ping._Thread__stop()
+            self.application.switch_to_plugin(
+                network_page.Plugin)
+            return
+        elif "ping.address" in self._model:
             addr = self._model["ping.address"]
             count = self._model["ping.count"]
             self.logger.debug("Pinging %s" % addr)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b925443414df7e538310110e4b7a16d4244fcfd
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list