Invert decision on when to show the GUI

Previously, the code showed an error when the given action was not
upload or verify. This is now reversed: the GUI is shown when the action
is "GUI" (which is the default when no action specified). Since the
action enum only contains these three values, there is no change in
behaviour, but this makes it easier to add new actions later.
This commit is contained in:
Matthijs Kooijman 2014-04-07 10:01:41 +02:00 committed by Cristian Maglie
parent 6a09ee5eb6
commit f3565a1bda
1 changed files with 2 additions and 1 deletions

View File

@ -419,7 +419,8 @@ public class Base {
path = new File(currentDirectory, path).getAbsolutePath();
}
if (handleOpen(path, nextEditorLocation(), !(action == ACTION.UPLOAD || action == ACTION.VERIFY)) == null) {
boolean showEditor = (action == ACTION.GUI);
if (handleOpen(path, nextEditorLocation(), showEditor) == null) {
String mess = I18n.format(_("Failed to open sketch: \"{0}\""), path);
// Open failure is fatal in upload/verify mode
if (action == ACTION.VERIFY || action == ACTION.UPLOAD)