@Override public void callback(final int returncode) { if(returncode == DEFAULT_OPTION) { //Disconnect controller.window().close(); if(NSApplication.NSTerminateNow.equals(BrowserController.applicationShouldTerminate(app))) { app.replyToApplicationShouldTerminate(true); } } else { app.replyToApplicationShouldTerminate(false); } } }, new Runnable() {
@Override public void callback(int returncode) { if(returncode == DEFAULT_OPTION) { //Quit final BackgroundActionRegistry registry = shared.getRegistry(); for(BackgroundAction action : registry.toArray(new BackgroundAction[registry.size()])) { action.cancel(); } app.replyToApplicationShouldTerminate(true); } if(returncode == CANCEL_OPTION) { //Cancel app.replyToApplicationShouldTerminate(false); } } });
private void terminate() { if(this.isSuppressed()) { preferences.setProperty("donate.reminder", NSBundle.mainBundle().infoDictionary().objectForKey("CFBundleShortVersionString").toString()); } // Remember this reminder date preferences.setProperty("donate.reminder.date", System.currentTimeMillis()); // Quit again app.replyToApplicationShouldTerminate(true); } }