multiple file type association
This commit is contained in:
parent
ed3ca4cceb
commit
2035ca4fa5
@ -1377,10 +1377,16 @@ public class FilePanelTab extends JPanel {
|
|||||||
|
|
||||||
String command = null;
|
String command = null;
|
||||||
for (cz.kamma.kfmanager.config.AppConfig.OpenWithEntry entry : owEntries) {
|
for (cz.kamma.kfmanager.config.AppConfig.OpenWithEntry entry : owEntries) {
|
||||||
if (entry.type != null && entry.type.equalsIgnoreCase(ext)) {
|
if (entry.type != null) {
|
||||||
command = entry.command;
|
String[] types = entry.type.split("[,;]");
|
||||||
break; // Use the first matching entry
|
for (String t : types) {
|
||||||
|
if (t.trim().equalsIgnoreCase(ext)) {
|
||||||
|
command = entry.command;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (command != null) break; // Use the first matching entry
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command != null && !command.trim().isEmpty()) {
|
if (command != null && !command.trim().isEmpty()) {
|
||||||
@ -1570,8 +1576,14 @@ public class FilePanelTab extends JPanel {
|
|||||||
|
|
||||||
java.util.List<AppConfig.OpenWithEntry> filtered = new java.util.ArrayList<>();
|
java.util.List<AppConfig.OpenWithEntry> filtered = new java.util.ArrayList<>();
|
||||||
for (AppConfig.OpenWithEntry e : owEntries) {
|
for (AppConfig.OpenWithEntry e : owEntries) {
|
||||||
if (e.type != null && e.type.equalsIgnoreCase(itemType)) {
|
if (e.type != null) {
|
||||||
filtered.add(e);
|
String[] types = e.type.split("[,;]");
|
||||||
|
for (String t : types) {
|
||||||
|
if (t.trim().equalsIgnoreCase(itemType)) {
|
||||||
|
filtered.add(e);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -648,6 +648,7 @@ public class SettingsDialog extends JDialog {
|
|||||||
p.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
|
p.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
|
||||||
|
|
||||||
JLabel hint = new JLabel("<html>Use <b>directory</b> or <b>extension</b> (e.g. txt) for Type.<br>" +
|
JLabel hint = new JLabel("<html>Use <b>directory</b> or <b>extension</b> (e.g. txt) for Type.<br>" +
|
||||||
|
"Multiple extensions can be separated by <b>,</b> or <b>;</b> (e.g. mp4;mkv).<br>" +
|
||||||
"Use <b>%f</b> for full path, <b>%n</b> for filename. " +
|
"Use <b>%f</b> for full path, <b>%n</b> for filename. " +
|
||||||
"If no placeholder is used, path is appended to the end.</html>");
|
"If no placeholder is used, path is appended to the end.</html>");
|
||||||
p.add(hint, BorderLayout.NORTH);
|
p.add(hint, BorderLayout.NORTH);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user