File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
it.baeyens.arduino.common/src/it/baeyens/arduino/common
it.baeyens.arduino.core/src/it/baeyens/arduino/ui Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1+ package it .baeyens .arduino .common ;
2+
3+ public class Defaults {
4+ public static final boolean OPEN_SERIAL_WITH_MONITOR = true ;
5+ public static final boolean AUTO_IMPORT_LIBRARIES = true ;
6+ }
Original file line number Diff line number Diff line change 2626public class InstancePreferences extends Const {
2727
2828 public static boolean getOpenSerialWithMonitor () {
29- return getGlobalBoolean (KEY_OPEN_SERIAL_WITH_MONITOR , true );
29+ return getGlobalBoolean (KEY_OPEN_SERIAL_WITH_MONITOR , Defaults . OPEN_SERIAL_WITH_MONITOR );
3030 }
3131
3232 public static void setOpenSerialWithMonitor (boolean value ) {
@@ -39,7 +39,7 @@ public static void setOpenSerialWithMonitor(boolean value) {
3939 * @return true if libraries need to be added else false.
4040 */
4141 public static boolean getAutomaticallyIncludeLibraries () {
42- return getGlobalBoolean (KEY_AUTO_IMPORT_LIBRARIES , true );
42+ return getGlobalBoolean (KEY_AUTO_IMPORT_LIBRARIES , Defaults . AUTO_IMPORT_LIBRARIES );
4343 }
4444
4545 public static void setAutomaticallyIncludeLibraries (boolean value ) {
Original file line number Diff line number Diff line change 1515import org .eclipse .ui .preferences .ScopedPreferenceStore ;
1616
1717import it .baeyens .arduino .common .Const ;
18+ import it .baeyens .arduino .common .Defaults ;
1819
1920/**
2021 * ArduinoPreferencePage is the class that is behind the preference page of
@@ -38,7 +39,11 @@ public class PreferencePage extends FieldEditorPreferencePage implements IWorkbe
3839 public PreferencePage () {
3940 super (org .eclipse .jface .preference .FieldEditorPreferencePage .GRID );
4041 setDescription (Messages .ui_workspace_settings );
41- setPreferenceStore (new ScopedPreferenceStore (InstanceScope .INSTANCE , Const .NODE_ARDUINO ));
42+
43+ ScopedPreferenceStore preferences = new ScopedPreferenceStore (InstanceScope .INSTANCE , Const .NODE_ARDUINO );
44+ preferences .setDefault (Const .KEY_OPEN_SERIAL_WITH_MONITOR , Defaults .OPEN_SERIAL_WITH_MONITOR );
45+ preferences .setDefault (Const .KEY_AUTO_IMPORT_LIBRARIES , Defaults .AUTO_IMPORT_LIBRARIES );
46+ setPreferenceStore (preferences );
4247 }
4348
4449 @ Override
You can’t perform that action at this time.
0 commit comments