]> khamidou — GitHub mirrors - electron.git/commitdiff
mac: Implement dialog.showErrorBox
authorCheng Zhao <zcbenz@gmail.com>
Wed, 5 Nov 2014 09:27:04 +0000 (17:27 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 5 Nov 2014 09:27:04 +0000 (17:27 +0800)
atom/browser/ui/message_box_mac.mm

index 2ff0ee93e92893a06c1453b846006c8df57fecc6..370b5911d0c234e39745bf8ac481cb4b58d96ddd 100644 (file)
@@ -141,4 +141,13 @@ void ShowMessageBox(NativeWindow* parent_window,
                       contextInfo:nil];
 }
 
+void ShowErrorBox(const base::string16& title, const base::string16& content) {
+  NSAlert* alert = [[NSAlert alloc] init];
+  [alert setMessageText:base::SysUTF16ToNSString(title)];
+  [alert setInformativeText:base::SysUTF16ToNSString(content)];
+  [alert setAlertStyle:NSWarningAlertStyle];
+  [alert runModal];
+  [alert release];
+}
+
 }  // namespace atom