virt-manager

changeset 1963:ce7563f06a06

Only show appropriate security driver details
author Marc Deslauriers <marc.deslauriers@ubuntu.com>
date Mon Feb 28 21:22:48 2011 -0500 (2011-02-28)
parents b91f34bf37f2
children 80756615a211
files src/virtManager/details.py src/vmm-details.glade
line diff
     1.1 --- a/src/virtManager/details.py	Sun Feb 27 14:20:53 2011 -0500
     1.2 +++ b/src/virtManager/details.py	Mon Feb 28 21:22:48 2011 -0500
     1.3 @@ -1938,15 +1938,21 @@
     1.4  
     1.5          if caps.host.secmodel and caps.host.secmodel.model:
     1.6              semodel = caps.host.secmodel.model
     1.7 -        self.window.get_widget("security-type-box").set_sensitive(bool(semodel))
     1.8 +
     1.9          self.window.get_widget("security-model").set_text(semodel or _("None"))
    1.10  
    1.11 -        if self.vm.get_seclabel()[1] == "static":
    1.12 -            self.window.get_widget("security-static").set_active(True)
    1.13 +        if not semodel or semodel == "apparmor":
    1.14 +            self.window.get_widget("security-type-box").hide()
    1.15 +            self.window.get_widget("security-type-label").hide()
    1.16          else:
    1.17 -            self.window.get_widget("security-dynamic").set_active(True)
    1.18 -
    1.19 -        self.window.get_widget("security-label").set_text(vmlabel)
    1.20 +            self.window.get_widget("security-type-box").set_sensitive(bool(semodel))
    1.21 +
    1.22 +            if self.vm.get_seclabel()[1] == "static":
    1.23 +                self.window.get_widget("security-static").set_active(True)
    1.24 +            else:
    1.25 +                self.window.get_widget("security-dynamic").set_active(True)
    1.26 +
    1.27 +            self.window.get_widget("security-label").set_text(vmlabel)
    1.28  
    1.29      def refresh_stats_page(self):
    1.30          def _dsk_rx_tx_text(rx, tx, unit):
     2.1 --- a/src/vmm-details.glade	Sun Feb 27 14:20:53 2011 -0500
     2.2 +++ b/src/vmm-details.glade	Mon Feb 28 21:22:48 2011 -0500
     2.3 @@ -1559,7 +1559,7 @@
     2.4                                                </packing>
     2.5                                              </child>
     2.6                                              <child>
     2.7 -                                              <widget class="GtkLabel" id="label515">
     2.8 +                                              <widget class="GtkLabel" id="security-type-label">
     2.9                                                  <property name="visible">True</property>
    2.10                                                  <property name="xalign">1</property>
    2.11                                                  <property name="yalign">0</property>