diff --git a/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java b/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java index e4c9e9f8..796ea479 100644 --- a/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java +++ b/source/net/sourceforge/filebot/ui/rename/EpisodeListMatcher.java @@ -39,6 +39,7 @@ import javax.swing.Action; import javax.swing.SwingUtilities; import net.sourceforge.filebot.Analytics; +import net.sourceforge.filebot.Settings; import net.sourceforge.filebot.similarity.CommonSequenceMatcher; import net.sourceforge.filebot.similarity.EpisodeMatcher; import net.sourceforge.filebot.similarity.Match; @@ -99,13 +100,22 @@ class EpisodeListMatcher implements AutoCompleteMatcher { selectDialog.getHeaderLabel().setText(String.format("Shows matching '%s':", query)); selectDialog.getCancelAction().putValue(Action.NAME, "Ignore"); - selectDialog.setMinimumSize(new Dimension(250, 150)); + + // restore original dialog size + Settings prefs = Settings.forPackage(EpisodeListMatcher.class); + int w = Integer.parseInt(prefs.get("dialog.select.w", "280")); + int h = Integer.parseInt(prefs.get("dialog.select.h", "300")); + selectDialog.setPreferredSize(new Dimension(w, h)); selectDialog.pack(); // show dialog selectDialog.setLocation(getOffsetLocation(selectDialog.getOwner())); selectDialog.setVisible(true); + // remember dialog size + prefs.put("dialog.select.w", Integer.toString(selectDialog.getWidth())); + prefs.put("dialog.select.h", Integer.toString(selectDialog.getHeight())); + // selected value or null if the dialog was canceled by the user return selectDialog.getSelectedValue(); } @@ -257,8 +267,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher { } - public List> matchEpisodeSet(final List files, Collection queries, SortOrder sortOrder, Locale locale, boolean autodetection, Map selectionMemory, - Map> inputMemory, Component parent) throws Exception { + public List> matchEpisodeSet(final List files, Collection queries, SortOrder sortOrder, Locale locale, boolean autodetection, Map selectionMemory, Map> inputMemory, Component parent) throws Exception { Set episodes = emptySet(); // detect series name and fetch episode list diff --git a/source/net/sourceforge/filebot/ui/rename/MovieHashMatcher.java b/source/net/sourceforge/filebot/ui/rename/MovieHashMatcher.java index 053fdeee..49243a6d 100644 --- a/source/net/sourceforge/filebot/ui/rename/MovieHashMatcher.java +++ b/source/net/sourceforge/filebot/ui/rename/MovieHashMatcher.java @@ -46,6 +46,7 @@ import javax.swing.SwingUtilities; import net.sourceforge.filebot.Analytics; import net.sourceforge.filebot.ResourceManager; +import net.sourceforge.filebot.Settings; import net.sourceforge.filebot.similarity.Match; import net.sourceforge.filebot.similarity.NameSimilarityMetric; import net.sourceforge.filebot.similarity.SimilarityMetric; @@ -98,7 +99,7 @@ class MovieHashMatcher implements AutoCompleteMatcher { // match movie hashes online final Map movieByFile = new TreeMap(); - if (movieFiles.size() > 0) { + if (autodetect && movieFiles.size() > 0) { try { Map hashLookup = service.getMovieDescriptors(movieFiles, locale); movieByFile.putAll(hashLookup); @@ -328,8 +329,6 @@ class MovieHashMatcher implements AutoCompleteMatcher { selectDialog.setTitle(folderQuery.isEmpty() ? fileQuery : String.format("%s / %s", folderQuery, fileQuery)); selectDialog.getHeaderLabel().setText(String.format("Movies matching '%s':", fileQuery.length() >= 2 || folderQuery.length() <= 2 ? fileQuery : folderQuery)); selectDialog.getCancelAction().putValue(Action.NAME, "Ignore"); - selectDialog.setMinimumSize(new Dimension(280, 300)); - selectDialog.pack(); // add repeat button JCheckBox checkBox = new JCheckBox(); @@ -340,10 +339,21 @@ class MovieHashMatcher implements AutoCompleteMatcher { JComponent c = (JComponent) selectDialog.getContentPane(); c.add(checkBox, "pos 1al select.y n select.y2"); + // restore original dialog size + Settings prefs = Settings.forPackage(MovieHashMatcher.class); + int w = Integer.parseInt(prefs.get("dialog.select.w", "280")); + int h = Integer.parseInt(prefs.get("dialog.select.h", "300")); + selectDialog.setPreferredSize(new Dimension(w, h)); + selectDialog.pack(); + // show dialog selectDialog.setLocation(getOffsetLocation(selectDialog.getOwner())); selectDialog.setVisible(true); + // remember dialog size + prefs.put("dialog.select.w", Integer.toString(selectDialog.getWidth())); + prefs.put("dialog.select.h", Integer.toString(selectDialog.getHeight())); + // remember if we should auto-repeat the chosen action in the future if (checkBox.isSelected()) { memory.put("repeat", selectDialog.getSelectedValue() != null ? "select" : "ignore");