From 2afdb8a6c32674d3d9e347c868cad37a6bf3f711 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Tue, 26 May 2015 12:02:03 +0200 Subject: [PATCH] MacOSX: when closing, no confirmation is displayed any more, unless at least one sketch is modified. In essence: now mac behaves just like the other OSs. Fixes #3093 --- app/src/processing/app/Base.java | 29 ------------------- .../processing/app/macosx/ThinkDifferent.java | 4 +-- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 64716f751..1472d0c26 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -910,35 +910,6 @@ public class Base { editor.internalCloseRunner(); if (editors.size() == 1) { - // For 0158, when closing the last window /and/ it was already an - // untitled sketch, just give up and let the user quit. -// if (Preferences.getBoolean("sketchbook.closing_last_window_quits") || -// (editor.untitled && !editor.getSketch().isModified())) { - if (OSUtils.isMacOS()) { - Object[] options = {"OK", "Cancel"}; - String prompt = - _(" " + - " " + - "Are you sure you want to Quit?" + - "

Closing the last open sketch will quit Arduino."); - - int result = JOptionPane.showOptionDialog(editor, - prompt, - _("Quit"), - JOptionPane.YES_NO_OPTION, - JOptionPane.QUESTION_MESSAGE, - null, - options, - options[0]); - if (result == JOptionPane.NO_OPTION || - result == JOptionPane.CLOSED_OPTION) { - return false; - } - } - // This will store the sketch count as zero editors.remove(editor); try { diff --git a/app/src/processing/app/macosx/ThinkDifferent.java b/app/src/processing/app/macosx/ThinkDifferent.java index 1f243a8d4..132e7efe6 100644 --- a/app/src/processing/app/macosx/ThinkDifferent.java +++ b/app/src/processing/app/macosx/ThinkDifferent.java @@ -83,7 +83,7 @@ public class ThinkDifferent { @Override public void handleQuitRequestWith(AppEvent.QuitEvent quitEvent, QuitResponse quitResponse) { if (waitForBase()) { - if (Base.INSTANCE.handleClose(Base.INSTANCE.getActiveEditor())) { + if (Base.INSTANCE.handleQuit()) { quitResponse.performQuit(); } else { quitResponse.cancelQuit(); @@ -113,4 +113,4 @@ public class ThinkDifferent { } } -} \ No newline at end of file +}