Skip to content

Commit 2afdb8a

Browse files
author
Federico Fissore
committed
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
1 parent 5ada9fa commit 2afdb8a

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

Diff for: app/src/processing/app/Base.java

-29
Original file line numberDiff line numberDiff line change
@@ -910,35 +910,6 @@ public boolean handleClose(Editor editor) {
910910
editor.internalCloseRunner();
911911

912912
if (editors.size() == 1) {
913-
// For 0158, when closing the last window /and/ it was already an
914-
// untitled sketch, just give up and let the user quit.
915-
// if (Preferences.getBoolean("sketchbook.closing_last_window_quits") ||
916-
// (editor.untitled && !editor.getSketch().isModified())) {
917-
if (OSUtils.isMacOS()) {
918-
Object[] options = {"OK", "Cancel"};
919-
String prompt =
920-
_("<html> " +
921-
"<head> <style type=\"text/css\">" +
922-
"b { font: 13pt \"Lucida Grande\" }" +
923-
"p { font: 11pt \"Lucida Grande\"; margin-top: 8px }" +
924-
"</style> </head>" +
925-
"<b>Are you sure you want to Quit?</b>" +
926-
"<p>Closing the last open sketch will quit Arduino.");
927-
928-
int result = JOptionPane.showOptionDialog(editor,
929-
prompt,
930-
_("Quit"),
931-
JOptionPane.YES_NO_OPTION,
932-
JOptionPane.QUESTION_MESSAGE,
933-
null,
934-
options,
935-
options[0]);
936-
if (result == JOptionPane.NO_OPTION ||
937-
result == JOptionPane.CLOSED_OPTION) {
938-
return false;
939-
}
940-
}
941-
942913
// This will store the sketch count as zero
943914
editors.remove(editor);
944915
try {

Diff for: app/src/processing/app/macosx/ThinkDifferent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void openFiles(final AppEvent.OpenFilesEvent openFilesEvent) {
8383
@Override
8484
public void handleQuitRequestWith(AppEvent.QuitEvent quitEvent, QuitResponse quitResponse) {
8585
if (waitForBase()) {
86-
if (Base.INSTANCE.handleClose(Base.INSTANCE.getActiveEditor())) {
86+
if (Base.INSTANCE.handleQuit()) {
8787
quitResponse.performQuit();
8888
} else {
8989
quitResponse.cancelQuit();
@@ -113,4 +113,4 @@ private static void sleep(int millis) {
113113
}
114114
}
115115

116-
}
116+
}

0 commit comments

Comments
 (0)