* put error messages into tooltip and explain by hash / by name subtitle matching

This commit is contained in:
Reinhard Pointner 2013-10-03 12:52:04 +00:00
parent a6814d6b80
commit 0408a17ddb
1 changed files with 18 additions and 1 deletions

View File

@ -407,7 +407,14 @@ class SubtitleAutoMatchDialog extends JDialog {
SubtitleDescriptorBean subtitleBean = (SubtitleDescriptorBean) value;
setText(subtitleBean.getText());
setIcon(subtitleBean.getError() == null ? subtitleBean.getIcon() : ResourceManager.getIcon("status.warning"));
if (subtitleBean.getError() == null) {
setIcon(subtitleBean.getIcon());
setToolTipText(null);
} else {
setIcon(ResourceManager.getIcon("status.warning"));
setToolTipText(subtitleBean.getError().getMessage());
}
if (!isSelected) {
float f = subtitleBean.getMatchProbability();
@ -859,6 +866,11 @@ class SubtitleAutoMatchDialog extends JDialog {
this.service = service;
}
@Override
public String getName() {
return String.format("%s (by hash)", service.getName());
}
@Override
protected Map<File, List<SubtitleDescriptor>> getSubtitleList(Collection<File> files, String languageName, Component parent) throws Exception {
return service.getSubtitleList(files.toArray(new File[0]), languageName);
@ -881,6 +893,11 @@ class SubtitleAutoMatchDialog extends JDialog {
this.inputProvider = inputProvider;
}
@Override
public String getName() {
return String.format("%s (by name)", service.getName());
}
@Override
protected Map<File, List<SubtitleDescriptor>> getSubtitleList(Collection<File> files, String languageName, Component parent) throws Exception {
// ignore clutter files from processing