[PATCH newui 5/5] 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 4b30be1..d8cf845 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
@@ -86,6 +84,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)
@@ -551,8 +550,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
@@ -719,6 +724,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