From 302eb7c9ef9b1b45e41f8dfdeda365be8fb6dfe8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 16 Aug 2011 22:17:22 +0200 Subject: [PATCH] Turn ok-cancel dialog into yes-no-cancel dialog. This finally resolves #176. --- src/de/todesbaum/jsite/main/Main.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/de/todesbaum/jsite/main/Main.java b/src/de/todesbaum/jsite/main/Main.java index 205f55a..ee650a6 100644 --- a/src/de/todesbaum/jsite/main/Main.java +++ b/src/de/todesbaum/jsite/main/Main.java @@ -595,10 +595,16 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen } if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.quit.question"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION) { if (isOverwritingConfiguration()) { - if (JOptionPane.showConfirmDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.quite.overwrite-configuration"), configuration.getConfigurationLocator().getFile(configuration.getConfigurationDirectory())), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.OK_OPTION) { + int overwriteConfigurationAnswer = JOptionPane.showConfirmDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.quite.overwrite-configuration"), configuration.getConfigurationLocator().getFile(configuration.getConfigurationDirectory())), null, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + if (overwriteConfigurationAnswer == JOptionPane.YES_OPTION) { if (saveConfiguration()) { System.exit(0); } + } else if (overwriteConfigurationAnswer == JOptionPane.CANCEL_OPTION) { + return; + } + if (overwriteConfigurationAnswer == JOptionPane.NO_OPTION) { + System.exit(0); } } else { if (saveConfiguration()) { -- 2.7.4