mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-18 18:23:25 +03:00
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.
This commit is contained in:
parent
3c94073590
commit
ee88653dc0
1
frontends/amiga/dist/NetSurf.guide
vendored
1
frontends/amiga/dist/NetSurf.guide
vendored
@ -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}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}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}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}url_file@{ub} Path to URL database file
|
||||||
@{b}hotlist_file@{ub} Path to Hotlist file
|
@{b}hotlist_file@{ub} Path to Hotlist file
|
||||||
@{b}arexx_dir@{ub} Path to ARexx scripts dir
|
@{b}arexx_dir@{ub} Path to ARexx scripts dir
|
||||||
|
@ -68,6 +68,14 @@
|
|||||||
#include "amiga/theme.h"
|
#include "amiga/theme.h"
|
||||||
#include "amiga/utf8.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 gui_download_window {
|
||||||
struct ami_generic_window w;
|
struct ami_generic_window w;
|
||||||
struct Window *win;
|
struct Window *win;
|
||||||
@ -157,7 +165,15 @@ static struct gui_download_window *gui_download_window_create(download_context *
|
|||||||
return NULL;
|
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_ScreenTitle, ami_gui_get_screen_title(),
|
||||||
WA_Title, dw->url,
|
WA_Title, dw->url,
|
||||||
WA_Activate, TRUE,
|
WA_Activate, TRUE,
|
||||||
@ -195,7 +211,9 @@ static struct gui_download_window *gui_download_window_create(download_context *
|
|||||||
EndGroup,
|
EndGroup,
|
||||||
EndWindow;
|
EndWindow;
|
||||||
|
|
||||||
dw->win = (struct Window *)RA_OpenWindow(dw->objects[OID_MAIN]);
|
dw->win = (struct Window *)RA_OpenWindow(dw->objects[OID_MAIN]);
|
||||||
|
}
|
||||||
|
|
||||||
dw->ctx = ctx;
|
dw->ctx = ctx;
|
||||||
|
|
||||||
ami_gui_win_list_add(dw, AMINS_DLWINDOW, &ami_download_table);
|
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[1] = (APTR)dw->size;
|
||||||
va[2] = 0;
|
va[2] = 0;
|
||||||
|
|
||||||
if(dw->size)
|
if(dw->size) {
|
||||||
{
|
if((nsoption_bool(download_notify_progress) == true)) {
|
||||||
RefreshSetGadgetAttrs((struct Gadget *)dw->objects[GID_STATUS], dw->win, NULL,
|
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,
|
FUELGAUGE_Level, dw->downloaded,
|
||||||
GA_Text, messages_get("amiDownload"),
|
GA_Text, messages_get("amiDownload"),
|
||||||
FUELGAUGE_VarArgs, va,
|
FUELGAUGE_VarArgs, va,
|
||||||
TAG_DONE);
|
TAG_DONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
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,
|
FUELGAUGE_Level, dw->downloaded,
|
||||||
GA_Text, messages_get("amiDownloadU"),
|
GA_Text, messages_get("amiDownloadU"),
|
||||||
FUELGAUGE_VarArgs, va,
|
FUELGAUGE_VarArgs, va,
|
||||||
TAG_DONE);
|
TAG_DONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NSERROR_OK;
|
return NSERROR_OK;
|
||||||
@ -248,6 +278,12 @@ static void gui_download_window_done(struct gui_download_window *dw)
|
|||||||
if(!dw) return;
|
if(!dw) return;
|
||||||
bw = dw->bw;
|
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))
|
if((nsoption_bool(download_notify)) && (dw->result == AMINS_DLOAD_OK))
|
||||||
{
|
{
|
||||||
Notify(ami_gui_get_app_id(), APPNOTIFY_Title, messages_get("amiDownloadComplete"),
|
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--;
|
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);
|
ami_gui_win_list_remove(dw);
|
||||||
if(queuedl) {
|
if(queuedl) {
|
||||||
nsurl *url;
|
nsurl *url;
|
||||||
|
@ -49,6 +49,7 @@ NSOPTION_STRING(arexx_startup, "Startup.nsrx")
|
|||||||
NSOPTION_STRING(arexx_shutdown, "Shutdown.nsrx")
|
NSOPTION_STRING(arexx_shutdown, "Shutdown.nsrx")
|
||||||
NSOPTION_STRING(download_dir, NULL)
|
NSOPTION_STRING(download_dir, NULL)
|
||||||
NSOPTION_BOOL(download_notify, true)
|
NSOPTION_BOOL(download_notify, true)
|
||||||
|
NSOPTION_BOOL(download_notify_progress, false)
|
||||||
NSOPTION_BOOL(faster_scroll, true)
|
NSOPTION_BOOL(faster_scroll, true)
|
||||||
NSOPTION_BOOL(scale_quality, false)
|
NSOPTION_BOOL(scale_quality, false)
|
||||||
NSOPTION_INTEGER(dither_quality, 0)
|
NSOPTION_INTEGER(dither_quality, 0)
|
||||||
|
@ -1564,6 +1564,11 @@ nl.all.Abort:Breek af
|
|||||||
# This section contains tokens which are used in the Amiga
|
# This section contains tokens which are used in the Amiga
|
||||||
# download window.
|
# 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
|
en.ami.amiDownload:%ld of %ld bytes downloaded
|
||||||
de.ami.amiDownload:%ld von %ld Bytes heruntergeladen
|
de.ami.amiDownload:%ld von %ld Bytes heruntergeladen
|
||||||
fr.ami.amiDownload:%ld of %ld bytes downloaded
|
fr.ami.amiDownload:%ld of %ld bytes downloaded
|
||||||
|
Loading…
Reference in New Issue
Block a user