Removed leftover references to Base in BaseNoGui.

This commit is contained in:
Claudio Indellicati 2014-08-21 19:55:50 +02:00 committed by Cristian Maglie
parent d6bd77ec2b
commit bc6b488cf6
5 changed files with 32 additions and 13 deletions

View File

@ -2257,15 +2257,7 @@ public class Base {
* much of a bummer, but something to notify the user about. * much of a bummer, but something to notify the user about.
*/ */
static public void showMessage(String title, String message) { static public void showMessage(String title, String message) {
if (title == null) title = _("Message"); BaseNoGui.showMessage(title, message);
if (commandLine) {
System.out.println(title + ": " + message);
} else {
JOptionPane.showMessageDialog(new Frame(), message, title,
JOptionPane.INFORMATION_MESSAGE);
}
} }

View File

@ -275,9 +275,9 @@ public class BaseNoGui {
} }
platform = (Platform) platformClass.newInstance(); platform = (Platform) platformClass.newInstance();
} catch (Exception e) { } catch (Exception e) {
Base.showError(_("Problem Setting the Platform"), showError(_("Problem Setting the Platform"),
_("An unknown error occurred while trying to load\n" + _("An unknown error occurred while trying to load\n" +
"platform-specific code for your machine."), e); "platform-specific code for your machine."), e);
} }
} }
@ -413,7 +413,7 @@ public class BaseNoGui {
+ "Library names must contain only basic letters and numbers.\n" + "Library names must contain only basic letters and numbers.\n"
+ "(ASCII only and no spaces, and it cannot start with a number)"), + "(ASCII only and no spaces, and it cannot start with a number)"),
libName); libName);
Base.showMessage(_("Ignoring bad library name"), mess); showMessage(_("Ignoring bad library name"), mess);
continue; continue;
} }
@ -443,4 +443,11 @@ public class BaseNoGui {
notifier.showError(title, message, e, exit_code); notifier.showError(title, message, e, exit_code);
} }
/**
* "No cookie for you" type messages. Nothing fatal or all that
* much of a bummer, but something to notify the user about.
*/
static public void showMessage(String title, String message) {
notifier.showMessage(title, message);
}
} }

View File

@ -22,4 +22,10 @@ public class BasicNotifier implements UserNotifier {
System.exit(exit_code); System.exit(exit_code);
} }
public void showMessage(String title, String message) {
if (title == null) title = _("Message");
System.out.println(title + ": " + message);
}
} }

View File

@ -26,4 +26,16 @@ public class GUINotifier implements UserNotifier {
if (e != null) e.printStackTrace(); if (e != null) e.printStackTrace();
System.exit(exit_code); System.exit(exit_code);
} }
/**
* "No cookie for you" type messages. Nothing fatal or all that
* much of a bummer, but something to notify the user about.
*/
public void showMessage(String title, String message) {
if (title == null) title = _("Message");
JOptionPane.showMessageDialog(new Frame(), message, title,
JOptionPane.INFORMATION_MESSAGE);
}
} }

View File

@ -6,4 +6,6 @@ public interface UserNotifier {
public void showError(String title, String message, Throwable e, int exit_code); public void showError(String title, String message, Throwable e, int exit_code);
public void showMessage(String title, String message);
} }