* n00b counter measures: sample file not set issue

This commit is contained in:
Reinhard Pointner 2015-11-29 09:43:23 +00:00
parent 58da1b2cfc
commit 376881f77c
2 changed files with 5 additions and 4 deletions

View File

@ -746,7 +746,7 @@ public class MediaBindingBean {
public File getMediaFile() { public File getMediaFile() {
// make sure file is not null, and that it is an existing file // make sure file is not null, and that it is an existing file
if (mediaFile == null) { if (mediaFile == null) {
throw new IllegalStateException("Path to media file not set. Click \"Change Sample\" and select a sample file."); throw new IllegalStateException("Sample file has not been set. Click \"Change Sample\" to select a sample file.");
} }
return mediaFile; return mediaFile;

View File

@ -271,7 +271,7 @@ public class FormatDialog extends JDialog {
// initialize window properties // initialize window properties
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setMinimumSize(new Dimension(650, 470)); setMinimumSize(new Dimension(715, 470));
// initialize data // initialize data
setState(initMode, lockOnBinding != null ? lockOnBinding : restoreSample(initMode), lockOnBinding != null); setState(initMode, lockOnBinding != null ? lockOnBinding : restoreSample(initMode), lockOnBinding != null);
@ -545,8 +545,9 @@ public class FormatDialog extends JDialog {
} catch (Exception e) { } catch (Exception e) {
BindingException issue = findCause(e, BindingException.class); BindingException issue = findCause(e, BindingException.class);
if (issue != null) { if (issue != null) {
status.setText(getMessage(issue)); String msg = getMessage(issue);
status.setIcon(ResourceManager.getIcon("status.info")); status.setText(msg);
status.setIcon(ResourceManager.getIcon(msg.contains("Change Sample") ? "action.variables" : "status.info"));
} else { } else {
status.setText(String.format("%s: %s", e.getClass().getSimpleName(), e.getMessage())); status.setText(String.format("%s: %s", e.getClass().getSimpleName(), e.getMessage()));
status.setIcon(ResourceManager.getIcon("status.warning")); status.setIcon(ResourceManager.getIcon("status.warning"));