create: customize: cancel now cancels the entire installation

Trying to fall back to the create wizard can give weird results, since
it's really hard to ensure the customized changes are preserved if
the user changes things in the 'new' wizard.
This commit is contained in:
Cole Robinson 2015-05-03 16:53:43 -04:00
parent c8a0b8310c
commit 68ce97d533
3 changed files with 26 additions and 7 deletions

View File

@ -559,7 +559,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="is_important">True</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="label" translatable="yes">_Cancel Installation</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-cancel</property>
<signal name="clicked" handler="on_details_cancel_customize_clicked" swapped="no"/>

View File

@ -1792,11 +1792,11 @@ class vmmCreate(vmmGObjectUI):
logging.debug("User finished customize dialog, starting install")
self.start_install(guest)
def details_closed(ignore):
logging.debug("User closed customize window, back to wizard")
def config_canceled(ignore):
logging.debug("User closed customize window, closing wizard")
cleanup_config_window()
self._undo_finish_cursor()
self.widget("summary-customize").set_active(False)
self.close()
cleanup_config_window()
self.config_window = vmmDetails(virtinst_guest, self.topwin)
@ -1806,7 +1806,7 @@ class vmmCreate(vmmGObjectUI):
start_install_wrapper,
guest))
self.config_window_signals.append(
self.config_window.connect("details-closed", details_closed))
self.config_window.connect("details-closed", config_canceled))
self.config_window.show()
def _install_finished_cb(self, error, details):

View File

@ -429,7 +429,7 @@ class vmmDetails(vmmGObjectUI):
self.builder.connect_signals({
"on_close_details_clicked": self.close,
"on_details_menu_close_activate": self.close,
"on_vmm_details_delete_event": self.close,
"on_vmm_details_delete_event": self._window_delete_event,
"on_vmm_details_configure_event": self.window_resized,
"on_details_menu_quit_activate": self.exit_app,
"on_hw_list_changed": self.hw_changed,
@ -444,7 +444,7 @@ class vmmDetails(vmmGObjectUI):
"on_control_fullscreen_toggled": self.control_fullscreen,
"on_details_customize_finish_clicked": self.customize_finish,
"on_details_cancel_customize_clicked": self.close,
"on_details_cancel_customize_clicked": self._customize_cancel_clicked,
"on_details_menu_virtual_manager_activate": self.control_vm_menu,
"on_details_menu_run_activate": self.control_vm_run,
@ -632,6 +632,25 @@ class vmmDetails(vmmGObjectUI):
return self._close(customize_finish=True)
def _customize_cancel(self):
logging.debug("Asking to cancel customization")
result = self.err.yes_no(
_("This will abort the installation. Are you sure?"))
if not result:
logging.debug("Customize cancel aborted")
return
logging.debug("Canceling customization")
return self._close()
def _customize_cancel_clicked(self, src):
ignore = src
return self._customize_cancel()
def _window_delete_event(self, ignore1=None, ignore2=None):
return self._close()
def close(self, ignore1=None, ignore2=None):
logging.debug("Closing VM details: %s", self.vm)
return self._close()