From 979cea3946ec0de0b2f33adfceef8057287c23b3 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Aug 06 2009 18:37:46 +0000 Subject: Add a description to DiskDevice, and use it in the UI. 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. --- 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