* add auto-completion to opensubtitles search box again (as to improve usability with people that didn't realize it was search box at that you were supposed to type a movie/series name there => now we suggest it as they type or click the combo box)

This commit is contained in:
Reinhard Pointner 2015-05-08 14:31:52 +00:00
parent 4ab1b1afc5
commit 6b03665d59
1 changed files with 12 additions and 2 deletions

View File

@ -16,9 +16,10 @@ import java.awt.geom.Path2D;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -39,12 +40,14 @@ import net.filebot.Language;
import net.filebot.ResourceManager;
import net.filebot.Settings;
import net.filebot.WebServices;
import net.filebot.media.MediaDetection;
import net.filebot.ui.AbstractSearchPanel;
import net.filebot.ui.LanguageComboBox;
import net.filebot.ui.SelectDialog;
import net.filebot.util.ui.LabelProvider;
import net.filebot.util.ui.LinkButton;
import net.filebot.util.ui.SimpleLabelProvider;
import net.filebot.web.Movie;
import net.filebot.web.OpenSubtitlesClient;
import net.filebot.web.SearchResult;
import net.filebot.web.SubtitleDescriptor;
@ -148,7 +151,14 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
};
protected Collection<String> getHistory(SubtitleProvider engine) throws Exception {
return Collections.emptyList();
final Set<String> names = new TreeSet<String>();
for (Movie it : MediaDetection.releaseInfo.getMovieList()) {
names.add(it.getName());
}
for (SearchResult it : MediaDetection.releaseInfo.getTheTVDBIndex()) {
names.add(it.getName());
}
return names;
};
@Override