create: Always display the storage path in the summary

This commit is contained in:
Cole Robinson
2015-09-14 15:15:40 -04:00
parent 01da21b93a
commit a4ddac4bb1
2 changed files with 55 additions and 28 deletions

View File

@@ -2152,22 +2152,6 @@ is not yet supported.&lt;/small&gt;</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="summary-storage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">label</property>
<property name="wrap">True</property>
<property name="ellipsize">end</property>
<property name="width_chars">31</property>
<property name="max_width_chars">31</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="summary-customize">
<property name="label" translatable="yes">C_ustomize configuration before install</property>
@@ -2309,6 +2293,51 @@ is not yet supported.&lt;/small&gt;</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkLabel" id="summary-storage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">label</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="summary-storage-path">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">label</property>
<property name="ellipsize">start</property>
<property name="width_chars">27</property>
<property name="max_width_chars">27</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
</packing>
</child>
</object>
</child>
</object>

View File

@@ -995,24 +995,20 @@ class vmmCreate(vmmGObjectUI):
install = _("Operating system container")
storagetmpl = "<span size='small' color='#484848'>%s</span>"
storagesize = ""
storagepath = ""
disks = self._guest.get_devices("disk")
if disks:
disk = disks[0]
storage = "%s" % _pretty_storage(disk.get_size())
# default storage is dependent on the VM name which the user
# can change on the last page, so this label can get out of date.
# We could dynamically update it if user changes things, but
# not sure if anyone cares.
if not self._is_default_storage():
storage += " " + (storagetmpl % disk.path)
storagesize = "%s" % _pretty_storage(disk.get_size())
storagepath += " " + (storagetmpl % disk.path)
elif len(self._guest.get_devices("filesystem")):
fs = self._guest.get_devices("filesystem")[0]
storage = storagetmpl % fs.source
storagepath = storagetmpl % fs.source
elif self._guest.os.is_container():
storage = _("Host filesystem")
storagepath = _("Host filesystem")
else:
storage = _("None")
storagepath = _("None")
osstr = ""
have_os = True
@@ -1032,7 +1028,9 @@ class vmmCreate(vmmGObjectUI):
self.widget("summary-install").set_text(install)
self.widget("summary-mem").set_text(mem)
self.widget("summary-cpu").set_text(cpu)
self.widget("summary-storage").set_markup(storage)
self.widget("summary-storage").set_markup(storagesize)
self.widget("summary-storage").set_visible(bool(storagesize))
self.widget("summary-storage-path").set_markup(storagepath)
self._netdev_changed(None)