private JButton _okButton = null;
private CompressionAlgorithm[] _algorithms = null;
private SummaryLabel _summaryLabel = null;
+ /** flag to remember whether the automatic deletion has been set to always */
+ private boolean _automaticallyDelete = false;
/**
UpdateMessageBroker.informSubscribers();
_dialog.dispose();
// Show confirmation dialog with OK button (not status bar message)
- if (numMarked > 0) {
- JOptionPane.showMessageDialog(_parentFrame, I18nManager.getText("dialog.compress.confirm1")
- + " " + numMarked + " " + I18nManager.getText("dialog.compress.confirm2"),
- I18nManager.getText(getNameKey()), JOptionPane.INFORMATION_MESSAGE);
+ if (numMarked > 0)
+ {
+ // Allow calling of delete function with one click
+ final String[] buttonTexts = {I18nManager.getText("button.yes"), I18nManager.getText("button.no"),
+ I18nManager.getText("button.always")};
+ int answer = _automaticallyDelete ? JOptionPane.YES_OPTION :
+ JOptionPane.showOptionDialog(_parentFrame,
+ I18nManager.getTextWithNumber("dialog.compress.confirm", numMarked),
+ I18nManager.getText(getNameKey()), JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.WARNING_MESSAGE, null, buttonTexts, buttonTexts[1]);
+ if (answer == JOptionPane.CANCEL_OPTION) {_automaticallyDelete = true;} // "always" is third option
+ if (_automaticallyDelete || answer == JOptionPane.YES_OPTION)
+ {
+ new Thread(new Runnable() {
+ public void run() {
+ _app.finishCompressTrack();
+ }
+ }).start();
+ }
}
- else {
+ else
+ {
JOptionPane.showMessageDialog(_parentFrame, I18nManager.getText("dialog.compress.confirmnone"),
I18nManager.getText(getNameKey()), JOptionPane.INFORMATION_MESSAGE);
}