]> khamidou — GitHub mirrors - electron.git/commitdiff
Add |options| for ShowMessageBox
authorCheng Zhao <zcbenz@gmail.com>
Thu, 23 Jul 2015 06:16:43 +0000 (14:16 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 23 Jul 2015 06:16:43 +0000 (14:16 +0800)
atom/browser/api/atom_api_dialog.cc
atom/browser/api/lib/dialog.coffee
atom/browser/ui/message_box.h
atom/browser/ui/message_box_gtk.cc
atom/browser/ui/message_box_mac.mm
atom/browser/ui/message_box_win.cc

index b5fd655d6f2691a87a82837a1682f8e10b64a651..695c11e336eef1e6957f6935861c9d915233153a 100644 (file)
@@ -42,6 +42,7 @@ namespace {
 void ShowMessageBox(int type,
                     const std::vector<std::string>& buttons,
                     int cancel_id,
+                    int options,
                     const std::vector<std::string>& 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);
   }
 }
index 7a60b7f846e0ce8d1b076963086f53ff55580826..35ef6240918c30e0156ec24a08bcbd3853dc8088 100644 (file)
@@ -104,6 +104,7 @@ module.exports =
     binding.showMessageBox messageBoxType,
                            options.buttons,
                            options.cancelId,
+                           0,
                            [options.title, options.message, options.detail],
                            options.icon,
                            window,
index 817da2c569981544c431e2d1df7a7583b2e04908..22cfa267b256b091737732603444b358a80ddccc 100644 (file)
@@ -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<void(int code)> MessageBoxCallback;
 
 int ShowMessageBox(NativeWindow* parent_window,
                    MessageBoxType type,
                    const std::vector<std::string>& 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<std::string>& buttons,
                     int cancel_id,
+                    int options,
                     const std::string& title,
                     const std::string& message,
                     const std::string& detail,
index 07695d49845c7889196bf5f4af65d7ed99019c76..41682190e60ebeb7ddfbf3cbf159969e5fd7d524 100644 (file)
@@ -162,6 +162,7 @@ int ShowMessageBox(NativeWindow* parent,
                    MessageBoxType type,
                    const std::vector<std::string>& 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<std::string>& buttons,
                     int cancel_id,
+                    int options,
                     const std::string& title,
                     const std::string& message,
                     const std::string& detail,
index 8fe3b7d060c3b997d4fdf24462445c5ab3f02ba4..e518af653da4f60a78b9c1feacbf5a48c1af3c83 100644 (file)
@@ -95,6 +95,7 @@ int ShowMessageBox(NativeWindow* parent_window,
                    MessageBoxType type,
                    const std::vector<std::string>& 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<std::string>& buttons,
                     int cancel_id,
+                    int options,
                     const std::string& title,
                     const std::string& message,
                     const std::string& detail,
index dae518deb4dc224a0b700314a5779087bee0ce1b..d8e08807230675add310dce390564d5363c74adc 100644 (file)
@@ -163,6 +163,7 @@ int ShowMessageBox(NativeWindow* parent,
                    MessageBoxType type,
                    const std::vector<std::string>& 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<std::string>& buttons,
                     int cancel_id,
+                    int options,
                     const std::string& title,
                     const std::string& message,
                     const std::string& detail,