Add dialog.showErrorBox API
This commit is contained in:
parent
e004d53d2a
commit
490a12d38a
3 changed files with 9 additions and 0 deletions
|
@ -103,6 +103,7 @@ void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
|
||||||
v8::Handle<v8::Context> context, void* priv) {
|
v8::Handle<v8::Context> context, void* priv) {
|
||||||
mate::Dictionary dict(context->GetIsolate(), exports);
|
mate::Dictionary dict(context->GetIsolate(), exports);
|
||||||
dict.SetMethod("showMessageBox", &ShowMessageBox);
|
dict.SetMethod("showMessageBox", &ShowMessageBox);
|
||||||
|
dict.SetMethod("showErrorBox", &atom::ShowErrorBox);
|
||||||
dict.SetMethod("showOpenDialog", &ShowOpenDialog);
|
dict.SetMethod("showOpenDialog", &ShowOpenDialog);
|
||||||
dict.SetMethod("showSaveDialog", &ShowSaveDialog);
|
dict.SetMethod("showSaveDialog", &ShowSaveDialog);
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,5 +93,8 @@ module.exports =
|
||||||
window,
|
window,
|
||||||
callback
|
callback
|
||||||
|
|
||||||
|
showErrorBox: (args...) ->
|
||||||
|
binding.showErrorBox args...
|
||||||
|
|
||||||
# Mark standard asynchronous functions.
|
# Mark standard asynchronous functions.
|
||||||
v8Util.setHiddenValue f, 'asynchronous', true for k, f of module.exports
|
v8Util.setHiddenValue f, 'asynchronous', true for k, f of module.exports
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/callback_forward.h"
|
#include "base/callback_forward.h"
|
||||||
|
#include "base/strings/string16.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -37,6 +38,10 @@ void ShowMessageBox(NativeWindow* parent_window,
|
||||||
const std::string& detail,
|
const std::string& detail,
|
||||||
const MessageBoxCallback& callback);
|
const MessageBoxCallback& callback);
|
||||||
|
|
||||||
|
// Like ShowMessageBox with simplest settings, but safe to call at very early
|
||||||
|
// stage of application.
|
||||||
|
void ShowErrorBox(const base::string16& title, const base::string16& content);
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
||||||
#endif // ATOM_BROWSER_UI_MESSAGE_BOX_H_
|
#endif // ATOM_BROWSER_UI_MESSAGE_BOX_H_
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue