From 9b46aab2ef4e5a1a88da4d26df5f30e2db217398 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 6 Aug 2022 22:17:32 -0400 Subject: [PATCH] default naming selection not being set in prefs window --- app/src/processing/app/SketchName.java | 6 +++--- app/src/processing/app/ui/PreferencesFrame.java | 6 ++++++ todo.txt | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/SketchName.java b/app/src/processing/app/SketchName.java index a6d69ec0a..8a0bded01 100644 --- a/app/src/processing/app/SketchName.java +++ b/app/src/processing/app/SketchName.java @@ -15,7 +15,7 @@ import java.util.Map; public class SketchName { static final String FILENAME = "naming.json"; - static final String CLASSIC_NAME = "Classic (sketch_220809a)"; + static final public String CLASSIC = "Classic (sketch_220809a)"; static boolean breakTime = false; static Map wordLists; @@ -31,7 +31,7 @@ public class SketchName { */ static File nextFolder(File parentDir) { String approach = Preferences.get("sketch.name.approach"); - if (!CLASSIC_NAME.equals(approach)) { + if (!CLASSIC.equals(approach)) { File folder = wordsFolder(parentDir, approach); if (folder != null) { return folder; @@ -163,7 +163,7 @@ public class SketchName { static public String[] getOptions() { StringList outgoing = new StringList(); - outgoing.append(CLASSIC_NAME); + outgoing.append(CLASSIC); for (String approach : getWordLists().keySet()) { outgoing.append(approach); } diff --git a/app/src/processing/app/ui/PreferencesFrame.java b/app/src/processing/app/ui/PreferencesFrame.java index 5812c4f23..1340bba83 100644 --- a/app/src/processing/app/ui/PreferencesFrame.java +++ b/app/src/processing/app/ui/PreferencesFrame.java @@ -815,7 +815,13 @@ public class PreferencesFrame { // deletePreviousBox.setSelected(Preferences.getBoolean("export.delete_target_folder")); //$NON-NLS-1$ sketchbookLocationField.setText(Preferences.getSketchbookPath()); + namingSelectionBox.setSelectedItem(Preferences.get("sketch.name.approach")); + if (namingSelectionBox.getSelectedIndex() < 0) { + // If no selection, revert to the classic style, and set the pref as well + namingSelectionBox.setSelectedItem(SketchName.CLASSIC); + Preferences.set("sketch.name.approach", SketchName.CLASSIC); + } checkUpdatesBox.setSelected(Preferences.getBoolean("update.check")); //$NON-NLS-1$ diff --git a/todo.txt b/todo.txt index db1eaf909..a2c2582fb 100755 --- a/todo.txt +++ b/todo.txt @@ -5,6 +5,7 @@ X working on macOS, written up for Windows and Linux X test on Windows and Linux X working on an updated welcome screen X fix usages of .array() method in PDE code +X default naming selection not being set in prefs window themes X try gradients in Lab space @@ -355,12 +356,12 @@ new things old things + Examples window (Casey will pick 3-4) +* Reference, Discourse, Github, Wiki 4.0 / fixes _ completion mode pop-up not following dark and light mode conventions _ make sure mono font is coming from languages file when first setting editor pref -_ default naming selection not being set in prefs window _ add wiki page for preferences and customization