[PATCH 2/5] Add a description to DiskDevice, and use it in the UI.

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

 



Right now we identify disks as partedDisk.model, which looks really bad
when using DM-based devices.  Add a description to DiskDevice,
defaulting do partedDisk.model, and use it in the UI, so that subclasses
can easily replace this with more useful text.
---
 iw/autopart_type.py            |    2 +-
 iw/partition_ui_helpers_gui.py |    2 +-
 storage/devices.py             |    4 ++++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/iw/autopart_type.py b/iw/autopart_type.py
index 9c04e52..2695b94 100644
--- a/iw/autopart_type.py
+++ b/iw/autopart_type.py
@@ -487,7 +487,7 @@ class PartitionTypeWindow(InstallWindow):
         for disk in self.storage.disks:
             if disk.name not in self.anaconda.id.bootloader.drivelist:
                 continue
-            dispstr = "%s %8.0f MB %s" %(disk.name, disk.size, disk.model)
+            dispstr = "%s %8.0f MB %s" %(disk.name, disk.size, disk.description)
             i = bootstore.append(None)
             bootstore[i] = (dispstr, disk.name)
             if disk.name == defaultBoot:
diff --git a/iw/partition_ui_helpers_gui.py b/iw/partition_ui_helpers_gui.py
index f73903e..f5650e9 100644
--- a/iw/partition_ui_helpers_gui.py
+++ b/iw/partition_ui_helpers_gui.py
@@ -155,7 +155,7 @@ def createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=True,
         sizestr = "%8.0f MB" % disk.size
         drivelist.append_row((disk.name,
                               sizestr,
-                              disk.model),
+                              disk.description),
                              selected)
 
     if len(disks) < 2:
diff --git a/storage/devices.py b/storage/devices.py
index f148420..3439e86 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -783,6 +783,10 @@ class DiskDevice(StorageDevice):
         return getattr(self.partedDevice, "model", None)
 
     @property
+    def description(self):
+        return self.model
+
+    @property
     def size(self):
         """ The disk's size in MB """
         return super(DiskDevice, self).size
-- 
1.6.4

_______________________________________________
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