Added extra help message about configuring the default editor in
preferences.
This commit is contained in:
parent
1d3d860864
commit
c9c75248cf
@ -1840,6 +1840,7 @@ EditDecalDialog.btn.chooser = Select Graphics Editor Program
|
||||
EditDecalHelper.createFileException = Cannot create temporary file {0}
|
||||
EditDecalHelper.launchSystemEditorException = Cannot launch system graphics editor
|
||||
EditDecalHelper.launchCustomEditorException = Cannot launch graphics editor with command ''{0}''
|
||||
EditDecalHelper.editPreferencesHelp = The editor used can be modified in the Preferences dialog.
|
||||
|
||||
MotorConfigurationPanel.lbl.motorMounts = Motor mounts:
|
||||
MotorConfigurationPanel.lbl.motorConfiguration = Motor configurations:
|
||||
|
@ -18,10 +18,29 @@ public class EditDecalHelper {
|
||||
|
||||
public static class EditDecalHelperException extends Exception {
|
||||
|
||||
private String extraMessage = "";
|
||||
|
||||
public EditDecalHelperException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public EditDecalHelperException(String message, String extraMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.extraMessage = extraMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
if (extraMessage == null || extraMessage.isEmpty()) {
|
||||
return super.getMessage();
|
||||
}
|
||||
return super.getMessage() + "\n" + getExtraMessage();
|
||||
}
|
||||
|
||||
public String getExtraMessage() {
|
||||
return extraMessage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
@ -113,7 +132,7 @@ public class EditDecalHelper {
|
||||
try {
|
||||
Desktop.getDesktop().edit(tmpFile);
|
||||
} catch (IOException ioex) {
|
||||
throw new EditDecalHelperException(trans.get("EditDecalHelper.launchSystemEditorException"), ioex);
|
||||
throw new EditDecalHelperException(trans.get("EditDecalHelper.launchSystemEditorException"), trans.get("EditDecalHelper.editPreferencesHelp"), ioex);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -130,7 +149,7 @@ public class EditDecalHelper {
|
||||
Runtime.getRuntime().exec(command);
|
||||
} catch (IOException ioex) {
|
||||
String message = MessageFormat.format(trans.get("EditDecalHelper.launchCustomEditorException"), command);
|
||||
throw new EditDecalHelperException(message, ioex);
|
||||
throw new EditDecalHelperException(message, trans.get("EditDecalHelper.editPreferencesHelp"), ioex);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user