[virt-tools-list] [PATCH 3/3] Add operating system data from inspection to Details->Overview.

Richard W.M. Jones rjones at redhat.com
Tue Apr 19 11:08:07 UTC 2011


I forgot the all-important screenshot:

http://oirase.annexia.org/tmp/vmm-details.png

I had lots of problems editing the glade file.  Glade-3
(glade3-3.10.0-1.fc15.x86_64) won't touch it at all.  It gives this
error:

  (glade:15327): GladeUI-WARNING **: Couldnt recognize GtkBuilder xml,
  skipping /home/rjones/d/virt-manager/src/vmm-details.glade

glade-2 edits it OK but completely messes up the XML, and also makes
random changes to things like label justification.

Instead I edited the glade XML by hand, so at least we get a
reasonably clean patch and it shouldn't be breaking things.

I want to add an icon next to the table as well.  The icon would show
the detected operating system, using the other 5 fields that we're
currently getting from inspection but not yet using (ie. type/distro/
major_version/minor_version/product_variant).

If inspection completes while the details pane is being displayed, I
*don't* yet update the fields, although of course this would be
possible.

The main UI is not updated at all in this patch.  As you say I think
it's better to discuss with the usability people how (or if) to
display this information.  We have quite a lot more information
available now than is easy to display in that small icon.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
-------------- next part --------------
>From ae932a93386e18f6a3f8cd5ac3aefa89d828ccf8 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Tue, 19 Apr 2011 11:54:39 +0100
Subject: [PATCH 3/3] Add operating system data from inspection to
 Details->Overview.

---
 src/virtManager/details.py |    8 ++++
 src/vmm-details.glade      |   96 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 102 insertions(+), 2 deletions(-)

diff --git a/src/virtManager/details.py b/src/virtManager/details.py
index e56b6b5..580749f 100644
--- a/src/virtManager/details.py
+++ b/src/virtManager/details.py
@@ -2126,6 +2126,14 @@ class vmmDetails(vmmGObjectUI):
         self.window.get_widget("overview-arch").set_text(arch)
         self.window.get_widget("overview-emulator").set_text(emu)
 
+        # Operating System
+        s = self.vm.get_inspection_hostname()
+        if not s: s = _("unknown")
+        self.window.get_widget("label_inspection_hostname_value").set_text(s)
+        s = self.vm.get_inspection_product_name()
+        if not s: s = _("unknown")
+        self.window.get_widget("label_inspection_product_name_value").set_text(s)
+
         # Machine settings
         acpi = self.vm.get_acpi()
         apic = self.vm.get_apic()
diff --git a/src/vmm-details.glade b/src/vmm-details.glade
index fa3c80f..1670e34 100644
--- a/src/vmm-details.glade
+++ b/src/vmm-details.glade
@@ -1272,6 +1272,98 @@
                                   </packing>
                                 </child>
                                 <child>
+                                  <widget class="GtkFrame" id="frame_inspection">
+                                    <property name="visible">True</property>
+                                    <property name="border_width">3</property>
+                                    <property name="label_xalign">0</property>
+                                    <property name="shadow_type">none</property>
+                                    <child>
+                                      <widget class="GtkAlignment" id="alignment_inspection">
+                                        <property name="visible">True</property>
+                                        <property name="top_padding">3</property>
+                                        <property name="left_padding">12</property>
+                                        <child>
+                                          <widget class="GtkTable" id="table_inspection">
+                                            <property name="visible">True</property>
+                                            <property name="border_width">3</property>
+                                            <property name="n_rows">2</property>
+                                            <property name="n_columns">2</property>
+                                            <property name="column_spacing">6</property>
+                                            <property name="row_spacing">6</property>
+                                            <child>
+                                              <widget class="GtkLabel" id="label_inspection_hostname">
+                                                <property name="visible">True</property>
+                                                <property name="xalign">1</property>
+                                                <property name="label" translatable="yes">Hostname:</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="x_options">GTK_FILL</property>
+                                                <property name="y_options">GTK_FILL</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkLabel" id="label_inspection_product_name">
+                                                <property name="visible">True</property>
+                                                <property name="xalign">1</property>
+                                                <property name="label" translatable="yes">Product name:</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="top_attach">1</property>
+                                                <property name="bottom_attach">2</property>
+                                                <property name="x_options">GTK_FILL</property>
+                                                <property name="y_options">GTK_FILL</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkLabel" id="label_inspection_hostname_value">
+                                                <property name="visible">True</property>
+                                                <property name="xalign">0</property>
+                                                <property name="label">hostname</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">GTK_FILL</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkLabel" id="label_inspection_product_name_value">
+                                                <property name="visible">True</property>
+                                                <property name="xalign">0</property>
+                                                <property name="label">product name</property>
+                                                <property name="selectable">True</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="left_attach">1</property>
+                                                <property name="right_attach">2</property>
+                                                <property name="top_attach">1</property>
+                                                <property name="x_options">GTK_FILL</property>
+                                                <property name="y_options">GTK_FILL</property>
+                                              </packing>
+                                            </child>
+                                          </widget>
+                                        </child>
+                                      </widget>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label_inspection_os">
+                                        <property name="visible">True</property>
+                                        <property name="label" translatable="yes"><b>Operating System</b></property>
+                                        <property name="use_markup">True</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="type">label_item</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                                <child>
                                   <widget class="GtkExpander" id="expander2">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
@@ -1406,7 +1498,7 @@
                                   </widget>
                                   <packing>
                                     <property name="expand">False</property>
-                                    <property name="position">2</property>
+                                    <property name="position">3</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -1600,7 +1692,7 @@
                                     </child>
                                   </widget>
                                   <packing>
-                                    <property name="position">3</property>
+                                    <property name="position">4</property>
                                   </packing>
                                 </child>
                               </widget>
-- 
1.7.4.4



More information about the virt-tools-list mailing list