@@ -69,23 +69,23 @@ public class PreferencePage extends FieldEditorPreferencePage implements IWorkbe
6969 private static final String KEY_PRIVATE_HARDWARE_PATHS = "Gui entry for private hardware paths" ; //$NON-NLS-1$
7070 private static final String KEY_PRIVATE_LIBRARY_PATHS = "Gui entry for private library paths" ; //$NON-NLS-1$
7171 private static final String KEY_TOOLCHAIN_SELECTION = "Gui entry for toolchain selection" ; //$NON-NLS-1$
72- //private static final String KEY_USE_BONJOUR = "Gui entry for usage of bonjour"; //$NON-NLS-1$
72+
7373
7474 private PathEditor arduinoPrivateLibPathPathEditor ;
7575 private PathEditor arduinoPrivateHardwarePathPathEditor ;
7676 private ComboFieldEditor buildBeforeUploadOptionEditor ;
7777 private BooleanFieldEditor openSerialMonitorOpensSerialsOptionEditor ;
7878 private BooleanFieldEditor automaticallyImportLibrariesOptionEditor ;
79- //private BooleanFieldEditor automaticallyInstallLibrariesOptionEditor;
8079 private BooleanFieldEditor useArduinoToolchainSelectionEditor ;
8180 private BooleanFieldEditor pragmaOnceHeaderOptionEditor ;
8281 private BooleanFieldEditor cleanSerialMonitorAfterUploadEditor ;
8382 private BooleanFieldEditor switchToSerialMonitorAfterUploadEditor ;
8483 private BooleanFieldEditor enableParallelBuildForNewProjects ;
85- //private BooleanFieldEditor enableBonjour;
84+
8685 private Button myBonjourCheckBox ;
8786 private Spinner myDelayNumberSpinner ;
8887 private Combo myDelayUnitCombo ;
88+ private Button myInstallLibCheckBox ;
8989
9090 private static int [] durationUnits = new int [] { 1 , 7 , 30 , 365 , 36500 };
9191
@@ -154,6 +154,8 @@ public boolean performOk() {
154154 ConfigurationPreferences .setAutoImportLibraries (this .automaticallyImportLibrariesOptionEditor .getBooleanValue ());
155155 ConfigurationPreferences .setPragmaOnceHeaders (this .pragmaOnceHeaderOptionEditor .getBooleanValue ());
156156 ConfigurationPreferences .setUseBonjour (myBonjourCheckBox .getSelection ());
157+ ConfigurationPreferences .setInstallLibraries (myInstallLibCheckBox .getSelection ());
158+
157159 //TOFIX line below
158160 ConfigurationPreferences .setJsonUpdateDelay (Duration .ofDays (myDelayNumberSpinner .getSelection () * durationUnits [myDelayUnitCombo .getSelectionIndex ()]));
159161 BoardsManager .setPrivateHardwarePaths (hardWarePaths );
@@ -321,12 +323,12 @@ protected void createFieldEditors() {
321323 Dialog .applyDialogFont (netWorkbox );
322324
323325 //Currently sloeber does not autoinstall librtaries
324- // Button myInstallLibCheckBox = new Button(netWorkbox, SWT.CHECK | SWT.LEFT);
325- // Label inStallLabel = new Label(netWorkbox, SWT.BEGINNING);
326- // inStallLabel.setText(Messages.ui_auto_install_libraries);
327- // GridData gd16 = new GridData(SWT.BEGINNING, SWT.TOP, true, false);
328- // gd16.horizontalSpan=3;
329- // inStallLabel.setLayoutData(gd16);
326+ myInstallLibCheckBox = new Button (netWorkbox , SWT .CHECK | SWT .LEFT );
327+ Label inStallLabel = new Label (netWorkbox , SWT .BEGINNING );
328+ inStallLabel .setText (Messages .ui_auto_install_libraries );
329+ GridData gd16 = new GridData (SWT .BEGINNING , SWT .TOP , true , false );
330+ gd16 .horizontalSpan =3 ;
331+ inStallLabel .setLayoutData (gd16 );
330332
331333
332334 myBonjourCheckBox = new Button (netWorkbox , SWT .CHECK | SWT .LEFT );
@@ -374,6 +376,7 @@ public void widgetDefaultSelected(SelectionEvent e) {
374376
375377
376378 myBonjourCheckBox .setSelection (ConfigurationPreferences .useBonjour ());
379+ myInstallLibCheckBox .setSelection (ConfigurationPreferences .getInstallLibraries ());
377380 setJsonDurationComposites (ConfigurationPreferences .getJsonUpdateDelay ());
378381
379382 }
@@ -412,6 +415,7 @@ protected void performApply() {
412415 protected void performDefaults () {
413416 super .performDefaults ();
414417 myBonjourCheckBox .setSelection ( Defaults .useBonjour );
418+ myInstallLibCheckBox .setSelection ( Defaults .INSTALL_LIBRARIES );
415419 setJsonDurationComposites (Defaults .getJsonUpdateDuration ());
416420
417421 }
0 commit comments