From c143fabe3439eab5b9d3ff1f9a58160c72d568f8 Mon Sep 17 00:00:00 2001
From: Martino Facchin <m.facchin@arduino.cc>
Date: Tue, 12 Mar 2019 14:08:20 +0100
Subject: [PATCH 1/3] Preferences: arrange checkboxes into two columns

---
 app/src/cc/arduino/view/preferences/Preferences.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/src/cc/arduino/view/preferences/Preferences.java b/app/src/cc/arduino/view/preferences/Preferences.java
index bdbfabf08e9..047755e0963 100644
--- a/app/src/cc/arduino/view/preferences/Preferences.java
+++ b/app/src/cc/arduino/view/preferences/Preferences.java
@@ -248,7 +248,7 @@ public void mouseEntered(java.awt.event.MouseEvent evt) {
     arduinoNotRunningLabel.setForeground(Color.GRAY);
     arduinoNotRunningLabel.setText(tr("(edit only when Arduino is not running)"));
 
-    checkboxesContainer.setLayout(new javax.swing.BoxLayout(checkboxesContainer, javax.swing.BoxLayout.Y_AXIS));
+    checkboxesContainer.setLayout(new GridLayout(0,2));
 
     displayLineNumbersBox.setText(tr("Display line numbers"));
     checkboxesContainer.add(displayLineNumbersBox);

From a8968a7950888610396972384f18418e4e2317e5 Mon Sep 17 00:00:00 2001
From: Martino Facchin <m.facchin@arduino.cc>
Date: Tue, 12 Mar 2019 14:09:15 +0100
Subject: [PATCH 2/3] Preferences: allow smaller window since checkboxes take
 less space

Fixes #8238
---
 app/src/cc/arduino/view/preferences/Preferences.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/src/cc/arduino/view/preferences/Preferences.java b/app/src/cc/arduino/view/preferences/Preferences.java
index 047755e0963..b476b4ea89d 100644
--- a/app/src/cc/arduino/view/preferences/Preferences.java
+++ b/app/src/cc/arduino/view/preferences/Preferences.java
@@ -322,7 +322,7 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) {
         .addContainerGap()
         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
           .addGroup(jPanel1Layout.createSequentialGroup()
-            .addComponent(sketchbookLocationField, javax.swing.GroupLayout.DEFAULT_SIZE, 553, Short.MAX_VALUE)
+            .addComponent(sketchbookLocationField, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
             .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
             .addComponent(browseButton))
           .addComponent(checkboxesContainer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
@@ -631,13 +631,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
     getContentPane().setLayout(layout);
     layout.setHorizontalGroup(
       layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-      .addGap(0, 691, Short.MAX_VALUE)
+      .addGap(0, 800, Short.MAX_VALUE)
       .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
         .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
     );
     layout.setVerticalGroup(
       layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-      .addGap(0, 580, Short.MAX_VALUE)
+      .addGap(0, 400, Short.MAX_VALUE)
       .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
         .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
     );

From e8088ef9b30d9ef7c4350fe63d88824aa5c1f6f5 Mon Sep 17 00:00:00 2001
From: Martino Facchin <m.facchin@arduino.cc>
Date: Tue, 12 Mar 2019 14:30:23 +0100
Subject: [PATCH 3/3] Preferences: remove outdated preferences

---
 .../arduino/view/preferences/Preferences.java | 22 +++++--------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/app/src/cc/arduino/view/preferences/Preferences.java b/app/src/cc/arduino/view/preferences/Preferences.java
index b476b4ea89d..736ae826cfe 100644
--- a/app/src/cc/arduino/view/preferences/Preferences.java
+++ b/app/src/cc/arduino/view/preferences/Preferences.java
@@ -132,9 +132,7 @@ private void initComponents() {
     enableCodeFoldingBox = new javax.swing.JCheckBox();
     verifyUploadBox = new javax.swing.JCheckBox();
     externalEditorBox = new javax.swing.JCheckBox();
-    cacheCompiledCore = new javax.swing.JCheckBox();
     checkUpdatesBox = new javax.swing.JCheckBox();
-    updateExtensionBox = new javax.swing.JCheckBox();
     saveVerifyUploadBox = new javax.swing.JCheckBox();
     jLabel1 = new javax.swing.JLabel();
     jLabel2 = new javax.swing.JLabel();
@@ -277,15 +275,9 @@ public void mouseEntered(java.awt.event.MouseEvent evt) {
 
     checkboxesContainer.add(externalEditorBox);
 
-    cacheCompiledCore.setText(tr("Aggressively cache compiled core"));
-    checkboxesContainer.add(cacheCompiledCore);
-
     checkUpdatesBox.setText(tr("Check for updates on startup"));
     checkboxesContainer.add(checkUpdatesBox);
 
-    updateExtensionBox.setText(tr("Update sketch files to new extension on save (.pde -> .ino)"));
-    checkboxesContainer.add(updateExtensionBox);
-
     saveVerifyUploadBox.setText(tr("Save when verifying or uploading"));
     checkboxesContainer.add(saveVerifyUploadBox);
 
@@ -730,7 +722,6 @@ private void autoScaleCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//
   private javax.swing.JCheckBox enableCodeFoldingBox;
   private javax.swing.JButton extendedAdditionalUrlFieldWindow;
   private javax.swing.JCheckBox externalEditorBox;
-  private javax.swing.JCheckBox cacheCompiledCore;
   private javax.swing.JTextField fontSizeField;
   private javax.swing.JLabel fontSizeLabel;
   private javax.swing.JLabel jLabel1;
@@ -759,7 +750,6 @@ private void autoScaleCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//
   private javax.swing.JLabel showVerboseLabel;
   private javax.swing.JTextField sketchbookLocationField;
   private javax.swing.JLabel sketchbookLocationLabel;
-  private javax.swing.JCheckBox updateExtensionBox;
   private javax.swing.JCheckBox verboseCompilationBox;
   private javax.swing.JCheckBox verboseUploadBox;
   private javax.swing.JCheckBox verifyUploadBox;
@@ -834,12 +824,8 @@ private void savePreferencesData() {
 
     PreferencesData.setBoolean("editor.external", externalEditorBox.isSelected());
 
-    PreferencesData.setBoolean("compiler.cache_core", cacheCompiledCore.isSelected());
-
     PreferencesData.setBoolean("update.check", checkUpdatesBox.isSelected());
 
-    PreferencesData.setBoolean("editor.update_extension", updateExtensionBox.isSelected());
-
     PreferencesData.setBoolean("editor.save_on_verify", saveVerifyUploadBox.isSelected());
 
     PreferencesData.set("boardsmanager.additional.urls", additionalBoardsManagerField.getText().replace("\r\n", "\n").replace("\r", "\n").replace("\n", ","));
@@ -906,11 +892,15 @@ private void showPreferencesData() {
 
     externalEditorBox.setSelected(PreferencesData.getBoolean("editor.external"));
 
-    cacheCompiledCore.setSelected(PreferencesData.get("compiler.cache_core") == null || PreferencesData.getBoolean("compiler.cache_core"));
+    if (PreferencesData.get("compiler.cache_core") == null) {
+      PreferencesData.setBoolean("compiler.cache_core", true);
+    }
 
     checkUpdatesBox.setSelected(PreferencesData.getBoolean("update.check"));
 
-    updateExtensionBox.setSelected(PreferencesData.get("editor.update_extension") == null || PreferencesData.getBoolean("editor.update_extension"));
+    if (PreferencesData.get("editor.update_extension") == null) {
+      PreferencesData.setBoolean("editor.update_extension", true);
+    }
 
     saveVerifyUploadBox.setSelected(PreferencesData.getBoolean("editor.save_on_verify"));