multiple file type association
This commit is contained in:
parent
ed3ca4cceb
commit
2035ca4fa5
@ -1377,11 +1377,17 @@ public class FilePanelTab extends JPanel {
|
||||
|
||||
String command = null;
|
||||
for (cz.kamma.kfmanager.config.AppConfig.OpenWithEntry entry : owEntries) {
|
||||
if (entry.type != null && entry.type.equalsIgnoreCase(ext)) {
|
||||
if (entry.type != null) {
|
||||
String[] types = entry.type.split("[,;]");
|
||||
for (String t : types) {
|
||||
if (t.trim().equalsIgnoreCase(ext)) {
|
||||
command = entry.command;
|
||||
break; // Use the first matching entry
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (command != null) break; // Use the first matching entry
|
||||
}
|
||||
|
||||
if (command != null && !command.trim().isEmpty()) {
|
||||
runExternalCommand(command, file);
|
||||
@ -1570,8 +1576,14 @@ public class FilePanelTab extends JPanel {
|
||||
|
||||
java.util.List<AppConfig.OpenWithEntry> filtered = new java.util.ArrayList<>();
|
||||
for (AppConfig.OpenWithEntry e : owEntries) {
|
||||
if (e.type != null && e.type.equalsIgnoreCase(itemType)) {
|
||||
if (e.type != null) {
|
||||
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));
|
||||
|
||||
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. " +
|
||||
"If no placeholder is used, path is appended to the end.</html>");
|
||||
p.add(hint, BorderLayout.NORTH);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user