Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/cd39367ef41bed86c07b4e57f327baa3f5720fb6
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/cd39367ef41bed86c07b4e57f327baa3f5720fb6
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/cd39367ef41bed86c07b4e57f327baa3f5720fb6

The branch, master has been updated
       via  cd39367ef41bed86c07b4e57f327baa3f5720fb6 (commit)
       via  ee88653dc0a7ee3077cedefedf51ca196f4ad006 (commit)
      from  3c94073590196710ccbe59e9e43f7e3e5241bde0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=cd39367ef41bed86c07b4e57f327baa3f5720fb6
commit cd39367ef41bed86c07b4e57f327baa3f5720fb6
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Try to avoid extraneous progress notifications

diff --git a/frontends/amiga/download.c b/frontends/amiga/download.c
index 3f3d96a..49e756b 100644
--- a/frontends/amiga/download.c
+++ b/frontends/amiga/download.c
@@ -83,6 +83,7 @@ struct gui_download_window {
        BPTR fh;
        uint32 size;
        uint32 downloaded;
+       uint32 progress;
        struct dlnode *dln;
        struct browser_window *bw;
        struct download_context *ctx;
@@ -166,7 +167,7 @@ static struct gui_download_window 
*gui_download_window_create(download_context *
        }
 
        if((nsoption_bool(download_notify_progress) == true)) {
-               Notify(ami_gui_get_app_id(), APPNOTIFY_Title, 
messages_get("NetSurf"),
+               Notify(ami_gui_get_app_id(), APPNOTIFY_Title, 
messages_get("amiDownloading"),
                                APPNOTIFY_PubScreenName, "FRONT",
                                APPNOTIFY_Text, dw->fname,
                                APPNOTIFY_DisplayTime, TRUE,     
@@ -238,9 +239,11 @@ static nserror gui_download_window_data(struct 
gui_download_window *dw,
        va[2] = 0;
 
        if(dw->size) {
-               if((nsoption_bool(download_notify_progress) == true)) {
+               if((nsoption_bool(download_notify_progress) == true) &&
+                       (((dw->downloaded * 100) / dw->size) > dw->progress)) {
+                       dw->progress = (uint32)((dw->downloaded * 100) / 
dw->size);
                        Notify(ami_gui_get_app_id(),
-                                       APPNOTIFY_Percentage, (dw->downloaded * 
100) / dw->size,
+                                       APPNOTIFY_Percentage, dw->progress,
                                        TAG_DONE);
                } else {
                        RefreshSetGadgetAttrs((struct Gadget 
*)dw->objects[GID_STATUS], dw->win, NULL,
@@ -255,7 +258,7 @@ static nserror gui_download_window_data(struct 
gui_download_window *dw,
                if((nsoption_bool(download_notify_progress) == true)) {
                        /* unknown size, not entirely sure how to deal with 
this atm... */
                        Notify(ami_gui_get_app_id(),
-                                       APPNOTIFY_Percentage, 0,
+                                       APPNOTIFY_Percentage, 100,
                                        TAG_DONE);
                } else {
                        RefreshSetGadgetAttrs((struct Gadget 
*)dw->objects[GID_STATUS], dw->win, NULL,


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=ee88653dc0a7ee3077cedefedf51ca196f4ad006
commit ee88653dc0a7ee3077cedefedf51ca196f4ad006
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Enable displaying download progress within a notification.
    Requires Enhancer Pack (Ringhio 53.65+)
    Defaults to 0 (off) as there is currently no check to see if this version 
is installed.
    This is currently potentially dangerous to toggle whilst a download is in 
progress, so cannot be changed through the GUI.

diff --git a/frontends/amiga/dist/NetSurf.guide 
b/frontends/amiga/dist/NetSurf.guide
index 512a264..d628a1c 100755
--- a/frontends/amiga/dist/NetSurf.guide
+++ b/frontends/amiga/dist/NetSurf.guide
@@ -146,6 +146,7 @@ There are a couple of Amiga-specific options which can only 
be changed directly
 @{b}mask_alpha@{ub} Threshold to use when determining which alpha values to 
convert to full transparency (0 - 255, where 255 will convert even opaque 
pixels to transparent).  Defaults to 0.  This is only used in palette-mapped 
modes where alpha blending is not currently supported.
 @{b}tab_new_session{ub} If NetSurf is already running, this will cause any 
passed URLs to open in a new tab rather than a new window.
 @{b}use_extmem@{ub} Defaults to 1 (enabled).  Setting to 0 will prevent 
NetSurf using Extended Memory to store uncompressed images - this may have a 
performance benefit and no disadvantage for <2GB configurations.  OS4.1FEU1 
only.
+@{b}download_notify_progress@{ub} Defaults to 0 (disabled).  Display download 
progress in a Ringhio notification.  Requires Enhancer Pack (Ringhio 53.65+), 
behaviour without it is undefined.
 @{b}url_file@{ub} Path to URL database file
 @{b}hotlist_file@{ub} Path to Hotlist file
 @{b}arexx_dir@{ub} Path to ARexx scripts dir
diff --git a/frontends/amiga/download.c b/frontends/amiga/download.c
index 18d3a59..3f3d96a 100644
--- a/frontends/amiga/download.c
+++ b/frontends/amiga/download.c
@@ -68,6 +68,14 @@
 #include "amiga/theme.h"
 #include "amiga/utf8.h"
 
+#ifndef APPNOTIFY_DisplayTime
+#define APPNOTIFY_DisplayTime   ( TAG_USER + 13 )
+#endif
+
+#ifndef APPNOTIFY_Percentage
+#define APPNOTIFY_Percentage    ( TAG_USER + 14 )
+#endif
+
 struct gui_download_window {
        struct ami_generic_window w;
        struct Window *win;
@@ -157,7 +165,15 @@ static struct gui_download_window 
*gui_download_window_create(download_context *
                return NULL;
        }
 
-       dw->objects[OID_MAIN] = WindowObj,
+       if((nsoption_bool(download_notify_progress) == true)) {
+               Notify(ami_gui_get_app_id(), APPNOTIFY_Title, 
messages_get("NetSurf"),
+                               APPNOTIFY_PubScreenName, "FRONT",
+                               APPNOTIFY_Text, dw->fname,
+                               APPNOTIFY_DisplayTime, TRUE,     
+                               APPNOTIFY_Percentage, 0,
+                               TAG_DONE);
+       } else {
+               dw->objects[OID_MAIN] = WindowObj,
            WA_ScreenTitle, ami_gui_get_screen_title(),
                WA_Title, dw->url,
                WA_Activate, TRUE,
@@ -195,7 +211,9 @@ static struct gui_download_window 
*gui_download_window_create(download_context *
                        EndGroup,
                EndWindow;
 
-       dw->win = (struct Window *)RA_OpenWindow(dw->objects[OID_MAIN]);
+               dw->win = (struct Window *)RA_OpenWindow(dw->objects[OID_MAIN]);
+       }
+
        dw->ctx = ctx;
 
        ami_gui_win_list_add(dw, AMINS_DLWINDOW, &ami_download_table);
@@ -219,21 +237,33 @@ static nserror gui_download_window_data(struct 
gui_download_window *dw,
        va[1] = (APTR)dw->size;
        va[2] = 0;
 
-       if(dw->size)
-       {
-               RefreshSetGadgetAttrs((struct Gadget *)dw->objects[GID_STATUS], 
dw->win, NULL,
+       if(dw->size) {
+               if((nsoption_bool(download_notify_progress) == true)) {
+                       Notify(ami_gui_get_app_id(),
+                                       APPNOTIFY_Percentage, (dw->downloaded * 
100) / dw->size,
+                                       TAG_DONE);
+               } else {
+                       RefreshSetGadgetAttrs((struct Gadget 
*)dw->objects[GID_STATUS], dw->win, NULL,
                                                FUELGAUGE_Level,   
dw->downloaded,
                                                GA_Text,           
messages_get("amiDownload"),
                                                FUELGAUGE_VarArgs, va,
                                                TAG_DONE);
+               }
        }
        else
        {
-               RefreshSetGadgetAttrs((struct Gadget *)dw->objects[GID_STATUS], 
dw->win, NULL,
+               if((nsoption_bool(download_notify_progress) == true)) {
+                       /* unknown size, not entirely sure how to deal with 
this atm... */
+                       Notify(ami_gui_get_app_id(),
+                                       APPNOTIFY_Percentage, 0,
+                                       TAG_DONE);
+               } else {
+                       RefreshSetGadgetAttrs((struct Gadget 
*)dw->objects[GID_STATUS], dw->win, NULL,
                                                FUELGAUGE_Level,   
dw->downloaded,
                                                GA_Text,           
messages_get("amiDownloadU"),
                                                FUELGAUGE_VarArgs, va,
                                                TAG_DONE);
+               }
        }
 
        return NSERROR_OK;
@@ -248,6 +278,12 @@ static void gui_download_window_done(struct 
gui_download_window *dw)
        if(!dw) return;
        bw = dw->bw;
 
+       if((nsoption_bool(download_notify_progress) == true)) {
+               Notify(ami_gui_get_app_id(),
+                               APPNOTIFY_Update, TRUE,
+                               TAG_DONE);
+       }
+
        if((nsoption_bool(download_notify)) && (dw->result == AMINS_DLOAD_OK))
        {
                Notify(ami_gui_get_app_id(), APPNOTIFY_Title, 
messages_get("amiDownloadComplete"),
@@ -275,7 +311,10 @@ static void gui_download_window_done(struct 
gui_download_window *dw)
 
        downloads_in_progress--;
 
-       DisposeObject(dw->objects[OID_MAIN]);
+       if(dw->objects[OID_MAIN] != NULL) {
+               DisposeObject(dw->objects[OID_MAIN]);
+       }
+
        ami_gui_win_list_remove(dw);
        if(queuedl) {
                nsurl *url;
diff --git a/frontends/amiga/options.h b/frontends/amiga/options.h
index a2cc92e..a23435c 100644
--- a/frontends/amiga/options.h
+++ b/frontends/amiga/options.h
@@ -49,6 +49,7 @@ NSOPTION_STRING(arexx_startup, "Startup.nsrx")
 NSOPTION_STRING(arexx_shutdown, "Shutdown.nsrx")
 NSOPTION_STRING(download_dir, NULL)
 NSOPTION_BOOL(download_notify, true)
+NSOPTION_BOOL(download_notify_progress, false)
 NSOPTION_BOOL(faster_scroll, true)
 NSOPTION_BOOL(scale_quality, false)
 NSOPTION_INTEGER(dither_quality, 0)
diff --git a/resources/FatMessages b/resources/FatMessages
index ead95fc..8f3c64a 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -1564,6 +1564,11 @@ nl.all.Abort:Breek af
 # This section contains tokens which are used in the Amiga
 # download window.
 #
+en.ami.amiDownloading:NetSurf: Downloading...
+de.ami.amiDownloading:NetSurf: Downloading...
+fr.ami.amiDownloading:NetSurf: Downloading...
+it.ami.amiDownloading:NetSurf: Downloading...
+nl.ami.amiDownloading:NetSurf: Downloading...
 en.ami.amiDownload:%ld of %ld bytes downloaded
 de.ami.amiDownload:%ld von %ld Bytes heruntergeladen
 fr.ami.amiDownload:%ld of %ld bytes downloaded


-----------------------------------------------------------------------

Summary of changes:
 frontends/amiga/dist/NetSurf.guide |    1 +
 frontends/amiga/download.c         |   56 +++++++++++++++++++++++++++++++-----
 frontends/amiga/options.h          |    1 +
 resources/FatMessages              |    5 ++++
 4 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/frontends/amiga/dist/NetSurf.guide 
b/frontends/amiga/dist/NetSurf.guide
index 512a264..d628a1c 100755
--- a/frontends/amiga/dist/NetSurf.guide
+++ b/frontends/amiga/dist/NetSurf.guide
@@ -146,6 +146,7 @@ There are a couple of Amiga-specific options which can only 
be changed directly
 @{b}mask_alpha@{ub} Threshold to use when determining which alpha values to 
convert to full transparency (0 - 255, where 255 will convert even opaque 
pixels to transparent).  Defaults to 0.  This is only used in palette-mapped 
modes where alpha blending is not currently supported.
 @{b}tab_new_session{ub} If NetSurf is already running, this will cause any 
passed URLs to open in a new tab rather than a new window.
 @{b}use_extmem@{ub} Defaults to 1 (enabled).  Setting to 0 will prevent 
NetSurf using Extended Memory to store uncompressed images - this may have a 
performance benefit and no disadvantage for <2GB configurations.  OS4.1FEU1 
only.
+@{b}download_notify_progress@{ub} Defaults to 0 (disabled).  Display download 
progress in a Ringhio notification.  Requires Enhancer Pack (Ringhio 53.65+), 
behaviour without it is undefined.
 @{b}url_file@{ub} Path to URL database file
 @{b}hotlist_file@{ub} Path to Hotlist file
 @{b}arexx_dir@{ub} Path to ARexx scripts dir
diff --git a/frontends/amiga/download.c b/frontends/amiga/download.c
index 18d3a59..49e756b 100644
--- a/frontends/amiga/download.c
+++ b/frontends/amiga/download.c
@@ -68,6 +68,14 @@
 #include "amiga/theme.h"
 #include "amiga/utf8.h"
 
+#ifndef APPNOTIFY_DisplayTime
+#define APPNOTIFY_DisplayTime   ( TAG_USER + 13 )
+#endif
+
+#ifndef APPNOTIFY_Percentage
+#define APPNOTIFY_Percentage    ( TAG_USER + 14 )
+#endif
+
 struct gui_download_window {
        struct ami_generic_window w;
        struct Window *win;
@@ -75,6 +83,7 @@ struct gui_download_window {
        BPTR fh;
        uint32 size;
        uint32 downloaded;
+       uint32 progress;
        struct dlnode *dln;
        struct browser_window *bw;
        struct download_context *ctx;
@@ -157,7 +166,15 @@ static struct gui_download_window 
*gui_download_window_create(download_context *
                return NULL;
        }
 
-       dw->objects[OID_MAIN] = WindowObj,
+       if((nsoption_bool(download_notify_progress) == true)) {
+               Notify(ami_gui_get_app_id(), APPNOTIFY_Title, 
messages_get("amiDownloading"),
+                               APPNOTIFY_PubScreenName, "FRONT",
+                               APPNOTIFY_Text, dw->fname,
+                               APPNOTIFY_DisplayTime, TRUE,     
+                               APPNOTIFY_Percentage, 0,
+                               TAG_DONE);
+       } else {
+               dw->objects[OID_MAIN] = WindowObj,
            WA_ScreenTitle, ami_gui_get_screen_title(),
                WA_Title, dw->url,
                WA_Activate, TRUE,
@@ -195,7 +212,9 @@ static struct gui_download_window 
*gui_download_window_create(download_context *
                        EndGroup,
                EndWindow;
 
-       dw->win = (struct Window *)RA_OpenWindow(dw->objects[OID_MAIN]);
+               dw->win = (struct Window *)RA_OpenWindow(dw->objects[OID_MAIN]);
+       }
+
        dw->ctx = ctx;
 
        ami_gui_win_list_add(dw, AMINS_DLWINDOW, &ami_download_table);
@@ -219,21 +238,35 @@ static nserror gui_download_window_data(struct 
gui_download_window *dw,
        va[1] = (APTR)dw->size;
        va[2] = 0;
 
-       if(dw->size)
-       {
-               RefreshSetGadgetAttrs((struct Gadget *)dw->objects[GID_STATUS], 
dw->win, NULL,
+       if(dw->size) {
+               if((nsoption_bool(download_notify_progress) == true) &&
+                       (((dw->downloaded * 100) / dw->size) > dw->progress)) {
+                       dw->progress = (uint32)((dw->downloaded * 100) / 
dw->size);
+                       Notify(ami_gui_get_app_id(),
+                                       APPNOTIFY_Percentage, dw->progress,
+                                       TAG_DONE);
+               } else {
+                       RefreshSetGadgetAttrs((struct Gadget 
*)dw->objects[GID_STATUS], dw->win, NULL,
                                                FUELGAUGE_Level,   
dw->downloaded,
                                                GA_Text,           
messages_get("amiDownload"),
                                                FUELGAUGE_VarArgs, va,
                                                TAG_DONE);
+               }
        }
        else
        {
-               RefreshSetGadgetAttrs((struct Gadget *)dw->objects[GID_STATUS], 
dw->win, NULL,
+               if((nsoption_bool(download_notify_progress) == true)) {
+                       /* unknown size, not entirely sure how to deal with 
this atm... */
+                       Notify(ami_gui_get_app_id(),
+                                       APPNOTIFY_Percentage, 100,
+                                       TAG_DONE);
+               } else {
+                       RefreshSetGadgetAttrs((struct Gadget 
*)dw->objects[GID_STATUS], dw->win, NULL,
                                                FUELGAUGE_Level,   
dw->downloaded,
                                                GA_Text,           
messages_get("amiDownloadU"),
                                                FUELGAUGE_VarArgs, va,
                                                TAG_DONE);
+               }
        }
 
        return NSERROR_OK;
@@ -248,6 +281,12 @@ static void gui_download_window_done(struct 
gui_download_window *dw)
        if(!dw) return;
        bw = dw->bw;
 
+       if((nsoption_bool(download_notify_progress) == true)) {
+               Notify(ami_gui_get_app_id(),
+                               APPNOTIFY_Update, TRUE,
+                               TAG_DONE);
+       }
+
        if((nsoption_bool(download_notify)) && (dw->result == AMINS_DLOAD_OK))
        {
                Notify(ami_gui_get_app_id(), APPNOTIFY_Title, 
messages_get("amiDownloadComplete"),
@@ -275,7 +314,10 @@ static void gui_download_window_done(struct 
gui_download_window *dw)
 
        downloads_in_progress--;
 
-       DisposeObject(dw->objects[OID_MAIN]);
+       if(dw->objects[OID_MAIN] != NULL) {
+               DisposeObject(dw->objects[OID_MAIN]);
+       }
+
        ami_gui_win_list_remove(dw);
        if(queuedl) {
                nsurl *url;
diff --git a/frontends/amiga/options.h b/frontends/amiga/options.h
index a2cc92e..a23435c 100644
--- a/frontends/amiga/options.h
+++ b/frontends/amiga/options.h
@@ -49,6 +49,7 @@ NSOPTION_STRING(arexx_startup, "Startup.nsrx")
 NSOPTION_STRING(arexx_shutdown, "Shutdown.nsrx")
 NSOPTION_STRING(download_dir, NULL)
 NSOPTION_BOOL(download_notify, true)
+NSOPTION_BOOL(download_notify_progress, false)
 NSOPTION_BOOL(faster_scroll, true)
 NSOPTION_BOOL(scale_quality, false)
 NSOPTION_INTEGER(dither_quality, 0)
diff --git a/resources/FatMessages b/resources/FatMessages
index ead95fc..8f3c64a 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -1564,6 +1564,11 @@ nl.all.Abort:Breek af
 # This section contains tokens which are used in the Amiga
 # download window.
 #
+en.ami.amiDownloading:NetSurf: Downloading...
+de.ami.amiDownloading:NetSurf: Downloading...
+fr.ami.amiDownloading:NetSurf: Downloading...
+it.ami.amiDownloading:NetSurf: Downloading...
+nl.ami.amiDownloading:NetSurf: Downloading...
 en.ami.amiDownload:%ld of %ld bytes downloaded
 de.ami.amiDownload:%ld von %ld Bytes heruntergeladen
 fr.ami.amiDownload:%ld of %ld bytes downloaded


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to