Deprecate app.terminate API.
Users should use app.quit which can shutdown the application gracefuly.
This commit is contained in:
parent
5ead4f655a
commit
538bd1116d
5 changed files with 4 additions and 17 deletions
|
@ -73,16 +73,6 @@ void App::Quit(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||||
Browser::Get()->Quit();
|
Browser::Get()->Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
|
||||||
void App::Exit(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
||||||
exit(args[0]->IntegerValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
void App::Terminate(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
||||||
Browser::Get()->Terminate();
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void App::Focus(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
void App::Focus(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||||
Browser::Get()->Focus();
|
Browser::Get()->Focus();
|
||||||
|
@ -185,8 +175,6 @@ void App::Initialize(v8::Handle<v8::Object> target) {
|
||||||
t->SetClassName(v8::String::NewSymbol("Application"));
|
t->SetClassName(v8::String::NewSymbol("Application"));
|
||||||
|
|
||||||
NODE_SET_PROTOTYPE_METHOD(t, "quit", Quit);
|
NODE_SET_PROTOTYPE_METHOD(t, "quit", Quit);
|
||||||
NODE_SET_PROTOTYPE_METHOD(t, "exit", Exit);
|
|
||||||
NODE_SET_PROTOTYPE_METHOD(t, "terminate", Terminate);
|
|
||||||
NODE_SET_PROTOTYPE_METHOD(t, "focus", Focus);
|
NODE_SET_PROTOTYPE_METHOD(t, "focus", Focus);
|
||||||
NODE_SET_PROTOTYPE_METHOD(t, "getVersion", GetVersion);
|
NODE_SET_PROTOTYPE_METHOD(t, "getVersion", GetVersion);
|
||||||
NODE_SET_PROTOTYPE_METHOD(t, "setVersion", SetVersion);
|
NODE_SET_PROTOTYPE_METHOD(t, "setVersion", SetVersion);
|
||||||
|
|
|
@ -39,8 +39,6 @@ class App : public EventEmitter,
|
||||||
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
|
|
||||||
static void Quit(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void Quit(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
static void Exit(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
||||||
static void Terminate(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
||||||
static void Focus(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void Focus(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
static void GetVersion(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void GetVersion(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
static void SetVersion(const v8::FunctionCallbackInfo<v8::Value>& args);
|
static void SetVersion(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||||
|
|
|
@ -27,8 +27,9 @@ if process.platform is 'darwin'
|
||||||
setBadge: bindings.dockSetBadgeText
|
setBadge: bindings.dockSetBadgeText
|
||||||
getBadge: bindings.dockGetBadgeText
|
getBadge: bindings.dockGetBadgeText
|
||||||
|
|
||||||
# Support old event name.
|
# Be compatible with old API.
|
||||||
app.once 'ready', -> app.emit 'finish-launching'
|
app.once 'ready', -> app.emit 'finish-launching'
|
||||||
|
app.terminate = app.exit = app.quit
|
||||||
|
|
||||||
# Only one App object pemitted.
|
# Only one App object pemitted.
|
||||||
module.exports = app
|
module.exports = app
|
||||||
|
|
|
@ -10,7 +10,7 @@ var menu = null;
|
||||||
|
|
||||||
// Quit when all windows are closed.
|
// Quit when all windows are closed.
|
||||||
app.on('window-all-closed', function() {
|
app.on('window-all-closed', function() {
|
||||||
app.terminate();
|
app.quit();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on('open-url', function(event, url) {
|
app.on('open-url', function(event, url) {
|
||||||
|
|
|
@ -38,7 +38,7 @@ process.on('uncaughtException', function(error) {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on('window-all-closed', function() {
|
app.on('window-all-closed', function() {
|
||||||
app.terminate();
|
app.quit();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on('ready', function() {
|
app.on('ready', function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue