From a5fcf3cbb126fe4115ff32d5adc0026f2fcf9e7f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 14 Nov 2008 00:18:19 +0100 Subject: [PATCH] =?utf8?q?Implement=20warning=20for=20non-specified=20inde?= =?utf8?q?x=20file.=20Don=E2=80=99t=20check=20for=20existence=20of=20index?= =?utf8?q?=20file=20if=20none=20has=20been=20specified.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/net/pterodactylus/jsite/gui/FileManager.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/net/pterodactylus/jsite/gui/FileManager.java b/src/net/pterodactylus/jsite/gui/FileManager.java index 1d81bd8..953e05d 100644 --- a/src/net/pterodactylus/jsite/gui/FileManager.java +++ b/src/net/pterodactylus/jsite/gui/FileManager.java @@ -256,16 +256,19 @@ public class FileManager extends JDialog implements I18nable, TreeSelectionListe public void actionPerformed(ActionEvent e) { String defaultFile = project.getDefaultFile(); if ((defaultFile == null) || (defaultFile.length() == 0)) { - /* TODO - i18n */ - JOptionPane.showMessageDialog(FileManager.this, I18n.get(""), I18n.get(""), JOptionPane.ERROR_MESSAGE); - return; - } - ProjectFile projectFile = project.getFile(defaultFile); - if (projectFile == null) { - JOptionPane.showMessageDialog(FileManager.this, I18n.get(""), I18n.get(""), JOptionPane.ERROR_MESSAGE); - return; + int selectedOption = JOptionPane.showOptionDialog(FileManager.this, I18n.get("fileManager.dialog.noDefaultFileSet.message"), I18n.get("fileManager.dialog.noDefaultFileSet.title"), 0, JOptionPane.WARNING_MESSAGE, null, new String[] { I18n.get("general.button.continue.name"), I18n.get("general.button.cancel.name") }, I18n.get("general.button.cancel.name")); + if (selectedOption == 1) { + return; + } + } else { + ProjectFile projectFile = project.getFile(defaultFile); + if (projectFile == null) { + /* TODO - i18n */ + JOptionPane.showMessageDialog(FileManager.this, I18n.get(""), I18n.get(""), JOptionPane.ERROR_MESSAGE); + return; + } + setVisible(false); } - setVisible(false); } }; rescanAction = new I18nAction("fileManager.button.rescan") { -- 2.7.4