details: disk: Slim down information output

Also, use checkboxes for readonly + shareable in preparation for making them
editable.
This commit is contained in:
Cole Robinson 2009-11-04 15:41:18 -05:00
parent d602b5f38b
commit 6abf4f601e
2 changed files with 109 additions and 179 deletions

View File

@ -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:

View File

@ -2430,10 +2430,77 @@ I/O:</property>
<widget class="GtkTable" id="table32">
<property name="visible">True</property>
<property name="border_width">3</property>
<property name="n_rows">6</property>
<property name="n_rows">4</property>
<property name="n_columns">3</property>
<property name="column_spacing">8</property>
<property name="row_spacing">4</property>
<child>
<widget class="GtkLabel" id="permissions-label">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Readonly:</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Shareable:</property>
</widget>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="disk-readonly">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="disk-shareable">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label375">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Target device:</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="disk-source-path">
<property name="visible">True</property>
@ -2451,14 +2518,15 @@ I/O:</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label373">
<widget class="GtkLabel" id="disk-target-type">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Source type:</property>
<property name="use_underline">True</property>
<property name="justify">right</property>
<property name="xalign">0</property>
<property name="label">disk </property>
<property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
@ -2478,145 +2546,20 @@ I/O:</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label375">
<widget class="GtkAlignment" id="alignment15">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Target type:</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label374">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Target device:</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="disk-target-device">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label">label393</property>
<property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="disk-target-type">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label">disk </property>
<property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="disk-source-type">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Block</property>
<property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="permissions-label">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Permissions:</property>
</widget>
<packing>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="disk-permissions">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label">label423</property>
<property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label507">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Target bus:</property>
</widget>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="disk-bus">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="config-cdrom-connect">
<property name="label">gtk-connect</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_config_cdrom_connect_clicked"/>
<property name="bottom_padding">1</property>
<child>
<widget class="GtkButton" id="config-cdrom-connect">
<property name="label">gtk-connect</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_config_cdrom_connect_clicked"/>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
@ -2629,12 +2572,6 @@ I/O:</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>
@ -3557,7 +3494,6 @@ I/O:</property>
<child>
<widget class="GtkTable" id="table50">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">8</property>
<property name="row_spacing">4</property>
@ -3585,21 +3521,6 @@ I/O:</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>