summaryrefslogtreecommitdiff
path: root/cocoa/gui.m
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-04-25 23:11:55 +0100
committerVincent Sanders <vince@kyllikki.org>2016-04-25 23:11:55 +0100
commitbf3ee089cb57765c48065423027eb4fffbe297f1 (patch)
tree2432a7705866c0773bc70ea3287f45534ec085e1 /cocoa/gui.m
parent638e07f026d85de0c01630217570d4148aaaced5 (diff)
downloadnetsurf-bf3ee089cb57765c48065423027eb4fffbe297f1.tar.gz
netsurf-bf3ee089cb57765c48065423027eb4fffbe297f1.tar.bz2
use the miscellaneous table warning entry
change all the frontends to provide the warning callback in the miscelaneous table instead of using the warn_user function. Changing all the warn_user callsites still requires completion.
Diffstat (limited to 'cocoa/gui.m')
-rw-r--r--cocoa/gui.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/cocoa/gui.m b/cocoa/gui.m
index 351b6e5fa..78b4147a6 100644
--- a/cocoa/gui.m
+++ b/cocoa/gui.m
@@ -52,6 +52,17 @@ NSString * const kAlwaysCloseMultipleTabs = @"AlwaysCloseMultipleTabs";
struct browser_window;
+static nserror cocoa_warn_user(const char *warning, const char *detail)
+{
+ NSRunAlertPanel( NSLocalizedString( @"Warning", @"Warning title" ),
+ NSLocalizedString( @"Warning %s%s%s", @"Warning message" ),
+ NSLocalizedString( @"OK", @"" ), nil, nil,
+ warning, detail != NULL ? ": " : "",
+ detail != NULL ? detail : "" );
+ return NSERROR_OK;
+}
+
+
static struct gui_window *
gui_window_create(struct browser_window *bw,
struct gui_window *existing,
@@ -299,6 +310,7 @@ struct gui_window_table *cocoa_window_table = &window_table;
static struct gui_misc_table browser_table = {
.schedule = cocoa_schedule,
+ .warning = cocoa_warn_user,
.launch_url = gui_launch_url,
.cert_verify = gui_cert_verify,