* 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; SubtitleDescriptorBean subtitleBean = (SubtitleDescriptorBean) value;
setText(subtitleBean.getText()); 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) { if (!isSelected) {
float f = subtitleBean.getMatchProbability(); float f = subtitleBean.getMatchProbability();
@ -859,6 +866,11 @@ class SubtitleAutoMatchDialog extends JDialog {
this.service = service; this.service = service;
} }
@Override
public String getName() {
return String.format("%s (by hash)", service.getName());
}
@Override @Override
protected Map<File, List<SubtitleDescriptor>> getSubtitleList(Collection<File> files, String languageName, Component parent) throws Exception { protected Map<File, List<SubtitleDescriptor>> getSubtitleList(Collection<File> files, String languageName, Component parent) throws Exception {
return service.getSubtitleList(files.toArray(new File[0]), languageName); return service.getSubtitleList(files.toArray(new File[0]), languageName);
@ -881,6 +893,11 @@ class SubtitleAutoMatchDialog extends JDialog {
this.inputProvider = inputProvider; this.inputProvider = inputProvider;
} }
@Override
public String getName() {
return String.format("%s (by name)", service.getName());
}
@Override @Override
protected Map<File, List<SubtitleDescriptor>> getSubtitleList(Collection<File> files, String languageName, Component parent) throws Exception { protected Map<File, List<SubtitleDescriptor>> getSubtitleList(Collection<File> files, String languageName, Component parent) throws Exception {
// ignore clutter files from processing // ignore clutter files from processing