[Installit-dev] Download wizard problems

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Fri Mar 17 22:57:13 CET 2006

Jannis Pohlmann wrote:
> Hey Benny,
> I tried to improve the responsiveness of the download wizard today.
> During this, I noticed something very annoying: It is impossible to
> cancel downloads. This hasn't been introduced with any version, it's
> always been there!
> The 'urllib' module allows for hooking into the download process.
> However, it's a non-async transfer which makes it hard to avoid a
> blocked user interface. 
> Do you have any ideas on how this could be solved perhaps? I don't know
> much about threaded programming, subprocesses and glib/gobject/gtk main
> loops, but perhaps you do.

You could simply run the download in a separate thread and "send"
updates about the progress via GLib idle sources to the GUI. The
cancellation check could be done through a volatile variable (i.e. check
the cancel variable every now and then in the download threads, via
urllib hooks or whatever... setting it from the main thread when the
user hits Cancel). This is the way asynchronous jobs are done in Thunar.

> Thanks in advance,
> Jannis


More information about the Installit-dev mailing list