From: Cheng Zhao Date: Thu, 23 Jul 2015 06:16:43 +0000 (+0800) Subject: Add |options| for ShowMessageBox X-Git-Tag: v0.30.1~6^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=da724d65d703a34a379b29527bbbc20dcbd4e4f4;p=electron.git Add |options| for ShowMessageBox --- diff --git a/atom/browser/api/atom_api_dialog.cc b/atom/browser/api/atom_api_dialog.cc index b5fd655d..695c11e3 100644 --- a/atom/browser/api/atom_api_dialog.cc +++ b/atom/browser/api/atom_api_dialog.cc @@ -42,6 +42,7 @@ namespace { void ShowMessageBox(int type, const std::vector& buttons, int cancel_id, + int options, const std::vector& texts, const gfx::ImageSkia& icon, atom::NativeWindow* window, @@ -59,11 +60,11 @@ void ShowMessageBox(int type, peek, &callback)) { atom::ShowMessageBox(window, (atom::MessageBoxType)type, buttons, cancel_id, - title, message, detail, icon, callback); + options, title, message, detail, icon, callback); } else { int chosen = atom::ShowMessageBox(window, (atom::MessageBoxType)type, - buttons, cancel_id, title, message, - detail, icon); + buttons, cancel_id, options, title, + message, detail, icon); args->Return(chosen); } } diff --git a/atom/browser/api/lib/dialog.coffee b/atom/browser/api/lib/dialog.coffee index 7a60b7f8..35ef6240 100644 --- a/atom/browser/api/lib/dialog.coffee +++ b/atom/browser/api/lib/dialog.coffee @@ -104,6 +104,7 @@ module.exports = binding.showMessageBox messageBoxType, options.buttons, options.cancelId, + 0, [options.title, options.message, options.detail], options.icon, window, diff --git a/atom/browser/ui/message_box.h b/atom/browser/ui/message_box.h index 817da2c5..22cfa267 100644 --- a/atom/browser/ui/message_box.h +++ b/atom/browser/ui/message_box.h @@ -27,12 +27,18 @@ enum MessageBoxType { MESSAGE_BOX_TYPE_QUESTION, }; +enum MessageBoxOptions { + MESSAGE_BOX_NONE = 0, + MESSAGE_BOX_NO_LINKS = 1 << 0, +}; + typedef base::Callback MessageBoxCallback; int ShowMessageBox(NativeWindow* parent_window, MessageBoxType type, const std::vector& buttons, int cancel_id, + int options, const std::string& title, const std::string& message, const std::string& detail, @@ -42,6 +48,7 @@ void ShowMessageBox(NativeWindow* parent_window, MessageBoxType type, const std::vector& buttons, int cancel_id, + int options, const std::string& title, const std::string& message, const std::string& detail, diff --git a/atom/browser/ui/message_box_gtk.cc b/atom/browser/ui/message_box_gtk.cc index 07695d49..41682190 100644 --- a/atom/browser/ui/message_box_gtk.cc +++ b/atom/browser/ui/message_box_gtk.cc @@ -162,6 +162,7 @@ int ShowMessageBox(NativeWindow* parent, MessageBoxType type, const std::vector& buttons, int cancel_id, + int options, const std::string& title, const std::string& message, const std::string& detail, @@ -174,6 +175,7 @@ void ShowMessageBox(NativeWindow* parent, MessageBoxType type, const std::vector& buttons, int cancel_id, + int options, const std::string& title, const std::string& message, const std::string& detail, diff --git a/atom/browser/ui/message_box_mac.mm b/atom/browser/ui/message_box_mac.mm index 8fe3b7d0..e518af65 100644 --- a/atom/browser/ui/message_box_mac.mm +++ b/atom/browser/ui/message_box_mac.mm @@ -95,6 +95,7 @@ int ShowMessageBox(NativeWindow* parent_window, MessageBoxType type, const std::vector& buttons, int cancel_id, + int options, const std::string& title, const std::string& message, const std::string& detail, @@ -127,6 +128,7 @@ void ShowMessageBox(NativeWindow* parent_window, MessageBoxType type, const std::vector& buttons, int cancel_id, + int options, const std::string& title, const std::string& message, const std::string& detail, diff --git a/atom/browser/ui/message_box_win.cc b/atom/browser/ui/message_box_win.cc index dae518de..d8e08807 100644 --- a/atom/browser/ui/message_box_win.cc +++ b/atom/browser/ui/message_box_win.cc @@ -163,6 +163,7 @@ int ShowMessageBox(NativeWindow* parent, MessageBoxType type, const std::vector& buttons, int cancel_id, + int options, const std::string& title, const std::string& message, const std::string& detail, @@ -190,6 +191,7 @@ void ShowMessageBox(NativeWindow* parent, MessageBoxType type, const std::vector& buttons, int cancel_id, + int options, const std::string& title, const std::string& message, const std::string& detail,