inspection: show OS type in Inspection page

Show also a pretty label for the OS of the guest, in addition to
hostname and product name.
This commit is contained in:
Pino Toscano 2017-02-08 16:55:34 +01:00 committed by Cole Robinson
parent f7a726dc70
commit ebf4ade208
2 changed files with 65 additions and 18 deletions

View File

@ -1468,22 +1468,10 @@ if you know what you are doing.&lt;/small&gt;</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">3</property>
<property name="n_rows">2</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkLabel" id="label71">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Hostname:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label72">
<property name="visible">True</property>
@ -1492,8 +1480,8 @@ if you know what you are doing.&lt;/small&gt;</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_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">GTK_FILL</property>
</packing>
@ -1513,6 +1501,30 @@ if you know what you are doing.&lt;/small&gt;</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label71">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Hostname:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Operating system:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="inspection-product-name">
<property name="visible">True</property>
@ -1524,12 +1536,26 @@ if you know what you are doing.&lt;/small&gt;</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_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">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="inspection-type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">foo</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
</object>
</child>
</object>
@ -5906,8 +5932,8 @@ if you know what you are doing.&lt;/small&gt;</property>
<property name="label" translatable="yes">_Save this password in your keyring</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Check to save password, uncheck to forget password.</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Check to save password, uncheck to forget password.</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>

View File

@ -310,6 +310,23 @@ def _warn_cpu_thread_topo(threads, cpu_model):
return False
def _label_for_os_type(os_type):
typemap = {
"dos": _("MS-DOS/FreeDOS"),
"freebsd": _("FreeBSD"),
"hurd": _("GNU/Hurd"),
"linux": _("Linux"),
"minix": _("MINIX"),
"netbsd": _("NetBSD"),
"openbsd": _("OpenBSD"),
"windows": _("Microsoft Windows"),
}
try:
return typemap[os_type]
except KeyError:
return _("unknown")
class vmmDetails(vmmGObjectUI):
__gsignals__ = {
"action-save-domain": (GObject.SignalFlags.RUN_FIRST, None, [str, str]),
@ -2379,6 +2396,10 @@ class vmmDetails(vmmGObjectUI):
if not hostname:
hostname = _("unknown")
self.widget("inspection-hostname").set_text(hostname)
os_type = self.vm.inspection.os_type
if not os_type:
os_type = "unknown"
self.widget("inspection-type").set_text(_label_for_os_type(os_type))
product_name = self.vm.inspection.product_name
if not product_name:
product_name = _("unknown")