Add Abort button to download window

svn path=/trunk/netsurf/; revision=7384
This commit is contained in:
Chris Young 2009-04-30 18:40:26 +00:00
parent 160ec892e1
commit 84873deeff
8 changed files with 30 additions and 1 deletions

View File

@ -373,6 +373,7 @@ Download:%s von %s • %s/s • noch %s
DownloadU:%s von unbekannt • %s/s • bisher %s
Downloaded:%s komplett • etwa %s/s • gesamt %s
Unwritten:Schreiben der Datei ist fehlgeschlagen.
Abort:Abort
# Amiga download window tokens
#

View File

@ -373,6 +373,7 @@ Download:%s of %s • %s/s • %s remaining
DownloadU:%s of unknown • %s/s • %s total
Downloaded:%s complete • average %s/s • %s total
Unwritten:Writing data to file failed.
Abort:Abort
# Amiga download window tokens
#

View File

@ -373,6 +373,7 @@ Download:%s de %s • %s/s • %s restants
DownloadU:%s sur inconnu • %s/s • %s total
Downloaded:%s effectués • moyenne %s/s • %s total
Unwritten:L'écriture de données dans le fichier a échoué.
Abort:Abort
# Amiga download window tokens
#

View File

@ -374,6 +374,7 @@ Download:%s di %s ? %s/s ? %s al termine
DownloadU:%s sconosciuto ? %s/s ? %s totale
Downloaded:%s completato ? media %s/s ? %s totale
Unwritten:Scrittura dei dati sul file fallita.
Abort:Abort
# Amiga download window tokens
#

View File

@ -373,6 +373,7 @@ Download:%s van %s • %s/s • nog %s
DownloadU:%s van onbekend • %s/s • %s totaal
Downloaded:%s compleet • gemiddeld %s/s • %s totaal
Unwritten:Data naar bestand schrijven ging fout.
Abort:Abort
# Amiga download window tokens
#

View File

@ -31,6 +31,8 @@
#include "amiga/options.h"
#include "amiga/save_complete.h"
#include "content/fetch.h"
#include "desktop/selection.h"
#include "utils/messages.h"
@ -103,6 +105,8 @@ struct gui_download_window *gui_download_window_create(const char *url,
WA_CloseGadget, FALSE,
WA_SizeGadget, TRUE,
WA_CustomScreen,scrn,
WINDOW_SharedPort,sport,
WINDOW_UserData,dw,
WINDOW_IconifyGadget, TRUE,
WINDOW_LockHeight,TRUE,
WINDOW_Position, WPOS_CENTERSCREEN,
@ -118,13 +122,20 @@ struct gui_download_window *gui_download_window_create(const char *url,
FUELGAUGE_VarArgs,va,
FUELGAUGE_Percent,FALSE,
FUELGAUGE_Justification,FGJ_CENTER,
StringEnd,
FuelGaugeEnd,
CHILD_NominalSize,TRUE,
CHILD_WeightedHeight,0,
LAYOUT_AddChild, dw->gadgets[GID_CANCEL] = ButtonObject,
GA_ID,GID_CANCEL,
GA_RelVerify,TRUE,
GA_Text,messages_get("Abort"),
GA_TabCycle,TRUE,
ButtonEnd,
EndGroup,
EndWindow;
dw->win = (struct Window *)RA_OpenWindow(dw->objects[OID_MAIN]);
dw->fetch = fetch;
dw->node = AddObject(window_list,AMINS_DLWINDOW);
dw->node->objstruct = dw;
@ -170,6 +181,12 @@ void gui_download_window_error(struct gui_download_window *dw,
gui_download_window_done(dw);
}
void ami_download_window_abort(struct gui_download_window *dw)
{
fetch_abort(dw->fetch);
gui_download_window_done(dw);
}
void gui_download_window_done(struct gui_download_window *dw)
{
struct dlnode *dln,*dln2;

View File

@ -37,11 +37,13 @@ struct gui_download_window {
uint32 downloaded;
struct dlnode *dln;
struct browser_window *bw;
struct fetch *fetch;
};
int drag_save;
void *drag_save_data;
void ami_download_window_abort(struct gui_download_window *dw);
void ami_drag_save(struct Window *win);
void ami_free_download_list(struct List *dllist);

View File

@ -947,6 +947,11 @@ void ami_handle_msg(void)
ami_401login_close((struct gui_login_window *)gwin);
win_destroyed = true;
}
else if(gwin->node->Type == AMINS_DLWINDOW)
{
ami_download_window_abort((struct gui_download_window *)gwin);
win_destroyed = true;
}
break;
default: