rename pref, add pref to window for sketch name sync

This commit is contained in:
Ben Fry
2022-02-06 21:53:01 -05:00
parent 3d2f59b1eb
commit 8a5026dfc4
4 changed files with 15 additions and 11 deletions
+3 -3
View File
@@ -350,7 +350,7 @@ public class Sketch {
// ask for new name of file (internal to window)
// TODO maybe just pop up a text area?
renamingCode = true;
String prompt = (currentIndex == 0 && Preferences.getBoolean("sketch.sync_folder_and_filename")) ?
String prompt = (currentIndex == 0 && Preferences.getBoolean("editor.sync_folder_and_filename")) ?
Language.text("editor.sketch.rename.description") :
Language.text("editor.tab.rename.description");
String oldName = (current.isExtension(mode.getDefaultExtension())) ?
@@ -535,7 +535,7 @@ public class Sketch {
if (renamingCode) {
if (currentIndex == 0 &&
Preferences.getBoolean("sketch.sync_folder_and_filename")) {
Preferences.getBoolean("editor.sync_folder_and_filename")) {
if (!renameSketch(newName, newExtension)) return;
} else { // else if something besides code[0], or ok to decouple name
@@ -890,7 +890,7 @@ public class Sketch {
// user canceled selection
if (newSketchName == null) return false;
boolean sync = Preferences.getBoolean("sketch.sync_folder_and_filename");
boolean sync = Preferences.getBoolean("editor.sync_folder_and_filename");
String newMainFileName = null; // only set with !sync
File newFolder;
if (sync) {
@@ -74,6 +74,7 @@ public class PreferencesFrame {
JCheckBox zoomAutoBox;
JCheckBox hidpiDisableBox;
JCheckBox syncSketchNameBox;
JComboBox<String> displaySelectionBox;
JComboBox<String> languageSelectionBox;
@@ -187,6 +188,10 @@ public class PreferencesFrame {
hidpiDisableBox.setVisible(false); // only for Windows
// [ ] Keep sketch name and main tab name in sync
syncSketchNameBox = new JCheckBox("Keep sketch name and main tab in sync (experimental)");
// Colors
JLabel backgroundColorLabel = new JLabel(Language.text("preferences.background_color")+": ");
@@ -429,6 +434,7 @@ public class PreferencesFrame {
.addComponent(mbLabel))
.addComponent(deletePreviousBox)
.addComponent(checkUpdatesBox)
.addComponent(syncSketchNameBox)
.addGroup(layout.createSequentialGroup()
.addComponent(displayLabel)
.addComponent(displaySelectionBox,
@@ -489,6 +495,7 @@ public class PreferencesFrame {
.addComponent(mbLabel))
.addComponent(deletePreviousBox)
.addComponent(checkUpdatesBox)
.addComponent(syncSketchNameBox)
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER)
.addComponent(displayLabel)
.addComponent(displaySelectionBox))
@@ -666,6 +673,7 @@ public class PreferencesFrame {
if (Platform.isWindows()) {
Splash.setDisableHiDPI(hidpiDisableBox.isSelected());
}
Preferences.setBoolean("editor.sync_folder_and_filename", syncSketchNameBox.isSelected());
Preferences.setColor("run.present.bgcolor", presentColor.getBackground());
@@ -731,6 +739,7 @@ public class PreferencesFrame {
if (Platform.isWindows()) {
hidpiDisableBox.setSelected(Splash.getDisableHiDPI());
}
syncSketchNameBox.setSelected(Preferences.getBoolean("editor.sync_folder_and_filename"));
presentColor.setBackground(Preferences.getColor("run.present.bgcolor"));
presentColorHex.setText(Preferences.get("run.present.bgcolor").substring(1));
+1 -2
View File
@@ -1,4 +1,3 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -57,7 +56,7 @@ last.sketch.count = 0
last.sketch.restore = true
# set 'true' for the default behavior before 4.0b6
sketch.sync_folder_and_filename = true
editor.sync_folder_and_filename = true
# by default, contributions are moved to backup folders when
# they are removed or replaced. The locations of the backup
+2 -6
View File
@@ -6,18 +6,14 @@ X change cmd-click in window title to point to sketch folder
change detector
X text in second line of custom dialogs was showing too large
X i.e. change detector with large text for the "either way" part of the message
X change detector had large text for the "either way" part of the message
X remove nonsense removeCode() error text
modes and properties
X major rewrite of handleOpen() et al
X fix bug when changing the Mode between Java and Android
X appears that it would have been broken for a long time
_ PDF export not working with Processing 4.0 beta 5
_ was working with beta 3 and 4
_ https://github.com/processing/processing4/issues/395
X add option to disable keeping sketch folder and main tab in sync
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .