mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 16:28:51 -05:00
* indicate Opportunistic / Strict Match Mode via Match Button Icon Color
This commit is contained in:
parent
bd45c798d4
commit
f438d91bb6
BIN
source/net/filebot/resources/action.match.strict.png
Normal file
BIN
source/net/filebot/resources/action.match.strict.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
@ -33,9 +33,14 @@ class MatchAction extends AbstractAction {
|
||||
public MatchAction(RenameModel model) {
|
||||
this.model = model;
|
||||
|
||||
// initialize with default values
|
||||
setMatchMode(false);
|
||||
}
|
||||
|
||||
public void setMatchMode(boolean strict) {
|
||||
putValue(NAME, "Match");
|
||||
putValue(SMALL_ICON, ResourceManager.getIcon("action.match"));
|
||||
putValue(SHORT_DESCRIPTION, "Match files and names");
|
||||
putValue(SMALL_ICON, ResourceManager.getIcon(strict ? "action.match.strict" : "action.match"));
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
|
@ -108,6 +108,9 @@ public class RenamePanel extends JComponent {
|
||||
filesList.setTitle("Original Files");
|
||||
filesList.setTransferablePolicy(new FilesListTransferablePolicy(renameModel.files()));
|
||||
|
||||
// restore icon indicating current match mode
|
||||
matchAction.setMatchMode(isMatchModeStrict());
|
||||
|
||||
try {
|
||||
// restore custom episode formatter
|
||||
renameModel.useFormatter(Episode.class, new ExpressionFormatter(persistentEpisodeFormat.getValue(), EpisodeFormat.SeasonEpisode, Episode.class));
|
||||
@ -354,6 +357,10 @@ public class RenamePanel extends JComponent {
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isMatchModeStrict() {
|
||||
return "strict".equalsIgnoreCase(persistentPreferredMatchMode.getValue());
|
||||
}
|
||||
|
||||
protected ActionPopup createFetchPopup() {
|
||||
final ActionPopup actionPopup = new ActionPopup("Series / Movie Data", ResourceManager.getIcon("action.fetch"));
|
||||
|
||||
@ -452,6 +459,9 @@ public class RenamePanel extends JComponent {
|
||||
persistentPreferredMatchMode.setValue((String) modeCombo.getSelectedItem());
|
||||
persistentPreferredLanguage.setValue(((Language) languageList.getSelectedValue()).getCode());
|
||||
persistentPreferredEpisodeOrder.setValue(((SortOrder) orderCombo.getSelectedItem()).name());
|
||||
|
||||
// update UI
|
||||
matchAction.setMatchMode(isMatchModeStrict());
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -645,7 +655,7 @@ public class RenamePanel extends JComponent {
|
||||
renameModel.values().clear();
|
||||
|
||||
final List<File> remainingFiles = new LinkedList<File>(renameModel.files());
|
||||
final boolean strict = "strict".equalsIgnoreCase(persistentPreferredMatchMode.getValue());
|
||||
final boolean strict = isMatchModeStrict();
|
||||
final SortOrder order = SortOrder.forName(persistentPreferredEpisodeOrder.getValue());
|
||||
final Locale locale = new Locale(persistentPreferredLanguage.getValue());
|
||||
final boolean autodetection = !isShiftOrAltDown(evt); // skip name auto-detection if SHIFT is pressed
|
||||
|
Loading…
Reference in New Issue
Block a user