From: David ‘Bombe’ Roden Date: Tue, 22 Dec 2009 17:08:42 +0000 (+0100) Subject: Implement choosing of directory. X-Git-Tag: 0.8~17 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ee7a71fa0cbf92d64efadd89bb9bccde31eb7b0b;p=jSite.git Implement choosing of directory. --- diff --git a/src/de/todesbaum/jsite/gui/PreferencesPage.java b/src/de/todesbaum/jsite/gui/PreferencesPage.java index a5fa43a..513c23f 100644 --- a/src/de/todesbaum/jsite/gui/PreferencesPage.java +++ b/src/de/todesbaum/jsite/gui/PreferencesPage.java @@ -29,6 +29,7 @@ import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ButtonGroup; import javax.swing.JButton; +import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JRadioButton; @@ -242,7 +243,14 @@ public class PreferencesPage extends TWizardPage { * Lets the user choose a new temp directory. */ private void chooseTempDirectory() { - /* TODO */ + JFileChooser fileChooser = new JFileChooser(tempDirectory); + fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + int returnValue = fileChooser.showDialog(wizard, I18n.getMessage("jsite.preferences.temp-directory.choose.approve")); + if (returnValue == JFileChooser.CANCEL_OPTION) { + return; + } + tempDirectory = fileChooser.getSelectedFile().getPath(); + tempDirectoryTextField.setText(tempDirectory); } } diff --git a/src/de/todesbaum/jsite/i18n/jSite.properties b/src/de/todesbaum/jsite/i18n/jSite.properties index 0c0932d..c19d043 100644 --- a/src/de/todesbaum/jsite/i18n/jSite.properties +++ b/src/de/todesbaum/jsite/i18n/jSite.properties @@ -70,6 +70,7 @@ jsite.preferences.temp-directory=Temporary Directory jsite.preferences.temp-directory.default=Default jsite.preferences.temp-directory.custom=Custom jsite.preferences.temp-directory.choose=Choose +jsite.preferences.temp-directory.choose.approve=Choose jsite.insert.heading=Project insert jsite.insert.description=Please wait while the project is being inserted.