From 979cea3946ec0de0b2f33adfceef8057287c23b3 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 6 Aug 2009 10:42:55 -0400 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. --- 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 9c04e52b2..2695b9499 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 f73903ee2..f5650e9c7 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 f14842075..3439e8663 100644 --- a/storage/devices.py +++ b/storage/devices.py @@ -782,6 +782,10 @@ class DiskDevice(StorageDevice): def model(self): return getattr(self.partedDevice, "model", None) + @property + def description(self): + return self.model + @property def size(self): """ The disk's size in MB """ -- cgit