mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-21 17:29:55 +00:00
Make GUI request errors clean
If you don't request a specific GUI, we try SWT and then Swing. Okay. But if you do, we don't even try to see if it works—we just assume SWT works. If the user requested Swing, we just unconditionally spit out an error message and try to start the GUI anyway. Let's make the errors conditional on the GUIs being unavailable. Note, a Swing GUI is available. It is just incomplete and doesn't work very well. :)
This commit is contained in:
parent
4f2facf541
commit
44fd1cb010
@ -58,10 +58,17 @@ public class AppleCommander {
|
||||
String[] extraArgs = new String[args.length - 1];
|
||||
System.arraycopy(args, 1, extraArgs, 0, extraArgs.length);
|
||||
if ("-swt".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||
launchSwtAppleCommander(args);
|
||||
if (isSwtAvailable()) {
|
||||
launchSwtAppleCommander(args);
|
||||
} else {
|
||||
System.err.println(textBundle.get("SwtVersionNotAvailable")); //$NON-NLS-1$
|
||||
}
|
||||
} else if ("-swing".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||
System.err.println(textBundle.get("SwingVersionNotAvailable")); //$NON-NLS-1$
|
||||
launchSwingAppleCommander(args);
|
||||
if (isSwingAvailable()) {
|
||||
launchSwingAppleCommander(args);
|
||||
} else {
|
||||
System.err.println(textBundle.get("SwingVersionNotAvailable")); //$NON-NLS-1$
|
||||
}
|
||||
} else if ("-command".equalsIgnoreCase(args[0])) { //$NON-NLS-1$
|
||||
System.err.println(textBundle.get("CommandLineNotAvailable")); //$NON-NLS-1$
|
||||
} else if ("-help".equalsIgnoreCase(args[0]) //$NON-NLS-1$
|
||||
|
@ -110,6 +110,7 @@ CommandLineDC42Bad = Unable to interpret this DiskCopy 42 image.
|
||||
UserPreferencesComment = AppleCommander user preferences
|
||||
|
||||
# AppleCommander
|
||||
SwtVersionNotAvailable = Sorry, the SWT GUI is not available.
|
||||
SwingVersionNotAvailable = Sorry, the Swing GUI is not available.
|
||||
CommandLineNotAvailable = Sorry, the command line user interface is not available.
|
||||
AppleCommanderHelp = AppleCommander general options:\n-swt will launch the SWT version of AppleCommander.\n This requires the SWT jar and dll files to be present.\n-swing will launch the Swing version of AppleCommander.\n (This is not implemented yet.)\n-command will enter command interpreter mode. (This is also\n not implemented yet.)\n-help will show this help text.
|
||||
|
Loading…
Reference in New Issue
Block a user