aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2003-05-02 17:32:28 +0800
committerXan Lopez <xan@src.gnome.org>2003-05-02 17:32:28 +0800
commitb31b537149199df4562bc482dd7fff28f94c7494 (patch)
tree1773083fcc2849b8f7e6ee368bf319571f1760a9 /embed/mozilla
parent00a0ba94312aa3fc5cdb3f39a29c1bbbc4f02b99 (diff)
downloadgsoc2013-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.cpp55
-rw-r--r--embed/mozilla/ProgressListener.h5
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);