From 6abf4f601e253b082e0704b98f2de2ed9d5a67ec Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 4 Nov 2009 15:41:18 -0500 Subject: [PATCH] details: disk: Slim down information output Also, use checkboxes for readonly + shareable in preparation for making them editable. --- src/virtManager/details.py | 35 +++-- src/vmm-details.glade | 253 +++++++++++++------------------------ 2 files changed, 109 insertions(+), 179 deletions(-) diff --git a/src/virtManager/details.py b/src/virtManager/details.py index f93be8358..61286db79 100644 --- a/src/virtManager/details.py +++ b/src/virtManager/details.py @@ -1275,23 +1275,32 @@ class vmmDetails(gobject.GObject): if not diskinfo: return - self.window.get_widget("disk-source-type").set_text(diskinfo[5]) - self.window.get_widget("disk-source-path").set_text(diskinfo[3] or "-") - self.window.get_widget("disk-target-type").set_text(diskinfo[4]) - self.window.get_widget("disk-target-device").set_text(diskinfo[2]) - if diskinfo[6] == True: - perms = "Readonly" + target = diskinfo[2] + path = diskinfo[3] + devtype = diskinfo[4] + ro = diskinfo[6] + share = diskinfo[7] + bus = diskinfo[8] + + if devtype == virtinst.VirtualDisk.DEVICE_FLOPPY: + pretty_name = "floppy" + elif bus: + pretty_name = "%s %s" % (bus, devtype) else: - perms = "Read/Write" - if diskinfo[7] == True: - perms += ", Shareable" - self.window.get_widget("disk-permissions").set_text(perms) + pretty_name = devtype + pretty_name += " %s" % target + + self.window.get_widget("disk-source-path").set_text(path or "-") + self.window.get_widget("disk-target-type").set_text(pretty_name) + + self.window.get_widget("disk-readonly").set_active(ro) + self.window.get_widget("disk-shareable").set_active(share) + bus = diskinfo[8] or _("Unknown") - self.window.get_widget("disk-bus").set_text(bus) button = self.window.get_widget("config-cdrom-connect") - if diskinfo[4] == "cdrom": - if not diskinfo[3]: + if devtype == "cdrom": + if not path: # source device not connected button.set_label(gtk.STOCK_CONNECT) else: diff --git a/src/vmm-details.glade b/src/vmm-details.glade index 4e5200f98..4ec7e3acc 100644 --- a/src/vmm-details.glade +++ b/src/vmm-details.glade @@ -2430,10 +2430,77 @@ I/O: True 3 - 6 + 4 3 8 4 + + + True + 1 + Readonly: + + + 2 + 3 + GTK_FILL + + + + + + True + 1 + Shareable: + + + 3 + 4 + GTK_FILL + + + + + True + True + False + True + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + True + False + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + True + 1 + Target device: + True + + + GTK_FILL + + + True @@ -2451,14 +2518,15 @@ I/O: - + True - 1 - Source type: - True - right + 0 + disk + True + 1 + 2 GTK_FILL @@ -2478,145 +2546,20 @@ I/O: - + True - 1 - Target type: - True - - - 2 - 3 - GTK_FILL - - - - - - True - 1 - Target device: - True - - - 3 - 4 - GTK_FILL - - - - - - True - 0 - label393 - True - - - 1 - 2 - 3 - 4 - GTK_FILL - - - - - - True - 0 - disk - True - - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - - True - 0 - Block - True - - - 1 - 2 - GTK_FILL - - - - - - True - 1 - Permissions: - - - 5 - 6 - GTK_FILL - - - - - - True - 0 - label423 - True - - - 1 - 2 - 5 - 6 - GTK_FILL - - - - - - True - 1 - Target bus: - - - 4 - 5 - GTK_FILL - - - - - - True - 0 - True - - - 1 - 2 - 4 - 5 - GTK_FILL - - - - - - gtk-connect - True - True - True - False - True - + 1 + + + gtk-connect + True + True + True + True + True + + + 2 @@ -2629,12 +2572,6 @@ I/O: - - - - - - @@ -3557,7 +3494,6 @@ I/O: True - 3 2 8 4 @@ -3585,21 +3521,6 @@ I/O: - - - - - - - - - - - - - - -