mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
Warn when closing multiple tabs
This commit is contained in:
parent
ffac64fcea
commit
ff333828b7
@ -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;
|
||||
|
@ -3317,6 +3317,14 @@ 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);
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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 }, \
|
||||
|
@ -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
|
||||
# =======
|
||||
|
Loading…
Reference in New Issue
Block a user