mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-16 18:25:02 -06:00
engine: Use poweroff confirm setting before saving a VM
This commit is contained in:
parent
f35b540986
commit
6b41d53c12
@ -708,13 +708,26 @@ class vmmEngine(gobject.GObject):
|
|||||||
|
|
||||||
def save_domain(self, src, uri, uuid):
|
def save_domain(self, src, uri, uuid):
|
||||||
conn = self._lookup_connection(uri)
|
conn = self._lookup_connection(uri)
|
||||||
|
vm = conn.get_vm(uuid)
|
||||||
|
do_prompt = self.config.get_confirm_poweroff()
|
||||||
|
|
||||||
if conn.is_remote():
|
if conn.is_remote():
|
||||||
# FIXME: This should work with remote storage stuff
|
# FIXME: This should work with remote storage stuff
|
||||||
self.err.val_err(_("Saving virtual machines over remote "
|
self.err.val_err(_("Saving virtual machines over remote "
|
||||||
"connections is not yet supported."))
|
"connections is not yet supported."))
|
||||||
return
|
return
|
||||||
|
|
||||||
vm = conn.get_vm(uuid)
|
if do_prompt:
|
||||||
|
res = self.err.warn_chkbox(
|
||||||
|
text1=_("Are you sure you want to save "
|
||||||
|
"'%s'?" % vm.get_name()),
|
||||||
|
chktext=_("Don't ask me again."),
|
||||||
|
buttons=gtk.BUTTONS_YES_NO)
|
||||||
|
|
||||||
|
response, skip_prompt = res
|
||||||
|
if not response:
|
||||||
|
return
|
||||||
|
self.config.set_confirm_poweroff(not skip_prompt)
|
||||||
|
|
||||||
path = util.browse_local(src.window.get_widget("vmm-details"),
|
path = util.browse_local(src.window.get_widget("vmm-details"),
|
||||||
_("Save Virtual Machine"),
|
_("Save Virtual Machine"),
|
||||||
|
@ -579,7 +579,7 @@ For all domains</property>
|
|||||||
<widget class="GtkLabel" id="label20">
|
<widget class="GtkLabel" id="label20">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Poweroff/_Reboot:</property>
|
<property name="label" translatable="yes">Poweroff/_Reboot/Save:</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="mnemonic_widget">prefs-confirm-poweroff</property>
|
<property name="mnemonic_widget">prefs-confirm-poweroff</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
Loading…
Reference in New Issue
Block a user