asyncjob: Always hide the X button

This commit is contained in:
Cole Robinson 2016-01-11 14:48:49 -05:00
parent 467fea9df7
commit 400b668da3
2 changed files with 2 additions and 16 deletions

View File

@ -13,6 +13,7 @@
<property name="type_hint">dialog</property>
<property name="skip_taskbar_hint">True</property>
<property name="urgency_hint">True</property>
<property name="deletable">False</property>
<signal name="delete-event" handler="on_async_job_delete_event" swapped="no"/>
<child>
<object class="GtkBox" id="vbox13">

View File

@ -197,7 +197,6 @@ class vmmAsyncJob(vmmGObjectUI):
})
# UI state
self.topwin.set_deletable(bool(self.cancel_cb))
self.topwin.set_title(title)
self.widget("pbar-text").set_text(text)
self.widget("cancel-async-job").set_visible(bool(self.cancel_cb))
@ -230,21 +229,7 @@ class vmmAsyncJob(vmmGObjectUI):
################
def _on_window_delete(self, ignore1=None, ignore2=None):
if not self.cancel_cb or not self._bg_thread.is_alive():
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?"),
buttons=Gtk.ButtonsType.YES_NO)
if not res:
logging.debug("User closed progress window, but chose not "
"cancel operation, ignoring.")
return 1
self._on_cancel()
return 1
def _on_cancel(self, ignore1=None, ignore2=None):
if not self.cancel_cb or not self._bg_thread.is_alive():