Author: jflesch
Date: 2007-07-01 23:17:43 +0000 (Sun, 01 Jul 2007)
New Revision: 13871

Modified:
   trunk/apps/Thaw/src/thaw/core/ThawConfigPanel.java
Log:
Fix the visibility of the option to select the directory where temporary files 
are created

Modified: trunk/apps/Thaw/src/thaw/core/ThawConfigPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/ThawConfigPanel.java  2007-07-01 23:12:55 UTC 
(rev 13870)
+++ trunk/apps/Thaw/src/thaw/core/ThawConfigPanel.java  2007-07-01 23:17:43 UTC 
(rev 13871)
@@ -27,6 +27,7 @@

        private boolean advancedMode;

+       private JLabel tmpDirLabel;
        private JTextField tmpDirField;
        private JButton tmpDirButton;

@@ -52,18 +53,18 @@
                tmpDirButton = new 
JButton(I18n.getMessage("thaw.common.browse"));
                tmpDirButton.addActionListener(this);

-               if (advancedMode) {
-                       thawConfigPanel.add(new 
JLabel(I18n.getMessage("thaw.common.tempDir")));
+               tmpDirLabel = new 
JLabel(I18n.getMessage("thaw.common.tempDir"));
+               thawConfigPanel.add(tmpDirLabel);

-                       JPanel tempDirPanel = new JPanel(new BorderLayout());
+               JPanel tempDirPanel = new JPanel(new BorderLayout());

-                       tempDirPanel.add(tmpDirField,
-                                        BorderLayout.CENTER);
-                       tempDirPanel.add(tmpDirButton,
-                                        BorderLayout.EAST);
+               tempDirPanel.add(tmpDirField,
+                                BorderLayout.CENTER);
+               tempDirPanel.add(tmpDirButton,
+                                BorderLayout.EAST);
+               thawConfigPanel.add(tempDirPanel);

-                       thawConfigPanel.add(tempDirPanel);
-               }
+               setAdvancedOptionsVisibility(advancedMode);

                configWindow.addObserver(this);
        }
@@ -74,6 +75,12 @@
        }


+       private void setAdvancedOptionsVisibility(boolean v) {
+               tmpDirField.setVisible(v);
+               tmpDirButton.setVisible(v);
+               tmpDirLabel.setVisible(v);
+       }
+
        public void actionPerformed(ActionEvent e) {
                FileChooser chooser = new 
FileChooser(System.getProperty("java.io.tmpdir"));
                chooser.setTitle(I18n.getMessage("thaw.common.tempDir"));
@@ -93,6 +100,8 @@
                        core.getConfig().setValue("tmpDir", 
tmpDirField.getText());
                        System.setProperty("java.io.tmpdir", 
tmpDirField.getText());
                        
tmpDirField.setText(System.getProperty("java.io.tmpdir"));
+
+                       setAdvancedOptionsVisibility(advancedMode);
                }

                if(arg == core.getConfigWindow().getCancelButton()) {


Reply via email to