Skip to content

Commit bc6b488

Browse files
bitroncmaglie
authored andcommitted
Removed leftover references to Base in BaseNoGui.
1 parent d6bd77e commit bc6b488

File tree

5 files changed

+32
-13
lines changed

5 files changed

+32
-13
lines changed

app/src/processing/app/Base.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,15 +2257,7 @@ static public void showFAQ() {
22572257
* much of a bummer, but something to notify the user about.
22582258
*/
22592259
static public void showMessage(String title, String message) {
2260-
if (title == null) title = _("Message");
2261-
2262-
if (commandLine) {
2263-
System.out.println(title + ": " + message);
2264-
2265-
} else {
2266-
JOptionPane.showMessageDialog(new Frame(), message, title,
2267-
JOptionPane.INFORMATION_MESSAGE);
2268-
}
2260+
BaseNoGui.showMessage(title, message);
22692261
}
22702262

22712263

app/src/processing/app/BaseNoGui.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ static protected void initPlatform() {
275275
}
276276
platform = (Platform) platformClass.newInstance();
277277
} catch (Exception e) {
278-
Base.showError(_("Problem Setting the Platform"),
279-
_("An unknown error occurred while trying to load\n" +
280-
"platform-specific code for your machine."), e);
278+
showError(_("Problem Setting the Platform"),
279+
_("An unknown error occurred while trying to load\n" +
280+
"platform-specific code for your machine."), e);
281281
}
282282
}
283283

@@ -413,7 +413,7 @@ static public LibraryList scanLibraries(File folder) throws IOException {
413413
+ "Library names must contain only basic letters and numbers.\n"
414414
+ "(ASCII only and no spaces, and it cannot start with a number)"),
415415
libName);
416-
Base.showMessage(_("Ignoring bad library name"), mess);
416+
showMessage(_("Ignoring bad library name"), mess);
417417
continue;
418418
}
419419

@@ -443,4 +443,11 @@ static public void showError(String title, String message, Throwable e, int exit
443443
notifier.showError(title, message, e, exit_code);
444444
}
445445

446+
/**
447+
* "No cookie for you" type messages. Nothing fatal or all that
448+
* much of a bummer, but something to notify the user about.
449+
*/
450+
static public void showMessage(String title, String message) {
451+
notifier.showMessage(title, message);
452+
}
446453
}

app/src/processing/app/helpers/BasicNotifier.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ public void showError(String title, String message, Throwable e, int exit_code)
2222
System.exit(exit_code);
2323
}
2424

25+
public void showMessage(String title, String message) {
26+
if (title == null) title = _("Message");
27+
28+
System.out.println(title + ": " + message);
29+
}
30+
2531
}

app/src/processing/app/helpers/GUINotifier.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,16 @@ public void showError(String title, String message, Throwable e, int exit_code)
2626
if (e != null) e.printStackTrace();
2727
System.exit(exit_code);
2828
}
29+
30+
/**
31+
* "No cookie for you" type messages. Nothing fatal or all that
32+
* much of a bummer, but something to notify the user about.
33+
*/
34+
public void showMessage(String title, String message) {
35+
if (title == null) title = _("Message");
36+
37+
JOptionPane.showMessageDialog(new Frame(), message, title,
38+
JOptionPane.INFORMATION_MESSAGE);
39+
}
40+
2941
}

app/src/processing/app/helpers/UserNotifier.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ public interface UserNotifier {
66

77
public void showError(String title, String message, Throwable e, int exit_code);
88

9+
public void showMessage(String title, String message);
10+
911
}

0 commit comments

Comments
 (0)