* 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.
This commit is contained in:
Thomas Vander Stichele
2009-04-12 10:18:56 +00:00
parent 0ab4aed9a2
commit b7eb47325e
2 changed files with 11 additions and 1 deletions

View File

@@ -1,3 +1,10 @@
2009-04-12 Thomas Vander Stichele <thomas at apestaart dot org>
* 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 <thomas at apestaart dot org>
* examples/ARcue.py:

View File

@@ -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)