When no directory was chosen, abort setting custom temp directory.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Tue, 22 Dec 2009 19:54:32 +0000 (20:54 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Tue, 22 Dec 2009 19:54:32 +0000 (20:54 +0100)
src/de/todesbaum/jsite/gui/PreferencesPage.java

index ba34c89..297016d 100644 (file)
@@ -232,6 +232,7 @@ public class PreferencesPage extends TWizardPage {
        private void selectDefaultTempDirectory() {
                tempDirectoryTextField.setEnabled(false);
                chooseTempDirectoryAction.setEnabled(false);
+               tempDirectory = null;
        }
 
        /**
@@ -240,6 +241,12 @@ public class PreferencesPage extends TWizardPage {
        private void selectCustomTempDirectory() {
                tempDirectoryTextField.setEnabled(true);
                chooseTempDirectoryAction.setEnabled(true);
+               if (tempDirectoryTextField.getText().length() == 0) {
+                       chooseTempDirectory();
+                       if (tempDirectoryTextField.getText().length() == 0) {
+                               defaultTempDirectory.setSelected(true);
+                       }
+               }
        }
 
        /**