1
0
mirror of https://github.com/mitb-archive/filebot synced 2025-03-09 22:09:47 -04:00

* properly finish dialog when dialog is canceled via X

This commit is contained in:
Reinhard Pointner 2009-06-02 18:51:09 +00:00
parent 0c698902df
commit f9d08bd57d

View File

@ -165,11 +165,20 @@ public class EpisodeFormatDialog extends JDialog {
}
});
// finish dialog and close window manually
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
finish(Option.CANCEL);
}
});
// update preview to current format
firePreviewSampleChanged();
// initialize window properties
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setLocation(TunedUtilities.getPreferredLocation(this));
pack();
}
@ -446,12 +455,14 @@ public class EpisodeFormatDialog extends JDialog {
private void finish(Option option) {
selectedOption = option;
// force shutdown
previewExecutor.shutdownNow();
setVisible(false);
dispose();
}
protected final Action cancelAction = new AbstractAction("Cancel", ResourceManager.getIcon("dialog.cancel")) {
@Override