diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2012-12-08 17:47:57 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2012-12-08 17:47:57 +0000 |
commit | ff333828b70a5d31b9efe1c7b2df3216478722a3 (patch) | |
tree | 79035a2508b82d7e51cbe3494c6e1e10293cf1ba /amiga | |
parent | ffac64fcea44e2840cef67ec2d5bdc6ef0b4b268 (diff) | |
download | netsurf-ff333828b70a5d31b9efe1c7b2df3216478722a3.tar.gz |
Warn when closing multiple tabs
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/download.c | 2 | ||||
-rwxr-xr-x | amiga/gui.c | 10 | ||||
-rwxr-xr-x | amiga/misc.c | 4 | ||||
-rw-r--r-- | amiga/misc.h | 2 | ||||
-rw-r--r-- | amiga/options.h | 3 |
5 files changed, 17 insertions, 4 deletions
diff --git a/amiga/download.c b/amiga/download.c index 434d12ee8..224ac29db 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -390,7 +390,7 @@ gui_window_save_link(struct gui_window *g, const char *url, const char *title) BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG size) { /* Return TRUE if file can be (over-)written */ - int res = 0; + int32 res = 0; BPTR lock = 0; BPTR fh = 0; int64 oldsize = 0; diff --git a/amiga/gui.c b/amiga/gui.c index 47d75bcd0..66aca159e 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3316,7 +3316,15 @@ void ami_close_all_tabs(struct gui_window_2 *gwin) { struct Node *tab; struct Node *ntab; - + + if((gwin->tabs > 1) && (nsoption_bool(tab_close_warn) == true)) { + char *req_body = ami_utf8_easy(messages_get("MultiTabClose")); + int32 res = ami_warn_user_multi(req_body, "No", "Yes", gwin->win); + free(req_body); + + if(res == 1) return; + } + if(gwin->tabs) { tab = GetHead(&gwin->tab_list); diff --git a/amiga/misc.c b/amiga/misc.c index b5da1787f..4359c79b5 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -71,7 +71,7 @@ void warn_user(const char *warning, const char *detail) if(utf8warning) free(utf8warning); } -int ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win) +int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win) { int res = 0; char *utf8text = ami_utf8_easy(body); @@ -90,6 +90,8 @@ int ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, st if(utf8text) free(utf8text); if(utf8gadgets) FreeVec(utf8gadgets); + + return res; } void die(const char *error) diff --git a/amiga/misc.h b/amiga/misc.h index e76d6a3b4..34a85fa90 100644 --- a/amiga/misc.h +++ b/amiga/misc.h @@ -19,5 +19,5 @@ #ifndef AMIGA_MISC_H #define AMIGA_MISC_H char *translate_escape_chars(const char *s); -int ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win); +int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win); #endif diff --git a/amiga/options.h b/amiga/options.h index 957f389ec..4b477b66c 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -39,6 +39,7 @@ bool use_openurl_lib; \ bool new_tab_active; \ bool new_tab_last; \ + bool tab_close_warn; \ bool kiosk_mode; \ char *search_engines_file; \ char *arexx_dir; \ @@ -102,6 +103,7 @@ .use_openurl_lib = false, \ .new_tab_active = false, \ .new_tab_last = false, \ + .tab_close_warn = true, \ .kiosk_mode = false, \ .search_engines_file = NULL, \ .arexx_dir = NULL, \ @@ -164,6 +166,7 @@ { "use_openurl_lib", OPTION_BOOL, &nsoptions.use_openurl_lib}, \ { "new_tab_is_active", OPTION_BOOL, &nsoptions.new_tab_active}, \ { "new_tab_last", OPTION_BOOL, &nsoptions.new_tab_last}, \ +{ "tab_close_warn", OPTION_BOOL, &nsoptions.tab_close_warn}, \ { "kiosk_mode", OPTION_BOOL, &nsoptions.kiosk_mode}, \ { "search_engines_file",OPTION_STRING, &nsoptions.search_engines_file }, \ { "arexx_dir", OPTION_STRING, &nsoptions.arexx_dir }, \ |