summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2013-06-14 11:19:22 -0400
committerCole Robinson <crobinso@redhat.com>2013-06-14 11:19:22 -0400
commitb5baebf24ccaed53edc7c44ff2b1af5f4a286082 (patch)
treeeefcb2256bb67f796ef820569e55f00bdf85fe90
parentcdde7e1d9fe62288dafe835554cb22efc29f6851 (diff)
downloadvirt-manager-b5baebf24ccaed53edc7c44ff2b1af5f4a286082.tar.gz
asyncjob: Only close window if operation completes.
-rw-r--r--virtManager/asyncjob.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/virtManager/asyncjob.py b/virtManager/asyncjob.py
index 8cca0b7b..f83ec39c 100644
--- a/virtManager/asyncjob.py
+++ b/virtManager/asyncjob.py
@@ -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()