[PATCH f19-branch] Add modified network spoke to LiveDVD (#963059)

Radek Vykydal rvykydal at redhat.com
Tue Jun 4 10:58:17 UTC 2013


The purpose is to:
- tell user to use DE tools to configure network
- allow user to set hostname

This is the patch from:
http://www.redhat.com/archives/anaconda-devel-list/2013-May/msg00067.html

---
 pyanaconda/ui/gui/spokes/network.glade | 18 ++++++++++++++++--
 pyanaconda/ui/gui/spokes/network.py    | 20 +++++++++++++-------
 2 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/network.glade b/pyanaconda/ui/gui/spokes/network.glade
index fec6a6a..4e1ac74 100644
--- a/pyanaconda/ui/gui/spokes/network.glade
+++ b/pyanaconda/ui/gui/spokes/network.glade
@@ -263,12 +263,26 @@ updates available for you.</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
+                  <object class="GtkLabel" id="live_hint_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">start</property>
+                    <property name="label" translatable="yes">Please use the live desktop environment's tools for customizing your network configuration.  You can set the hostname here.</property>
+                    <property name="ellipsize">start</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
                   <object class="GtkVBox" id="networkControlBox_vbox">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="spacing">12</property>
                     <child>
-                      <object class="GtkVBox" id="vbox2">
+                      <object class="GtkVBox" id="network_config_vbox">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="spacing">3</property>
@@ -2478,7 +2492,7 @@ updates available for you.</property>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">0</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
               </object>
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 432fc09..4c3c847 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -357,8 +357,10 @@ class NetworkControlBox(object):
             if dev_type == NetworkManager.DeviceType.ETHERNET:
                 dev_name = device.get_iface()
             elif dev_type == NetworkManager.DeviceType.WIFI:
-                dev_name = device.get_iface()
-                dev_info = device.get_active_access_point().get_ssid()
+                ap = device.get_active_access_point()
+                if ap:
+                    dev_name = device.get_iface()
+                    dev_info = ap.get_ssid()
             elif dev_type == NetworkManager.DeviceType.BOND:
                 dev_name = device.get_iface()
                 dev_info = [d.get_iface() for d in device.get_slaves()]
@@ -1104,7 +1106,8 @@ class NetworkSpoke(NormalSpoke):
     @property
     def completed(self):
         # TODO: check also if source requires updates when implemented
-        return len(self.network_control_box.activated_connections()) > 0
+        return (not flags.can_touch_runtime_system("require network connection")
+                or len(self.network_control_box.activated_connections()) > 0)
 
     @property
     def mandatory(self):
@@ -1168,13 +1171,16 @@ class NetworkSpoke(NormalSpoke):
 
         return msg
 
-    @property
-    def showable(self):
-        return flags.can_touch_runtime_system("allow network configuration")
-
     def initialize(self):
         NormalSpoke.initialize(self)
         self.network_control_box.initialize()
+        if not flags.can_touch_runtime_system("hide hint to use network configuration in DE"):
+            self.builder.get_object("network_config_vbox").set_no_show_all(True)
+            self.builder.get_object("network_config_vbox").hide()
+        else:
+            self.builder.get_object("live_hint_label").set_no_show_all(True)
+            self.builder.get_object("live_hint_label").hide()
+
         if not self.data.network.seen:
             _update_network_data(self.data, self.network_control_box)
 
-- 
1.7.11.7



More information about the anaconda-patches mailing list