From: David ‘Bombe’ Roden Date: Thu, 13 Nov 2008 23:18:19 +0000 (+0100) Subject: Implement warning for non-specified index file. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a5fcf3cbb126fe4115ff32d5adc0026f2fcf9e7f;p=jSite2.git Implement warning for non-specified index file. Don’t check for existence of index file if none has been specified. --- 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") {