mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
asyncjob: Only close window if operation completes.
This commit is contained in:
parent
cdde7e1d9f
commit
b5baebf24c
@ -232,13 +232,18 @@ class vmmAsyncJob(vmmGObjectUI):
|
||||
def _on_window_delete(self, ignore1=None, ignore2=None):
|
||||
thread_active = (self._bg_thread.isAlive() or not self.async)
|
||||
if not self.cancel_cb or not thread_active:
|
||||
return
|
||||
logging.debug("User closed progress window, but thread "
|
||||
"still running and process isn't cancellable, "
|
||||
"ignoring.")
|
||||
return 1
|
||||
|
||||
res = self.err.warn_chkbox(
|
||||
text1=_("Cancel the job before closing window?"),
|
||||
text1=_("Cancel the job?"),
|
||||
buttons=Gtk.ButtonsType.YES_NO)
|
||||
if not res:
|
||||
return
|
||||
logging.debug("User closed progress window, but chose not "
|
||||
"cancel operation, ignoring.")
|
||||
return 1
|
||||
|
||||
self._on_cancel()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user