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 }, \ diff --git a/resources/FatMessages b/resources/FatMessages index e8f22aaf0..d7bda1a23 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -2675,6 +2675,11 @@ de.ami.CompError:Nicht zu öffnen fr.ami.CompError:Unable to open it.ami.CompError:Impossibile aprire nl.ami.CompError:Unable to open +en.ami.MultiTabClose:Are you sure you want to close multiple tabs? +de.ami.MultiTabClose:Are you sure you want to close multiple tabs? +fr.ami.MultiTabClose:Are you sure you want to close multiple tabs? +it.ami.MultiTabClose:Are you sure you want to close multiple tabs? +nl.ami.MultiTabClose:Are you sure you want to close multiple tabs? # Queries # =======