mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 16:28:51 -05:00
Make sure that the Loading indicator is visible if a Preset is being executed
This commit is contained in:
parent
51d748d4bb
commit
4852ca4292
@ -861,6 +861,7 @@ public class RenamePanel extends JComponent {
|
||||
// select files
|
||||
List<File> files = getFiles(evt);
|
||||
if (files == null) {
|
||||
namesList.firePropertyChange(LOADING_PROPERTY, true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -872,6 +873,7 @@ public class RenamePanel extends JComponent {
|
||||
|
||||
if (isMacSandbox()) {
|
||||
if (!MacAppUtilities.askUnlockFolders(getWindow(RenamePanel.this), remainingFiles)) {
|
||||
namesList.firePropertyChange(LOADING_PROPERTY, true, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,10 @@
|
||||
|
||||
package net.filebot.util.ui;
|
||||
|
||||
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
|
||||
public class LoadingOverlayPane extends JComponent {
|
||||
|
||||
public static final String LOADING_PROPERTY = "loading";
|
||||
@ -20,12 +15,10 @@ public class LoadingOverlayPane extends JComponent {
|
||||
|
||||
private int millisToOverlay = 400;
|
||||
|
||||
|
||||
public LoadingOverlayPane(JComponent component, JComponent propertyChangeSource) {
|
||||
this(component, propertyChangeSource, null, null);
|
||||
}
|
||||
|
||||
|
||||
public LoadingOverlayPane(JComponent component, JComponent propertyChangeSource, String offsetX, String offsetY) {
|
||||
setLayout(new MigLayout("insets 0, fill"));
|
||||
|
||||
@ -36,23 +29,17 @@ public class LoadingOverlayPane extends JComponent {
|
||||
add(component, "grow");
|
||||
|
||||
if (propertyChangeSource != null) {
|
||||
propertyChangeSource.addPropertyChangeListener(LOADING_PROPERTY, new PropertyChangeListener() {
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
setOverlayVisible((Boolean) evt.getNewValue());
|
||||
}
|
||||
propertyChangeSource.addPropertyChangeListener(LOADING_PROPERTY, evt -> {
|
||||
setOverlayVisible((Boolean) evt.getNewValue());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOptimizedDrawingEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public void setOverlayVisible(boolean b) {
|
||||
overlayEnabled = b;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user