X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Ftodesbaum%2Fjsite%2Fgui%2FProjectFilesPage.java;h=67287b76cf5ccf4f8325e5345f4d70e99674e893;hb=9abfce460662cf2860cc989f49d1425fd2d482bf;hp=9321d6e4cf25b7155552b2688f00d0f4c45b0982;hpb=c6ea6c65ccbaa523847309272a11050538869a5f;p=jSite.git diff --git a/src/main/java/de/todesbaum/jsite/gui/ProjectFilesPage.java b/src/main/java/de/todesbaum/jsite/gui/ProjectFilesPage.java index 9321d6e..67287b7 100644 --- a/src/main/java/de/todesbaum/jsite/gui/ProjectFilesPage.java +++ b/src/main/java/de/todesbaum/jsite/gui/ProjectFilesPage.java @@ -61,8 +61,8 @@ import javax.swing.text.BadLocationException; import javax.swing.text.Document; import net.pterodactylus.util.io.MimeTypes; -import net.pterodactylus.util.swing.DelayedNotification; import net.pterodactylus.util.swing.SwingUtils; +import net.pterodactylus.util.thread.StoppableDelay; import de.todesbaum.jsite.application.FileOption; import de.todesbaum.jsite.application.Project; import de.todesbaum.jsite.gui.FileScanner.ScannedFile; @@ -116,7 +116,7 @@ public class ProjectFilesPage extends TWizardPage implements ActionListener, Lis private JComboBox fileOptionsMIMETypeComboBox; /** Delayed notification for file scanning. */ - private DelayedNotification delayedNotification; + private StoppableDelay delayedNotification; /** Dialog to display while scanning. */ private JDialog scanningFilesDialog; @@ -415,7 +415,24 @@ public class ProjectFilesPage extends TWizardPage implements ActionListener, Lis wizard.setPreviousEnabled(false); wizard.setQuitEnabled(false); - delayedNotification = new DelayedNotification(scanningFilesDialog, 2000); + ignoreHiddenFilesCheckBox.setEnabled(false); + scanAction.setEnabled(false); + + delayedNotification = new StoppableDelay(new Runnable() { + + @Override + @SuppressWarnings("synthetic-access") + public void run() { + scanningFilesDialog.setVisible(true); + } + }, new Runnable() { + + @Override + @SuppressWarnings("synthetic-access") + public void run() { + scanningFilesDialog.setVisible(false); + } + }, 2000); new Thread(fileScanner).start(); new Thread(delayedNotification).start(); new Thread(new Runnable() { @@ -484,6 +501,8 @@ public class ProjectFilesPage extends TWizardPage implements ActionListener, Lis wizard.setPreviousEnabled(true); wizard.setNextEnabled(!error); wizard.setQuitEnabled(true); + ignoreHiddenFilesCheckBox.setEnabled(true); + scanAction.setEnabled(true); } }); }