diff --git a/ui/details.ui b/ui/details.ui index a16b0edc..eff3417d 100644 --- a/ui/details.ui +++ b/ui/details.ui @@ -559,7 +559,7 @@ True False True - _Cancel + _Cancel Installation True gtk-cancel diff --git a/virtManager/create.py b/virtManager/create.py index f63676fc..48c238c6 100644 --- a/virtManager/create.py +++ b/virtManager/create.py @@ -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): diff --git a/virtManager/details.py b/virtManager/details.py index 29f388fe..a364e3c8 100644 --- a/virtManager/details.py +++ b/virtManager/details.py @@ -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()