diff options
author | Xan Lopez <xan@src.gnome.org> | 2003-05-02 17:32:28 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2003-05-02 17:32:28 +0800 |
commit | b31b537149199df4562bc482dd7fff28f94c7494 (patch) | |
tree | 1773083fcc2849b8f7e6ee368bf319571f1760a9 /embed/mozilla | |
parent | 00a0ba94312aa3fc5cdb3f39a29c1bbbc4f02b99 (diff) | |
download | gsoc2013-epiphany-b31b537149199df4562bc482dd7fff28f94c7494.tar gsoc2013-epiphany-b31b537149199df4562bc482dd7fff28f94c7494.tar.gz gsoc2013-epiphany-b31b537149199df4562bc482dd7fff28f94c7494.tar.bz2 gsoc2013-epiphany-b31b537149199df4562bc482dd7fff28f94c7494.tar.lz gsoc2013-epiphany-b31b537149199df4562bc482dd7fff28f94c7494.tar.xz gsoc2013-epiphany-b31b537149199df4562bc482dd7fff28f94c7494.tar.zst gsoc2013-epiphany-b31b537149199df4562bc482dd7fff28f94c7494.zip |
Workaround to not act on every download, ongoing or finished, when we
Workaround to not act on every download, ongoing or finished,
when we click on Pause/Resume or Remove.
Minor UI changes to the download dialog,
including merging Pause
and Resume in one button, and removing
File: from the details view.
Diffstat (limited to 'embed/mozilla')
-rw-r--r-- | embed/mozilla/ProgressListener.cpp | 55 | ||||
-rw-r--r-- | embed/mozilla/ProgressListener.h | 5 |
2 files changed, 15 insertions, 45 deletions
diff --git a/embed/mozilla/ProgressListener.cpp b/embed/mozilla/ProgressListener.cpp index 643764982..b5ed9815c 100644 --- a/embed/mozilla/ProgressListener.cpp +++ b/embed/mozilla/ProgressListener.cpp @@ -22,7 +22,6 @@ #include "ProgressListener.h" -#include "eel-gconf-extensions.h" #include "ephy-file-helpers.h" #include "mozilla-embed-persist.h" @@ -35,11 +34,11 @@ #include "nsCOMPtr.h" static void -download_remove_cb (DownloaderView *dv, GProgressListener *Progress); +download_remove_cb (DownloaderView *dv, GProgressListener *Changed, GProgressListener *Progress); static void -download_resume_cb (DownloaderView *dv, GProgressListener *Progress); +download_resume_cb (DownloaderView *dv, GProgressListener *Changed, GProgressListener *Progress); static void -download_pause_cb (DownloaderView *dv, GProgressListener *Progress); +download_pause_cb (DownloaderView *dv, GProgressListener *Changed, GProgressListener *Progress); NS_IMPL_ISUPPORTS4 (GProgressListener, nsIDownload, nsIWebProgressListener, nsIProgressDialog, nsISupportsWeakReference) @@ -73,7 +72,6 @@ NS_METHOD GProgressListener::InitForPersist (nsIWebBrowserPersist *aPersist, PRInt64 aTimeDownloadStarted) { nsresult rv; - /* fill in download details */ mAction = aAction; mParent = aParent; @@ -94,35 +92,6 @@ NS_METHOD GProgressListener::InitForPersist (nsIWebBrowserPersist *aPersist, return rv; } -NS_METHOD GProgressListener::InitForDownload (nsIHelperAppLauncher *aLauncher, - nsISupports *aContext, - GContentHandler *aHandler, - DownloadAction aAction) -{ - nsresult rv; - - mNoDialog = 0; - - /* fill in download details */ - mAction = aAction; - mParent = do_QueryInterface (aContext); - mNoDialog = PR_TRUE; - mHandler = aHandler; - mLauncher = aLauncher; - rv = mLauncher->GetDownloadInfo (getter_AddRefs (mUri), - &mTimeDownloadStarted, - getter_AddRefs (mFile)); - - /* do remaining init */ - rv = PrivateInit (); - - /* pick up progress messages */ - mLauncher->SetWebProgressListener (this); - - /* done */ - return rv; -} - NS_METHOD GProgressListener::PrivateInit (void) { nsresult rv; @@ -673,19 +642,25 @@ nsresult GProgressListener::Abort (void) } static void -download_remove_cb (DownloaderView *dv, GProgressListener *Progress) +download_remove_cb (DownloaderView *dv, GProgressListener *Changed, GProgressListener *Progress) { - Progress->Abort(); + if (Changed == Progress){ + Progress->Abort(); + } } static void -download_resume_cb (DownloaderView *dv, GProgressListener *Progress) +download_resume_cb (DownloaderView *dv, GProgressListener *Changed, GProgressListener *Progress) { - Progress->Resume(); + if (Changed == Progress) { + Progress->Resume(); + } } static void -download_pause_cb (DownloaderView *dv, GProgressListener *Progress) +download_pause_cb (DownloaderView *dv, GProgressListener *Changed, GProgressListener *Progress) { - Progress->Pause(); + if (Changed == Progress) { + Progress->Pause(); + } } diff --git a/embed/mozilla/ProgressListener.h b/embed/mozilla/ProgressListener.h index 7d5ba62b0..19b3836c4 100644 --- a/embed/mozilla/ProgressListener.h +++ b/embed/mozilla/ProgressListener.h @@ -73,11 +73,6 @@ class GProgressListener : public nsIProgressDialog, EphyEmbedPersist *ephyPersist, PRBool noDialog, PRInt64 aTimeDownloadStarted = 0); - NS_METHOD InitForDownload (nsIHelperAppLauncher *aLauncher, - nsISupports *aContext, - GContentHandler *aHandler, - DownloadAction aDownload); - nsresult Pause (void); nsresult Resume (void); nsresult Abort (void); |