[PATCH newui] Use function instead of dummy UIObject for callback running nmce.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 pyanaconda/ui/gui/spokes/network.py |   41 ++++++++++++++++------------------
 1 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 9394037..4e45e38 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -920,6 +920,23 @@ class NetworkControlBox():
         return [row[DEVICES_COLUMN_OBJECT] for
                 row in self.builder.get_object("liststore_devices")]
 
+def run_nmce_with_lightbox(spoke, uuid):
+    from gi.repository import AnacondaWidgets
+    lb = AnacondaWidgets.lb_show_over(spoke)
+
+    lb.set_keep_below(True)
+    spoke.set_keep_below(True)
+
+    proc = subprocess.Popen(["nm-connection-editor", "--edit", "%s" %
+                              uuid])
+    #GLib.child_watch_add(proc.pid, lambda pid, condition: lb.destroy())
+
+    def destroy_lb(*args):
+        lb.destroy()
+
+    GLib.child_watch_add(proc.pid, destroy_lb)
+
+
 class NetworkSpoke(NormalSpoke):
     builderObjects = ["networkWindow", "liststore_wireless_network", "liststore_devices"]
     mainWidgetName = "networkWindow"
@@ -933,8 +950,7 @@ class NetworkSpoke(NormalSpoke):
     def __init__(self, *args, **kwargs):
         NormalSpoke.__init__(self, *args, **kwargs)
         def run_nmce_cb(uuid):
-            embedder = NMCEEmbedder(self.data)
-            embedder.run(self.window, uuid)
+            run_nmce_with_lightbox(self.window, uuid)
         self.network_control_box = NetworkControlBox(self.builder,
             configure_callback=run_nmce_cb)
 
@@ -995,8 +1011,7 @@ class NetworkStandaloneSpoke(StandaloneSpoke):
     def __init__(self, *args, **kwargs):
         StandaloneSpoke.__init__(self, *args, **kwargs)
         def run_nmce_cb(uuid):
-            embedder = NMCEEmbedder(self.data)
-            embedder.run(self.window, uuid)
+            run_nmce_with_lightbox(self.window, uuid)
         self.network_control_box = NetworkControlBox(self.builder,
             configure_callback=run_nmce_cb)
         parent = self.builder.get_object("AnacondaStandaloneWindow-action_area5")
@@ -1062,24 +1077,6 @@ def getKSNetworkData(device):
 
     return retval
 
-class NMCEEmbedder(UIObject):
-    builderObjects = ["nmceEmbedder"]
-    mainWidgetName = "nmceEmbedder"
-    uiFile = "spokes/network.ui"
-    def run(self, spoke, uuid):
-        from gi.repository import AnacondaWidgets
-        self.lb = AnacondaWidgets.lb_show_over(spoke)
-
-        self.lb.set_keep_below(True)
-        spoke.set_keep_below(True)
-
-        proc = subprocess.Popen(["nm-connection-editor", "--edit", "%s" %
-                                  uuid])
-        GLib.child_watch_add(proc.pid, self.on_nmce_exited)
-
-    def on_nmce_exited(self, pid, condition):
-        self.lb.destroy()
-
 if __name__ == "__main__":
 
     win = Gtk.Window()
-- 
1.7.7.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux