From 9a4175c4fa7c45690464433e7b29dc1a6754c4d4 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Jan 2009 21:26:22 +0000 Subject: Use an ASL requester allocated for saves (which defaults to option_download_dir when first used and remembers the save location thereafter) for the save requesters. svn path=/trunk/netsurf/; revision=6024 --- amiga/context_menu.c | 9 ++++----- amiga/menu.c | 30 +++++++++++++----------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/amiga/context_menu.c b/amiga/context_menu.c index c9ad039ba..66cc56385 100755 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 Chris Young + * Copyright 2008-9 Chris Young * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -221,17 +221,16 @@ uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved) case CMID_SAVEOBJ: object = (struct content *)userdata; - if(AslRequestTags(filereq, + if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_DoSaveMode,TRUE, ASLFR_InitialFile,FilePart(object->url), TAG_DONE)) { BPTR fh = 0; char fname[1024]; - strlcpy(&fname,filereq->fr_Drawer,1024); - AddPart(fname,filereq->fr_File,1024); + strlcpy(&fname,savereq->fr_Drawer,1024); + AddPart(fname,savereq->fr_File,1024); ami_update_pointer(gwin->win,GUI_POINTER_WAIT); if(fh = FOpen(fname,MODE_NEWFILE,0)) { diff --git a/amiga/menu.c b/amiga/menu.c index 7264c808d..e79e8e6e7 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 Chris Young + * Copyright 2008-9 Chris Young * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -436,15 +436,14 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) char fname[1024]; case 0: - if(AslRequestTags(filereq, + if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_DoSaveMode,TRUE, ASLFR_InitialFile,FilePart(gwin->bw->current_content->url), TAG_DONE)) { - strlcpy(&fname,filereq->fr_Drawer,1024); - AddPart(fname,filereq->fr_File,1024); + strlcpy(&fname,savereq->fr_Drawer,1024); + AddPart(fname,savereq->fr_File,1024); ami_update_pointer(gwin->win,GUI_POINTER_WAIT); if(fh = FOpen(fname,MODE_NEWFILE,0)) { @@ -457,15 +456,14 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) break; case 1: - if(AslRequestTags(filereq, + if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_DoSaveMode,TRUE, ASLFR_InitialFile,FilePart(gwin->bw->current_content->url), TAG_DONE)) { - strlcpy(&fname,filereq->fr_Drawer,1024); - AddPart(fname,filereq->fr_File,1024); + strlcpy(&fname,savereq->fr_Drawer,1024); + AddPart(fname,savereq->fr_File,1024); ami_update_pointer(gwin->win,GUI_POINTER_WAIT); save_as_text(gwin->bw->current_content,fname); SetComment(fname,gwin->bw->current_content->url); @@ -474,15 +472,14 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) break; case 2: - if(AslRequestTags(filereq, + if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_DoSaveMode,TRUE, ASLFR_InitialFile,FilePart(gwin->bw->current_content->url), TAG_DONE)) { - strlcpy(&fname,filereq->fr_Drawer,1024); - AddPart(fname,filereq->fr_File,1024); + strlcpy(&fname,savereq->fr_Drawer,1024); + AddPart(fname,savereq->fr_File,1024); ami_update_pointer(gwin->win,GUI_POINTER_WAIT); if(lock = CreateDir(fname)) { @@ -496,15 +493,14 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) case 3: #ifdef WITH_PDF_EXPORT - if(AslRequestTags(filereq, + if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_DoSaveMode,TRUE, ASLFR_InitialFile,FilePart(gwin->bw->current_content->url), TAG_DONE)) { - strlcpy(&fname,filereq->fr_Drawer,1024); - AddPart(fname,filereq->fr_File,1024); + strlcpy(&fname,savereq->fr_Drawer,1024); + AddPart(fname,savereq->fr_File,1024); ami_update_pointer(gwin->win,GUI_POINTER_WAIT); pdf_set_scale(DEFAULT_EXPORT_SCALE); save_as_pdf(gwin->bw->current_content,fname); -- cgit v1.2.3