Skip to content

Enabling "external editor" now requires to save all sketches. #6223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/src/cc/arduino/view/preferences/Preferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import cc.arduino.i18n.Languages;
import processing.app.Base;
import processing.app.BaseNoGui;
import processing.app.Editor;
import processing.app.I18n;
import processing.app.PreferencesData;
import processing.app.Theme;
Expand All @@ -42,6 +43,7 @@

import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.WindowEvent;
import java.io.File;
import java.util.LinkedList;
Expand Down Expand Up @@ -243,6 +245,21 @@ public void mouseEntered(java.awt.event.MouseEvent evt) {
checkboxesContainer.add(verifyUploadBox);

externalEditorBox.setText(tr("Use external editor"));
externalEditorBox.addItemListener(ev -> {
if (ev.getStateChange() == ItemEvent.SELECTED) {
for (Editor e : base.getEditors()) {
if (e.getSketch().isModified()) {
String msg = tr("You have unsaved changes!\nYou must save all your sketches to enable this option.");
JOptionPane.showMessageDialog(null, msg,
tr("Can't enable external editor"),
JOptionPane.INFORMATION_MESSAGE);
externalEditorBox.setSelected(false);
return;
}
}
}
});

checkboxesContainer.add(externalEditorBox);

cacheCompiledCore.setText(tr("Aggressively cache compiled core"));
Expand Down
14 changes: 14 additions & 0 deletions arduino-core/src/processing/app/i18n/Resources_en.po
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ msgstr "CRC doesn't match, file is corrupted. It may be a temporary problem, ple
msgid "Can only pass one of: {0}"
msgstr "Can only pass one of: {0}"

#: ../../../../../app/src/cc/arduino/view/preferences/Preferences.java:254
msgid "Can't enable external editor"
msgstr ""

#: ../../../processing/app/BaseNoGui.java:504
#: ../../../processing/app/BaseNoGui.java:549
msgid "Can't find the sketch in the specified path"
Expand Down Expand Up @@ -469,6 +473,10 @@ msgstr "Chinese (Taiwan)"
msgid "Chinese (Taiwan) (Big5)"
msgstr "Chinese (Taiwan) (Big5)"

#: ../../../../../app/src/processing/app/AbstractTextMonitor.java:80
msgid "Clear output"
msgstr ""

#: ../../../../../app/src/cc/arduino/view/preferences/AdditionalBoardsManagerURLTextArea.java:98
msgid "Click for a list of unofficial boards support URLs"
msgstr "Click for a list of unofficial boards support URLs"
Expand Down Expand Up @@ -2455,6 +2463,12 @@ msgstr "You cannot save the sketch into a folder\ninside itself. This would go o
msgid "You forgot your sketchbook"
msgstr "You forgot your sketchbook"

#: ../../../../../app/src/cc/arduino/view/preferences/Preferences.java:252
msgid ""
"You have unsaved changes!\n"
"You must save all your sketches to enable this option."
msgstr ""

#: ../../../processing/app/AbstractMonitor.java:92
msgid ""
"You've pressed {0} but nothing was sent. Should you select a line ending?"
Expand Down
9 changes: 9 additions & 0 deletions arduino-core/src/processing/app/i18n/Resources_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ CRC\ doesn't\ match,\ file\ is\ corrupted.\ It\ may\ be\ a\ temporary\ problem,\
#, java-format
Can\ only\ pass\ one\ of\:\ {0}=Can only pass one of\: {0}

#: ../../../../../app/src/cc/arduino/view/preferences/Preferences.java:254
!Can't\ enable\ external\ editor=

#: ../../../processing/app/BaseNoGui.java:504
#: ../../../processing/app/BaseNoGui.java:549
Can't\ find\ the\ sketch\ in\ the\ specified\ path=Can't find the sketch in the specified path
Expand Down Expand Up @@ -330,6 +333,9 @@ Chinese\ (Taiwan)=Chinese (Taiwan)
#: ../../../processing/app/Preferences.java:143
Chinese\ (Taiwan)\ (Big5)=Chinese (Taiwan) (Big5)

#: ../../../../../app/src/processing/app/AbstractTextMonitor.java:80
!Clear\ output=

#: ../../../../../app/src/cc/arduino/view/preferences/AdditionalBoardsManagerURLTextArea.java:98
Click\ for\ a\ list\ of\ unofficial\ boards\ support\ URLs=Click for a list of unofficial boards support URLs

Expand Down Expand Up @@ -1771,6 +1777,9 @@ You\ cannot\ save\ the\ sketch\ into\ a\ folder\ninside\ itself.\ This\ would\ g
#: Base.java:1888
You\ forgot\ your\ sketchbook=You forgot your sketchbook

#: ../../../../../app/src/cc/arduino/view/preferences/Preferences.java:252
!You\ have\ unsaved\ changes\!\nYou\ must\ save\ all\ your\ sketches\ to\ enable\ this\ option.=

#: ../../../processing/app/AbstractMonitor.java:92
You've\ pressed\ {0}\ but\ nothing\ was\ sent.\ Should\ you\ select\ a\ line\ ending?=You've pressed {0} but nothing was sent. Should you select a line ending?

Expand Down
1 change: 1 addition & 0 deletions build/shared/revisions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ARDUINO 1.8.3
[ide]
* Serial Monitor: added "Clear output" button. Thanks @MichaelSy
* added option in preferences.txt for: custom title, comment/uncomment shortcut, always show file extensions. Thanks @MichaelSy
* Enabling "Use external editor" option now requires to save all sketches.

ARDUINO 1.8.2 2017.03.22

Expand Down