initialize base path information label
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 24 May 2008 21:33:02 +0000 (23:33 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 24 May 2008 21:33:02 +0000 (23:33 +0200)
disable button while scanning

src/net/pterodactylus/jsite/gui/ProjectPanel.java

index 03f91cc..cf53482 100644 (file)
@@ -174,12 +174,12 @@ public class ProjectPanel extends JPanel implements DocumentListener, I18nable {
                basePathTextField = new JTextField(project.getBasePath());
                basePathTextField.setEditable(false);
                basePathLabel = new I18nLabel("projectPanel.label.basePath");
-               basePathInformationLabel = new JLabel("");
+               basePathInformationLabel = new JLabel(I18n.get("projectPanel.basePathInformation.fileCount", project.getBasePathEntries().size()));
                JButton changeBasePathButton = new JButton(changeBasePathAction);
                propertiesPanel.add(basePathLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 0, 0, 0), 0, 0));
                propertiesPanel.add(basePathTextField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0));
                propertiesPanel.add(changeBasePathButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 6, 0, 0), 0, 0));
-               propertiesPanel.add(basePathInformationLabel, new GridBagConstraints(1, 3, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
+               propertiesPanel.add(basePathInformationLabel, new GridBagConstraints(1, 3, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
 
                propertiesPanel.add(new JPanel(), new GridBagConstraints(0, 4, 3, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
 
@@ -232,6 +232,7 @@ public class ProjectPanel extends JPanel implements DocumentListener, I18nable {
                        basePathTextField.setText(newBasePath);
                        basePathInformationLabel.setText(I18n.get("projectPanel.basePathInformation.scanning"));
                        project.setBasePath(newBasePath);
+                       changeBasePathAction.setEnabled(false);
                        swingInterface.getThreadPool().execute(new Runnable() {
 
                                /**
@@ -242,6 +243,7 @@ public class ProjectPanel extends JPanel implements DocumentListener, I18nable {
                                        project.rescanBasePath();
                                        List<Entry> projectEntries = project.getBasePathEntries();
                                        basePathInformationLabel.setText(I18n.get("projectPanel.basePathInformation.fileCount", projectEntries.size()));
+                                       changeBasePathAction.setEnabled(true);
                                }
                        });
                }