From b7eb47325e321fceb684fc069f8d0379240f09ec Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 12 Apr 2009 10:18:56 +0000 Subject: [PATCH] * morituri/common/task.py: Schedule the start from the main loop, otherwise the task might complete before we're in the main loop, and then the loop.quit() doesn't work. --- ChangeLog | 7 +++++++ morituri/common/task.py | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 27506d1..dce906b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-12 Thomas Vander Stichele + + * morituri/common/task.py: + Schedule the start from the main loop, otherwise the + task might complete before we're in the main loop, + and then the loop.quit() doesn't work. + 2009-04-12 Thomas Vander Stichele * examples/ARcue.py: diff --git a/morituri/common/task.py b/morituri/common/task.py index 275b36f..2bcb38c 100644 --- a/morituri/common/task.py +++ b/morituri/common/task.py @@ -169,7 +169,9 @@ class SyncRunner(TaskRunner): self._loop = gobject.MainLoop() self._task.addListener(self) - self._task.start(self) + # only start the task after going into the mainloop, + # otherwise the task might complete before we are in it + gobject.timeout_add(0L, self._task.start, self) self._loop.run() def schedule(self, delta, callable, *args, **kwargs): @@ -242,6 +244,7 @@ class GtkProgressRunner(gtk.VBox, TaskRunner): # self._task.removeListener(self) def progressed(self, task, value): + self._label.set_text(task.description) self._progress.set_fraction(value)