diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2011-10-23 13:15:44 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2011-10-23 13:15:44 +0000 |
commit | c1afe81e063c7c9202a391228f1f9833170d7c3a (patch) | |
tree | 9ac0e2d70ffe984b24a3f1ffd6c93a71ad3c82ca /amiga/file.c | |
parent | 4bb6da7cd3d015612bc4a96bef3d19facffb8870 (diff) | |
download | netsurf-c1afe81e063c7c9202a391228f1f9833170d7c3a.tar.gz netsurf-c1afe81e063c7c9202a391228f1f9833170d7c3a.tar.bz2 |
Complete extended context menus
svn path=/trunk/netsurf/; revision=13076
Diffstat (limited to 'amiga/file.c')
-rw-r--r-- | amiga/file.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/amiga/file.c b/amiga/file.c index 9dd0d83f0..148955872 100644 --- a/amiga/file.c +++ b/amiga/file.c @@ -34,6 +34,7 @@ #include "desktop/save_complete.h" #include "desktop/save_pdf/pdf_plotters.h" #include "desktop/save_text.h" +#include "desktop/selection.h" #include "utils/messages.h" #include "utils/url.h" @@ -100,7 +101,8 @@ void ami_file_open(struct gui_window_2 *gwin) } void ami_file_save(int type, char *fname, struct Window *win, - struct hlcache_handle *object, struct hlcache_handle *favicon) + struct hlcache_handle *object, struct hlcache_handle *favicon, + struct selection *sel) { BPTR lock = 0; const char *source_data; @@ -157,29 +159,34 @@ void ami_file_save(int type, char *fname, struct Window *win, } #endif break; + + case AMINS_SAVE_SELECTION: + selection_save_text(sel, fname); + break; } FClose(fh); } - SetComment(fname, nsurl_access(content_get_url(object))); + if(object) SetComment(fname, nsurl_access(content_get_url(object))); } } ami_update_pointer(win, GUI_POINTER_DEFAULT); } -void ami_file_save_req(int type, struct gui_window_2 *gwin, struct hlcache_handle *object) +void ami_file_save_req(int type, struct gui_window_2 *gwin, + struct hlcache_handle *object, struct selection *sel) { char *fname = AllocVec(1024, MEMF_CLEAR | MEMF_PRIVATE); if(AslRequestTags(savereq, ASLFR_TitleText, messages_get("NetSurf"), ASLFR_Screen, scrn, - ASLFR_InitialFile, FilePart(nsurl_access(content_get_url(object))), + ASLFR_InitialFile, object ? FilePart(nsurl_access(content_get_url(object))) : "", TAG_DONE)) { strlcpy(fname, savereq->fr_Drawer, 1024); AddPart(fname, savereq->fr_File, 1024); - ami_file_save(type, fname, gwin->win, object, gwin->bw->window->favicon); + ami_file_save(type, fname, gwin->win, object, gwin->bw->window->favicon, sel); } if(fname) FreeVec(fname); |