From: David ‘Bombe’ Roden Date: Wed, 22 Oct 2008 23:39:14 +0000 (+0200) Subject: Offer option to start with existing lockfile. X-Git-Tag: 0.7~41 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4c633debb3066a7094f3141dd111dd529860541e;p=jSite.git Offer option to start with existing lockfile. --- diff --git a/src/de/todesbaum/jsite/main/Main.java b/src/de/todesbaum/jsite/main/Main.java index 2f538d0..8c9a15d 100644 --- a/src/de/todesbaum/jsite/main/Main.java +++ b/src/de/todesbaum/jsite/main/Main.java @@ -145,8 +145,11 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen Locale.setDefault(configuration.getLocale()); I18n.setLocale(configuration.getLocale()); if (!configuration.createLockFile()) { - JOptionPane.showMessageDialog(null, I18n.getMessage("jsite.main.already-running"), null, JOptionPane.ERROR_MESSAGE); - return; + int option = JOptionPane.showOptionDialog(null, I18n.getMessage("jsite.main.already-running"), "", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[] { I18n.getMessage("jsite.main.already-running.override"), I18n.getMessage("jsite.wizard.quit") }, I18n.getMessage("jsite.wizard.quit")); + if (option != 0) { + return; + } + configuration.removeLockfileOnExit(); } wizard = new TWizard(); createActions();