details: Enable setting boot menu flag

This commit is contained in:
Cole Robinson
2010-12-11 22:00:52 -05:00
parent 6908c2e727
commit 809cde787c
3 changed files with 129 additions and 95 deletions

View File

@@ -350,6 +350,7 @@ class vmmDetails(vmmGObjectUI):
"on_config_boot_movedown_clicked" : (self.config_boot_move,
False),
"on_config_autostart_changed": self.config_enable_apply,
"on_boot_menu_changed": self.config_enable_apply,
"on_disk_readonly_changed": self.config_enable_apply,
"on_disk_shareable_changed": self.config_enable_apply,
@@ -1540,8 +1541,11 @@ class vmmDetails(vmmGObjectUI):
return False
bootdevs = self.get_config_boot_devs()
return self._change_config_helper(self.vm.set_boot_device,
(bootdevs,))
bootmenu = self.window.get_widget("boot-menu").get_active()
return self._change_config_helper([self.vm.set_boot_device,
self.vm.set_boot_menu],
[(bootdevs,),
(bootmenu,)])
# CDROM
def change_storage_media(self, dev_id_info, newpath):
@@ -2209,13 +2213,13 @@ class vmmDetails(vmmGObjectUI):
except libvirt.libvirtError:
autoval = None
if autoval is not None:
self.window.get_widget("config-autostart").set_active(autoval)
self.window.get_widget("config-autostart").set_sensitive(True)
else:
# Autostart isn't supported
self.window.get_widget("config-autostart").set_active(False)
self.window.get_widget("config-autostart").set_sensitive(False)
autostart_chk = self.window.get_widget("config-autostart")
enable_autostart = (autoval is not None)
autostart_chk.set_sensitive(enable_autostart)
autostart_chk.set_active(enable_autostart and autoval or False)
menu = self.vm.get_boot_menu() or False
self.window.get_widget("boot-menu").set_active(menu)
# Refresh Boot Device list
self.repopulate_boot_list()

View File

@@ -343,6 +343,10 @@ class vmmDomainBase(vmmLibvirtObject):
def change(guest):
guest.installer.bootconfig.bootorder = boot_list
return self._redefine_guest(change)
def set_boot_menu(self, newval):
def change(guest):
guest.installer.bootconfig.enable_bootmenu = bool(newval)
return self._redefine_guest(change)
# virtinst.VirtualDevice XML persistent change Impls
def define_storage_media(self, devobj, newpath):
@@ -515,6 +519,9 @@ class vmmDomainBase(vmmLibvirtObject):
return devs
return util.xml_parse_wrapper(xml, get_boot_xml)
def get_boot_menu(self):
guest = self._get_guest()
return bool(guest.installer.bootconfig.enable_bootmenu)
def get_seclabel(self):
xml = self.get_xml()

View File

@@ -2530,108 +2530,131 @@ I/O:</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkAlignment" id="alignment1">
<widget class="GtkAlignment" id="bootalign">
<property name="visible">True</property>
<property name="top_padding">3</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkHBox" id="hbox10">
<widget class="GtkVBox" id="bootvbox">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<widget class="GtkTable" id="table2">
<widget class="GtkCheckButton" id="boot-menu">
<property name="label" translatable="yes">Enable boot me_nu</property>
<property name="visible">True</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>
<widget class="GtkScrolledWindow" id="scrolledwindow3">
<property name="width_request">20</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<widget class="GtkTreeView" id="config-boot-list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
</widget>
</child>
</widget>
<packing>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="config-boot-moveup">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_config_boot_moveup_clicked"/>
<child>
<widget class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="stock">gtk-go-up</property>
</widget>
</child>
</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="GtkButton" id="config-boot-movedown">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_config_boot_movedown_clicked"/>
<child>
<widget class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="stock">gtk-go-down</property>
</widget>
</child>
</widget>
<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="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment21">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</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>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_boot_menu_changed"/>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment20">
<widget class="GtkHBox" id="boothbox">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<placeholder/>
<widget class="GtkTable" id="table2">
<property name="visible">True</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>
<widget class="GtkScrolledWindow" id="scrolledwindow3">
<property name="width_request">20</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<widget class="GtkTreeView" id="config-boot-list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
</widget>
</child>
</widget>
<packing>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="config-boot-moveup">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_config_boot_moveup_clicked"/>
<child>
<widget class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="stock">gtk-go-up</property>
</widget>
</child>
</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="GtkButton" id="config-boot-movedown">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_config_boot_movedown_clicked"/>
<child>
<widget class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="stock">gtk-go-down</property>
</widget>
</child>
</widget>
<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="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment21">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</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>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>