diff options
Diffstat (limited to 'cocoa')
-rw-r--r-- | cocoa/Makefile.target | 1 | ||||
-rw-r--r-- | cocoa/gui.m | 12 | ||||
-rw-r--r-- | cocoa/utils.m | 30 |
3 files changed, 12 insertions, 31 deletions
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target index af354d768..615c007ca 100644 --- a/cocoa/Makefile.target +++ b/cocoa/Makefile.target @@ -94,7 +94,6 @@ S_COCOA := \ plotter.m \ schedule.m \ selection.m \ - utils.m \ ArrowBox.m \ ArrowWindow.m \ BlackScroller.m \ 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, diff --git a/cocoa/utils.m b/cocoa/utils.m deleted file mode 100644 index 2c73e9b49..000000000 --- a/cocoa/utils.m +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2011 Sven Weidauer <sven.weidauer@gmail.com> - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#import <Cocoa/Cocoa.h> - -#import "utils/utils.h" - -void 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 : "" ); -} |