Skip to content

Commit

Permalink
Thread on_toolbutton_exec_clicked
Browse files Browse the repository at this point in the history
Decorate on_toolbutton_exec_clicked with a threaded function.
Add a "Please wait" dialog when pressing the Execute key.
  • Loading branch information
gapan committed Oct 17, 2012
1 parent 486a05c commit 0bb5257
Show file tree
Hide file tree
Showing 2 changed files with 2,888 additions and 2,485 deletions.
14 changes: 13 additions & 1 deletion src/sourcery
Expand Up @@ -385,8 +385,12 @@ class Sourcery:
else:
self.refresh_pkglist()
self.canceltask = False


@threaded
def on_toolbutton_exec_clicked(self, widget):
gtk.gdk.threads_enter()
self.dlg_wait.show()
gtk.gdk.threads_leave()
config = SourceryConfig()

if config.deps() == True:
Expand Down Expand Up @@ -416,7 +420,10 @@ class Sourcery:
elif i[2] == PkgAction.Remove:
desc = _('%(pkg)s %(pkgver)s is going to be removed') %{'pkg' : i[0], 'pkgver' : i[1]}
self.ls_summary.append([desc, i[0], i[1], i[2]])
gtk.gdk.threads_enter()
self.dlg_wait.hide()
self.dlg_summary.show()
gtk.gdk.threads_leave()

def on_toolbutton_clearsearch_clicked(self, widget):
if len(self.entry_search.get_text()) != 0:
Expand Down Expand Up @@ -1406,6 +1413,11 @@ class Sourcery:
self.btn_firstrun_cancel = builder.get_object('button_firstrun_cancel')
self.btn_firstrun_create = builder.get_object('button_firstrun_create')

#
# Please wait dialog
#
self.dlg_wait = builder.get_object('dialog_wait')

#
# About dialog
#
Expand Down

0 comments on commit 0bb5257

Please sign in to comment.