Commit: New Dialog_Download_File

From: Gabriel Gerhardsson (mr.g@home.se)
Date: Tue Jul 16 2002 - 15:08:25 EDT

  • Next message: F J Franklin: "commit: abi: (Commit: New Dialog_Download_File)"

    Here it goes, my first commit :)

    A new dialog (Download_File) that downloads a file (through libcurl)
    while offering a small dialog to the user. The dialog contains status
    information and a cancel-button.

    It's implemented with threads. That may sound bad at first, but it's
    done in a very safe way.
    When a download is started, a new thread is created wherein Curl is run.
    In the meantime the main thread lets the GUI get cpu-time to be able to
    respond on user actions. A timer is going in the main thread, that
    checks (10 times per second) if the download is complete (=> remove
    dialog and clean up). The timer also updates the graphical
    progress-meeter.
    The only interaction-points between the main thread and the
    download-thread is a struct with a few variables and flags (to
    communicate about status of download, if the user has canceled and such)
    and a pipe (to deliver the file-data to the main thread).

    Stubs is implemented for all platforms. And the download-functionality
    works on all platforms that it worked on before. But the graphical
    dialog is only implemented on Unix, GTK.
    To get the threaded download and a dialog on your platform you need to:
    * Implement the dialog (duuh :). And don't forget _abortDialog().
    * Implement a thread implementation (ut_threadImpl.h). Right now only
    Unix has such a thing.

    This commit also renames the ABI_OPT_CURLHASH option to ABI_OPT_CURL and
    makes it more of a general option to enable features that require
    libcurl. Both the hashDownloader (which now use Download_File) and the
    new Download_File dialog is under this option. And the threaded
    downloading (and therefore also the graphical dialog) is activated by
    the new option ABI_OPT_THREADS - without it the old dialog-less
    downloading is used.

    fjf is kindly working on support for the auto* build.

    Known problems:
    On Unix GTK, if you cancel the download the progressbar (on the
    statusbar) can sometimes be left in the current state. It should be
    blanked out and put in the state it was before the download started.
    I'll try to fix that later on, I just wanted to get this commited first.

    Take care
    /Gabriel

    CVS:
    ----------------------------------------------------------------------
    CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
    CVS:
    CVS: Committing in .
    CVS:
    CVS: Modified Files:
    CVS: src/af/util/Makefile src/af/util/xp/Makefile
    CVS: src/af/util/xp/ut_thread.cpp src/af/util/xp/ut_thread.h
    CVS: src/af/xap/Makefile src/af/xap/xp/Makefile
    CVS: src/af/xap/xp/xap_App.cpp src/af/xap/xp/xap_App.h
    CVS: src/af/xap/xp/xap_HashDownloader.cpp
    CVS: src/af/xap/xp/xap_HashDownloader.h
    CVS: src/af/xap/xp/xap_String_Id.h src/config/abi_defs.mk
    CVS: src/other/spell/xp/ispell_checker.cpp src/wp/ap/Makefile
    CVS: src/wp/ap/beos/Makefile src/wp/ap/beos/ap_BeOSDialog_All.h
    CVS: src/wp/ap/cocoa/ap_CocoaDialog_All.h src/wp/ap/mac/Makefile
    CVS: src/wp/ap/mac/ap_MacDlg_All.h src/wp/ap/qnx/Makefile
    CVS: src/wp/ap/qnx/ap_QNXApp.cpp src/wp/ap/qnx/ap_QNXDialog_All.h
    CVS: src/wp/ap/unix/Makefile src/wp/ap/unix/ap_UnixApp.cpp
    CVS: src/wp/ap/unix/ap_UnixDialog_All.h src/wp/ap/win/Makefile
    CVS: src/wp/ap/win/ap_Win32App.cpp
    CVS: src/wp/ap/win/ap_Win32Dialog_All.h src/wp/ap/xp/Makefile
    CVS: src/wp/ap/xp/ap_Dialog_Id.h src/wp/ap/xp/ap_HashDownloader.cpp
    CVS: src/wp/ap/xp/ap_HashDownloader.h
    CVS: Added Files:
    CVS: src/wp/ap/beos/ap_BeOSDialog_Download_File.cpp
    CVS: src/wp/ap/beos/ap_BeOSDialog_Download_File.h
    CVS: src/wp/ap/cocoa/ap_CocoaDialog_Download_File.h
    CVS: src/wp/ap/cocoa/ap_CocoaDialog_Download_File.mm
    CVS: src/wp/ap/mac/ap_MacDialog_Download_File.cpp
    CVS: src/wp/ap/mac/ap_MacDialog_Download_File.h
    CVS: src/wp/ap/qnx/ap_QNXDialog_Download_File.cpp
    CVS: src/wp/ap/qnx/ap_QNXDialog_Download_File.h
    CVS: src/wp/ap/unix/ap_UnixDialog_Download_File.cpp
    CVS: src/wp/ap/unix/ap_UnixDialog_Download_File.h
    CVS: src/wp/ap/win/ap_Win32Dialog_Download_File.cpp
    CVS: src/wp/ap/win/ap_Win32Dialog_Download_File.h
    CVS: src/wp/ap/xp/ap_Dialog_Download_File.cpp
    CVS: src/wp/ap/xp/ap_Dialog_Download_File.h
    CVS:
    ----------------------------------------------------------------------



    This archive was generated by hypermail 2.1.4 : Tue Jul 16 2002 - 15:19:15 EDT