From e2e4ee240e4535b84b6bc780d0b5b16481c87b81 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 13 Nov 2013 01:44:07 +0000 Subject: [PATCH] * make Match button "Smart" again so it'll suggest fetching data if names is list empty... i guess people have been doing it wrong too long to change that now... --- .../sourceforge/filebot/ui/rename/MatchAction.java | 6 +++++- .../sourceforge/filebot/ui/rename/RenamePanel.java | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/ui/rename/MatchAction.java b/source/net/sourceforge/filebot/ui/rename/MatchAction.java index e7094158..ba303d5e 100644 --- a/source/net/sourceforge/filebot/ui/rename/MatchAction.java +++ b/source/net/sourceforge/filebot/ui/rename/MatchAction.java @@ -40,11 +40,15 @@ class MatchAction extends AbstractAction { } public void actionPerformed(ActionEvent evt) { - if (model.names().isEmpty() || model.files().isEmpty()) { + if (model.files().isEmpty()) { UILogger.info("Nothing to match. Please add some files and fetch data first."); return; } + if (model.names().isEmpty()) { + return; + } + BackgroundMatcher backgroundMatcher = new BackgroundMatcher(model, EpisodeMetrics.defaultSequence(true)); backgroundMatcher.execute(); diff --git a/source/net/sourceforge/filebot/ui/rename/RenamePanel.java b/source/net/sourceforge/filebot/ui/rename/RenamePanel.java index af2c8db3..f5b2203f 100644 --- a/source/net/sourceforge/filebot/ui/rename/RenamePanel.java +++ b/source/net/sourceforge/filebot/ui/rename/RenamePanel.java @@ -12,6 +12,7 @@ import java.awt.Cursor; import java.awt.Desktop; import java.awt.Insets; import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.beans.PropertyChangeEvent; @@ -204,6 +205,17 @@ public class RenamePanel extends JComponent { filesList.getButtonPanel().add(createImageButton(clearFilesAction), "gap 0"); filesList.getButtonPanel().add(createImageButton(openHistoryAction), "gap indent"); + matchButton.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + // show popup on actionPerformed only when names list is empty + if (renameModel.files().size() > 0 && renameModel.names().isEmpty()) { + fetchPopupAction.actionPerformed(e); + } + } + }); + // reveal file location on double click filesList.getListComponent().addMouseListener(new MouseAdapter() {