From a2bc5cc3fa7c6d2324b1d9297d77eb79a237fb6e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 24 May 2008 23:33:02 +0200 Subject: [PATCH] initialize base path information label disable button while scanning --- src/net/pterodactylus/jsite/gui/ProjectPanel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/net/pterodactylus/jsite/gui/ProjectPanel.java b/src/net/pterodactylus/jsite/gui/ProjectPanel.java index 03f91cc..cf53482 100644 --- a/src/net/pterodactylus/jsite/gui/ProjectPanel.java +++ b/src/net/pterodactylus/jsite/gui/ProjectPanel.java @@ -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 projectEntries = project.getBasePathEntries(); basePathInformationLabel.setText(I18n.get("projectPanel.basePathInformation.fileCount", projectEntries.size())); + changeBasePathAction.setEnabled(true); } }); } -- 2.7.4