From 3d9d5d9b0e83dfe82e5ed7c13cf6b0706bc7f944 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 4 Feb 2022 22:27:45 -0500 Subject: [PATCH] more cleaning, organizing, making notes --- app/src/processing/app/Base.java | 34 +++----------------------------- todo.txt | 6 ++++++ 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 272dc9d67..0ce4c2d08 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1401,7 +1401,9 @@ public class Base { } }); } catch (IOException e) { - EventQueue.invokeLater(() -> Messages.showWarning("Exception During Installation", "Could not install contrib from " + path, e)); + EventQueue.invokeLater(() -> + Messages.showWarning("Exception During Installation", + "Could not install contrib from " + path, e)); } }).start(); } @@ -1526,24 +1528,6 @@ public class Base { } } } - - /* - if (editors.isEmpty()) { - // if the bad mode is the default mode, don't go into an infinite loop - // trying to recreate a window with the default mode. - Mode defaultMode = getDefaultMode(); - if (nextMode == defaultMode) { - Base.showError("Editor Problems", - "An error occurred while trying to change modes.\n" + - "We'll have to quit for now because it's an\n" + - "unfortunate bit of indigestion with the default Mode.", - null); - } else { - editor = defaultMode.createEditor(this, path, state); - } - } - */ - } catch (Throwable t) { Messages.showTrace("Terrible News", "A serious error occurred while " + @@ -1566,8 +1550,6 @@ public class Base { * @return true if succeeded in closing, false if canceled. */ public boolean handleClose(Editor editor, boolean modeSwitch) { - // Check if modified -// boolean immediate = editors.size() == 1; if (!editor.checkModified()) { return false; } @@ -1575,12 +1557,7 @@ public class Base { // Close the running window, avoid window boogers with multiple sketches editor.internalCloseRunner(); -// System.out.println("editors size is " + editors.size()); 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 (Platform.isMacOS()) { // If the central menu bar isn't supported on this macOS JVM, // we have to do the old behavior. Yuck! @@ -1613,11 +1590,6 @@ public class Base { Preferences.unset("server.port"); //$NON-NLS-1$ Preferences.unset("server.key"); //$NON-NLS-1$ -// // This will store the sketch count as zero -// editors.remove(editor); -// System.out.println("editors size now " + editors.size()); -// storeSketches(); - // Save out the current prefs state Preferences.save(); diff --git a/todo.txt b/todo.txt index 77b21e2c0..18ffbc94c 100755 --- a/todo.txt +++ b/todo.txt @@ -7,6 +7,12 @@ X remove anachronistic Preferences.save() that happens after opening a sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +_ remove selectMode() code from Base... just too funky +_ should just go back to the default Mode, or the first that matches +_ not enough Modes to warrant all the weirdness that could happen +_ and for Android (the only legit case), local.properties should be set +_ or we have changeMode() to make it an easy switch + _ errors when files removed during "git checkout " _ the tab has already disappeared, so complains it can't find the SketchCode