[PATCH newui 7/7] Network spoke: show unplugged info in device list.

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

 



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

diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index f127131..fbb2d05 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -22,8 +22,6 @@
 # TODO:
 
 # - move callback connection to populate?
-# - more info on devices in list and notebook header
-#   -> another UI?
 
 # - which type of spoke or category?
 # - Automatically reconnecting wifi after failure
@@ -85,6 +83,7 @@ def getNMObjProperty(object, nm_iface_suffix, property):
                            property)
 
 
+DEVICES_COLUMN_TITLE  = 2
 DEVICES_COLUMN_OBJECT = 3
 
 # TODO: We don't give reason for unavailable (firmware/, cable)
@@ -528,8 +527,14 @@ class NetworkSpoke(NormalSpoke):
         return str
 
     def _dev_title(self, device):
-        title = '<span size="large">%s (%s)</span>' % (self._dev_type_str(device),
-                                                       device.get_iface())
+        unplugged = ''
+        if (device.get_device_type() == NetworkManager.DeviceType.ETHERNET
+            and not device.get_carrier()):
+            # Translators: ethernet cable is unplugged
+            unplugged = ', <i>%s</i>' % _("unplugged")
+        title = '<span size="large">%s (%s%s)</span>' % (self._dev_type_str(device),
+                                                         device.get_iface(),
+                                                         unplugged)
         title += '\n<span size="small">%s %s</span>' % (device.get_vendor(),
                                                         device.get_product())
         return title
@@ -696,6 +701,12 @@ class NetworkSpoke(NormalSpoke):
         elif ipv6_addr:
             self.builder.get_object("heading_%s_ipv6" % dt).set_label(_("IP Address"))
 
+        self._refresh_carrier_info()
+
+    def _refresh_carrier_info(self):
+        for i in self.builder.get_object("liststore_devices"):
+            i[DEVICES_COLUMN_TITLE] = self._dev_title(i[DEVICES_COLUMN_OBJECT])
+
     def _refresh_header_ui(self, device, dev_type_str):
 
         if dev_type_str == "wired":
-- 
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