* add WAIT cursor in case loading files is taking a while

This commit is contained in:
Reinhard Pointner 2015-08-11 14:30:25 +00:00
parent b64e2b23a7
commit a5427fb5ab
1 changed files with 27 additions and 24 deletions

View File

@ -1,7 +1,6 @@
package net.filebot.ui.rename;
import static java.awt.event.KeyEvent.*;
import static java.util.Collections.*;
import static javax.swing.JOptionPane.*;
import static javax.swing.KeyStroke.*;
import static javax.swing.SwingUtilities.*;
@ -14,6 +13,7 @@ import static net.filebot.util.ui.SwingUI.*;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Insets;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -56,7 +56,6 @@ import net.filebot.Settings;
import net.filebot.StandardRenameAction;
import net.filebot.UserFiles;
import net.filebot.WebServices;
import net.filebot.format.ExpressionFilter;
import net.filebot.format.MediaBindingBean;
import net.filebot.mac.MacAppUtilities;
import net.filebot.media.MediaDetection;
@ -64,7 +63,6 @@ import net.filebot.similarity.Match;
import net.filebot.ui.rename.FormatDialog.Mode;
import net.filebot.ui.rename.RenameModel.FormattedFuture;
import net.filebot.ui.transfer.BackgroundFileTransferablePolicy;
import net.filebot.util.FileUtilities;
import net.filebot.util.PreferencesMap.PreferencesEntry;
import net.filebot.util.ui.ActionPopup;
import net.filebot.util.ui.LoadingOverlayPane;
@ -728,6 +726,10 @@ public class RenamePanel extends JComponent {
@Override
public void actionPerformed(ActionEvent evt) {
Window window = getWindow(RenamePanel.this);
try {
window.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
if (preset.getFormat() != null) {
switch (FormatDialog.Mode.getMode(preset.getDatasource())) {
case Episode:
@ -749,10 +751,11 @@ public class RenamePanel extends JComponent {
new SetRenameAction(preset.getRenameAction(), preset.getRenameAction().getDisplayName(), ResourceManager.getIcon("rename.action." + preset.getRenameAction().toString().toLowerCase())).actionPerformed(evt);
}
try {
super.actionPerformed(evt);
} catch (Exception e) {
UILogger.info(e.getMessage());
} finally {
window.setCursor(Cursor.getDefaultCursor());
}
}
}