default naming selection not being set in prefs window

This commit is contained in:
Ben Fry
2022-08-06 22:17:32 -04:00
parent dfa33fe0dc
commit 9b46aab2ef
3 changed files with 11 additions and 4 deletions

View File

@@ -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<String, WordList> 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);
}

View File

@@ -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$

View File

@@ -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