Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

feat(toolbar): move a donut profile up or down the list (#522)

KnifeLemon87725bbb178c
diff --git a/src/Filee.App/Assets/i18n/ar.json b/src/Filee.App/Assets/i18n/ar.json
index 2e478d2e..a59b4519 100644
--- a/src/Filee.App/Assets/i18n/ar.json
+++ b/src/Filee.App/Assets/i18n/ar.json
@@ -536,6 +536,9 @@
"toolbar.step_profile": "1. اختر ملف تعريف",
"toolbar.step_arrange": "2. رتّب الإعدادات المسبقة",
"toolbar.add_profile": "ملف تعريف جديد",
+ "toolbar.profile_up": "نقل ملف التعريف لأعلى",
+ "toolbar.profile_down": "نقل ملف التعريف لأسفل",
+ "toolbar.profile_order_hint": "إذا اشترك ملفا تعريف في امتداد واحد، فسيُفتح الأعلى منهما في القائمة. يَنقل ‎Alt+↑ / Alt+↓‎ ملف التعريف المحدد.",
"toolbar.profile_new": "ملف تعريف جديد",
"toolbar.delete_profile": "حذف ملف التعريف",
"toolbar.reset_profile": "استعادة الافتراضي",
@@ -581,7 +584,7 @@
"toolbar.ext_duplicate": "الامتداد {0} موجود في القائمة بالفعل.",
"toolbar.ext_also_in": "موجود أيضًا في «{0}»",
"toolbar.ext_in_profile": "في {0}",
- "toolbar.ext_claimed_first": "{0}: موجود أيضًا في «{1}»، وهو أسبق في القائمة، لذلك ما زالت هذه الملفات تفتح «{1}».",
+ "toolbar.ext_claimed_first": "{0}: موجود أيضًا في «{1}»، وهو أسبق في القائمة، لذلك ما زالت هذه الملفات تفتح «{1}». انقل ملف التعريف هذا فوق «{1}» لتُفتح هنا.",
"toolbar.ext_claimed_later": "{0}: موجود أيضًا في «{1}».\nملف التعريف هذا أسبق في القائمة، لذلك ستفتح هذه الملفات هذا الملف الآن.",
"toolbar.ext_unknown": "{0}: لا يعرف Filee نوع الملف هذا.\nيمكنك الاحتفاظ به، لكن لا يمكن تحويل هذه الملفات.",
"toolbar.ext_unknown_tip": "نوع ملف غير معروف",
diff --git a/src/Filee.App/Assets/i18n/de.json b/src/Filee.App/Assets/i18n/de.json
index bd6d4181..daefc0be 100644
--- a/src/Filee.App/Assets/i18n/de.json
+++ b/src/Filee.App/Assets/i18n/de.json
@@ -536,6 +536,9 @@
"toolbar.step_profile": "1. Profil auswählen",
"toolbar.step_arrange": "2. Vorlagen anordnen",
"toolbar.add_profile": "Neues Profil",
+ "toolbar.profile_up": "Profil nach oben",
+ "toolbar.profile_down": "Profil nach unten",
+ "toolbar.profile_order_hint": "Haben zwei Profile dieselbe Endung, öffnet das obere. Alt+↑ / Alt+↓ verschiebt das ausgewählte Profil.",
"toolbar.profile_new": "Neues Profil",
"toolbar.delete_profile": "Profil löschen",
"toolbar.reset_profile": "Auf Standard zurücksetzen",
@@ -581,7 +584,7 @@
"toolbar.ext_duplicate": "{0} steht bereits in der Liste.",
"toolbar.ext_also_in": "Auch in „{0}“",
"toolbar.ext_in_profile": "in {0}",
- "toolbar.ext_claimed_first": "{0}: auch in „{1}“. Dieses Profil steht weiter oben in der Liste, daher öffnen diese Dateien weiterhin „{1}“.",
+ "toolbar.ext_claimed_first": "{0}: auch in „{1}“. „{1}“ steht weiter oben in der Liste, daher öffnen diese Dateien weiterhin „{1}“. Schiebe dieses Profil darüber, damit sie hier geöffnet werden.",
"toolbar.ext_claimed_later": "{0}: auch in „{1}“.\nDieses Profil steht weiter oben in der Liste, daher öffnen diese Dateien jetzt dieses Profil.",
"toolbar.ext_unknown": "{0}: Filee kennt diesen Dateityp nicht.\nDu kannst ihn behalten, die Dateien lassen sich jedoch nicht konvertieren.",
"toolbar.ext_unknown_tip": "Unbekannter Dateityp",
diff --git a/src/Filee.App/Assets/i18n/en.json b/src/Filee.App/Assets/i18n/en.json
index f41855fa..039fbef4 100644
--- a/src/Filee.App/Assets/i18n/en.json
+++ b/src/Filee.App/Assets/i18n/en.json
@@ -550,6 +550,9 @@
"toolbar.step_profile": "1. Choose a profile",
"toolbar.step_arrange": "2. Arrange presets",
"toolbar.add_profile": "New profile",
+ "toolbar.profile_up": "Move profile up",
+ "toolbar.profile_down": "Move profile down",
+ "toolbar.profile_order_hint": "When two profiles share an extension, the higher one opens. Alt+↑ / Alt+↓ moves the selected profile.",
"toolbar.profile_new": "New profile",
"toolbar.delete_profile": "Delete profile",
"toolbar.reset_profile": "Reset to default",
@@ -595,7 +598,7 @@
"toolbar.ext_duplicate": "{0} is already in the list.",
"toolbar.ext_also_in": "Also in “{0}”",
"toolbar.ext_in_profile": "in {0}",
- "toolbar.ext_claimed_first": "{0}: also in “{1}”, which comes first in the list, so these files still open “{1}”.",
+ "toolbar.ext_claimed_first": "{0}: also in “{1}”, which comes first in the list, so these files still open “{1}”. Move this profile above “{1}” to open them here.",
"toolbar.ext_claimed_later": "{0}: also in “{1}”.\nThis profile comes first in the list, so these files now open this one instead.",
"toolbar.ext_unknown": "{0}: Filee doesn't know this file type.\nYou can keep it, but these files can't be converted.",
"toolbar.ext_unknown_tip": "Unknown file type",
diff --git a/src/Filee.App/Assets/i18n/es.json b/src/Filee.App/Assets/i18n/es.json
index 18f3d58d..5ed50a70 100644
--- a/src/Filee.App/Assets/i18n/es.json
+++ b/src/Filee.App/Assets/i18n/es.json
@@ -536,6 +536,9 @@
"toolbar.step_profile": "1. Elige un perfil",
"toolbar.step_arrange": "2. Coloca los ajustes preestablecidos",
"toolbar.add_profile": "Nuevo perfil",
+ "toolbar.profile_up": "Subir perfil",
+ "toolbar.profile_down": "Bajar perfil",
+ "toolbar.profile_order_hint": "Si dos perfiles comparten una extensión, se abre el que está más arriba. Alt+↑ / Alt+↓ mueve el perfil seleccionado.",
"toolbar.profile_new": "Nuevo perfil",
"toolbar.delete_profile": "Eliminar perfil",
"toolbar.reset_profile": "Restablecer perfil",
@@ -581,7 +584,7 @@
"toolbar.ext_duplicate": "{0} ya está en la lista.",
"toolbar.ext_also_in": "También en «{0}»",
"toolbar.ext_in_profile": "en {0}",
- "toolbar.ext_claimed_first": "{0}: también en «{1}», que va antes en la lista, así que estos archivos siguen abriendo «{1}».",
+ "toolbar.ext_claimed_first": "{0}: también en «{1}», que va antes en la lista, así que estos archivos siguen abriendo «{1}». Sube este perfil por encima de «{1}» para que se abran aquí.",
"toolbar.ext_claimed_later": "{0}: también en «{1}».\nEste perfil va antes en la lista, así que ahora estos archivos abren este en su lugar.",
"toolbar.ext_unknown": "{0}: Filee no conoce este tipo de archivo.\nPuedes conservarlo, pero estos archivos no se pueden convertir.",
"toolbar.ext_unknown_tip": "Tipo de archivo desconocido",
diff --git a/src/Filee.App/Assets/i18n/fr.json b/src/Filee.App/Assets/i18n/fr.json
index c5d243b5..a9049faf 100644
--- a/src/Filee.App/Assets/i18n/fr.json
+++ b/src/Filee.App/Assets/i18n/fr.json
@@ -550,6 +550,9 @@
"toolbar.step_profile": "1. Choisir un profil",
"toolbar.step_arrange": "2. Organiser les préréglages",
"toolbar.add_profile": "Nouveau profil",
+ "toolbar.profile_up": "Monter le profil",
+ "toolbar.profile_down": "Descendre le profil",
+ "toolbar.profile_order_hint": "Si deux profils partagent une extension, c'est celui placé le plus haut qui s'ouvre. Alt+↑ / Alt+↓ déplace le profil sélectionné.",
"toolbar.profile_new": "Nouveau profil",
"toolbar.delete_profile": "Supprimer le profil",
"toolbar.reset_profile": "Rétablir par défaut",
@@ -595,7 +598,7 @@
"toolbar.ext_duplicate": "{0} est déjà dans la liste.",
"toolbar.ext_also_in": "Aussi dans « {0} »",
"toolbar.ext_in_profile": "dans {0}",
- "toolbar.ext_claimed_first": "{0} : aussi dans « {1} », placé plus haut dans la liste ; ces fichiers ouvrent donc toujours « {1} ».",
+ "toolbar.ext_claimed_first": "{0} : aussi dans « {1} », placé plus haut dans la liste ; ces fichiers ouvrent donc toujours « {1} ». Placez ce profil au-dessus de « {1} » pour qu'ils s'ouvrent ici.",
"toolbar.ext_claimed_later": "{0} : aussi dans « {1} ».\nCe profil est placé plus haut dans la liste : ces fichiers l'ouvrent désormais à la place.",
"toolbar.ext_unknown": "{0} : Filee ne connaît pas ce type de fichier.\nVous pouvez le garder, mais ces fichiers ne pourront pas être convertis.",
"toolbar.ext_unknown_tip": "Type de fichier inconnu",
diff --git a/src/Filee.App/Assets/i18n/hi.json b/src/Filee.App/Assets/i18n/hi.json
index a3e798a5..725823a0 100644
--- a/src/Filee.App/Assets/i18n/hi.json
+++ b/src/Filee.App/Assets/i18n/hi.json
@@ -536,6 +536,9 @@
"toolbar.step_profile": "1. प्रोफ़ाइल चुनें",
"toolbar.step_arrange": "2. प्रीसेट व्यवस्थित करें",
"toolbar.add_profile": "नई प्रोफ़ाइल",
+ "toolbar.profile_up": "प्रोफ़ाइल ऊपर ले जाएँ",
+ "toolbar.profile_down": "प्रोफ़ाइल नीचे ले जाएँ",
+ "toolbar.profile_order_hint": "अगर दो प्रोफ़ाइलों में एक ही एक्सटेंशन है, तो सूची में ऊपर वाली खुलती है। Alt+↑ / Alt+↓ से चुनी गई प्रोफ़ाइल ऊपर-नीचे होती है।",
"toolbar.profile_new": "नई प्रोफ़ाइल",
"toolbar.delete_profile": "प्रोफ़ाइल हटाएँ",
"toolbar.reset_profile": "डिफ़ॉल्ट पर रीसेट करें",
@@ -581,7 +584,7 @@
"toolbar.ext_duplicate": "{0} पहले से सूची में है।",
"toolbar.ext_also_in": "“{0}” में भी है",
"toolbar.ext_in_profile": "{0} में",
- "toolbar.ext_claimed_first": "{0}: “{1}” में भी है, जो सूची में पहले आती है, इसलिए ये फ़ाइलें अब भी “{1}” खोलेंगी।",
+ "toolbar.ext_claimed_first": "{0}: “{1}” में भी है, जो सूची में पहले आती है, इसलिए ये फ़ाइलें अब भी “{1}” खोलेंगी। इन्हें यहाँ खोलने के लिए इस प्रोफ़ाइल को “{1}” से ऊपर ले जाएँ।",
"toolbar.ext_claimed_later": "{0}: “{1}” में भी है।\nयह प्रोफ़ाइल सूची में पहले आती है, इसलिए अब ये फ़ाइलें इसी को खोलेंगी।",
"toolbar.ext_unknown": "{0}: Filee इस फ़ाइल प्रकार को नहीं जानता।\nआप इसे रख सकते हैं, पर ये फ़ाइलें कन्वर्ट नहीं हो सकतीं।",
"toolbar.ext_unknown_tip": "अज्ञात फ़ाइल प्रकार",
diff --git a/src/Filee.App/Assets/i18n/ja.json b/src/Filee.App/Assets/i18n/ja.json
index b6960a36..e2759e2c 100644
--- a/src/Filee.App/Assets/i18n/ja.json
+++ b/src/Filee.App/Assets/i18n/ja.json
@@ -536,6 +536,9 @@
"toolbar.step_profile": "1. プロファイルを選択",
"toolbar.step_arrange": "2. プリセットを配置",
"toolbar.add_profile": "新しいプロファイル",
+ "toolbar.profile_up": "プロファイルを上へ移動",
+ "toolbar.profile_down": "プロファイルを下へ移動",
+ "toolbar.profile_order_hint": "同じ拡張子が複数のプロファイルにある場合は、一覧で上にあるものが使われます。Alt+↑ / Alt+↓ で選択中のプロファイルを移動できます。",
"toolbar.profile_new": "新しいプロファイル",
"toolbar.delete_profile": "プロファイルを削除",
"toolbar.reset_profile": "既定に戻す",
@@ -581,7 +584,7 @@
"toolbar.ext_duplicate": "{0}はすでに一覧にあります。",
"toolbar.ext_also_in": "「{0}」にも登録されています",
"toolbar.ext_in_profile": "{0}内",
- "toolbar.ext_claimed_first": "{0}:「{1}」にも登録されています。一覧ではそちらの方が先にあるため、この形式のファイルには引き続き「{1}」が使われます。",
+ "toolbar.ext_claimed_first": "{0}:「{1}」にも登録されています。一覧ではそちらの方が先にあるため、この形式のファイルには引き続き「{1}」が使われます。このプロファイルを「{1}」より上に移動すると、こちらが使われます。",
"toolbar.ext_claimed_later": "{0}:「{1}」にも登録されています。\nこのプロファイルの方が一覧で先にあるため、この形式のファイルにはこちらが使われます。",
"toolbar.ext_unknown": "{0}:Fileeはこのファイル形式を認識できません。\n登録はできますが、このファイルは変換できません。",
"toolbar.ext_unknown_tip": "不明なファイル形式",
diff --git a/src/Filee.App/Assets/i18n/ko.json b/src/Filee.App/Assets/i18n/ko.json
index 09604dda..8213328a 100644
--- a/src/Filee.App/Assets/i18n/ko.json
+++ b/src/Filee.App/Assets/i18n/ko.json
@@ -550,6 +550,9 @@
"toolbar.step_profile": "1. 프로필 선택",
"toolbar.step_arrange": "2. 프리셋 배치",
"toolbar.add_profile": "새 프로필",
+ "toolbar.profile_up": "프로필 위로",
+ "toolbar.profile_down": "프로필 아래로",
+ "toolbar.profile_order_hint": "두 프로필에 같은 확장자가 있으면 목록에서 위에 있는 프로필로 열려요. Alt+↑ / Alt+↓로 선택한 프로필을 옮길 수 있어요.",
"toolbar.profile_new": "새 프로필",
"toolbar.delete_profile": "프로필 삭제",
"toolbar.reset_profile": "기본값으로 초기화",
@@ -595,7 +598,7 @@
"toolbar.ext_duplicate": "{0}은(는) 이미 목록에 있어요.",
"toolbar.ext_also_in": "“{0}”에도 있음",
"toolbar.ext_in_profile": "{0}에 있음",
- "toolbar.ext_claimed_first": "{0}: “{1}”에도 있어요.\n목록에서 “{1}”이(가) 먼저라서 이 파일들은 계속 “{1}”로 열려요.",
+ "toolbar.ext_claimed_first": "{0}: “{1}”에도 있어요.\n목록에서 “{1}”이(가) 먼저라서 이 파일들은 계속 “{1}”로 열려요. 이 프로필을 “{1}”보다 위로 옮기면 여기서 열려요.",
"toolbar.ext_claimed_later": "{0}: “{1}”에도 있어요.\n목록에서 이 프로필이 먼저라서 이제 이 파일들은 이 프로필로 열려요.",
"toolbar.ext_unknown": "{0}: Filee가 모르는 파일 형식이에요.\n넣어 둘 수는 있지만 이 파일들은 변환할 수 없어요.",
"toolbar.ext_unknown_tip": "알 수 없는 파일 형식",
diff --git a/src/Filee.App/Assets/i18n/ne.json b/src/Filee.App/Assets/i18n/ne.json
index dade701b..47c19c8b 100644
--- a/src/Filee.App/Assets/i18n/ne.json
+++ b/src/Filee.App/Assets/i18n/ne.json
@@ -536,6 +536,9 @@
"toolbar.step_profile": "१. प्रोफाइल छनोट गर्नुहोस्",
"toolbar.step_arrange": "२. प्रिसेटहरू व्यवस्थित गर्नुहोस्",
"toolbar.add_profile": "नयाँ प्रोफाइल",
+ "toolbar.profile_up": "प्रोफाइल माथि सार्नुहोस्",
+ "toolbar.profile_down": "प्रोफाइल तल सार्नुहोस्",
+ "toolbar.profile_order_hint": "दुई प्रोफाइलमा एउटै एक्सटेन्सन भए सूचीमा माथि रहेको प्रोफाइल खुल्छ। Alt+↑ / Alt+↓ ले छानिएको प्रोफाइल सार्छ।",
"toolbar.profile_new": "नयाँ प्रोफाइल",
"toolbar.delete_profile": "प्रोफाइल हटाउनुहोस्",
"toolbar.reset_profile": "पूर्वनिर्धारितमा रिसेट गर्नुहोस्",
@@ -581,7 +584,7 @@
"toolbar.ext_duplicate": "{0} पहिले नै सूचीमा छ।",
"toolbar.ext_also_in": "“{0}” मा पनि छ",
"toolbar.ext_in_profile": "{0} मा",
- "toolbar.ext_claimed_first": "{0}: “{1}” मा पनि छ, जुन सूचीमा पहिले आउँछ, त्यसैले यी फाइलहरूले अझै “{1}” खोल्नेछन्।",
+ "toolbar.ext_claimed_first": "{0}: “{1}” मा पनि छ, जुन सूचीमा पहिले आउँछ, त्यसैले यी फाइलहरूले अझै “{1}” खोल्नेछन्। यी फाइलहरू यहीँ खोल्न यो प्रोफाइललाई “{1}” भन्दा माथि सार्नुहोस्।",
"toolbar.ext_claimed_later": "{0}: “{1}” मा पनि छ।\nयो प्रोफाइल सूचीमा पहिले आउँछ, त्यसैले यी फाइलहरूले अब यसको सट्टा यो प्रोफाइल खोल्नेछन्।",
"toolbar.ext_unknown": "{0}: Filee लाई यो फाइल प्रकार थाहा छैन।\nतपाईंले यसलाई राख्न सक्नुहुन्छ, तर यी फाइलहरू रूपान्तरण गर्न सकिँदैन।",
"toolbar.ext_unknown_tip": "अज्ञात फाइल प्रकार",
diff --git a/src/Filee.App/Assets/i18n/pl.json b/src/Filee.App/Assets/i18n/pl.json
index 0c7af06e..e4d72e60 100644
--- a/src/Filee.App/Assets/i18n/pl.json
+++ b/src/Filee.App/Assets/i18n/pl.json
@@ -550,6 +550,9 @@
"toolbar.step_profile": "1. Wybierz profil",
"toolbar.step_arrange": "2. Ułóż ustawienia",
"toolbar.add_profile": "Nowy profil",
+ "toolbar.profile_up": "Przesuń profil w górę",
+ "toolbar.profile_down": "Przesuń profil w dół",
+ "toolbar.profile_order_hint": "Gdy dwa profile mają to samo rozszerzenie, otwiera się ten wyżej na liście. Alt+↑ / Alt+↓ przesuwa zaznaczony profil.",
"toolbar.profile_new": "Nowy profil",
"toolbar.delete_profile": "Usuń profil",
"toolbar.reset_profile": "Przywróć domyślny",
@@ -595,7 +598,7 @@
"toolbar.ext_duplicate": "{0} jest już na liście.",
"toolbar.ext_also_in": "Także w „{0}”",
"toolbar.ext_in_profile": "w {0}",
- "toolbar.ext_claimed_first": "{0}: także w „{1}”, który jest wcześniej na liście, więc te pliki nadal otwierają „{1}”.",
+ "toolbar.ext_claimed_first": "{0}: także w „{1}”, który jest wcześniej na liście, więc te pliki nadal otwierają „{1}”. Przesuń ten profil nad „{1}”, aby otwierały się tutaj.",
"toolbar.ext_claimed_later": "{0}: także w „{1}”.\nTen profil jest wcześniej na liście, więc te pliki otwierają teraz ten profil.",
"toolbar.ext_unknown": "{0}: Filee nie zna tego typu pliku.\nMożesz go zostawić, ale tych plików nie da się przekonwertować.",
"toolbar.ext_unknown_tip": "Nieznany typ pliku",
diff --git a/src/Filee.App/Assets/i18n/pt-BR.json b/src/Filee.App/Assets/i18n/pt-BR.json
index 88d47fda..4613c715 100644
--- a/src/Filee.App/Assets/i18n/pt-BR.json
+++ b/src/Filee.App/Assets/i18n/pt-BR.json
@@ -550,6 +550,9 @@
"toolbar.step_profile": "1. Escolha um perfil",
"toolbar.step_arrange": "2. Organize as predefinições",
"toolbar.add_profile": "Novo perfil",
+ "toolbar.profile_up": "Mover perfil para cima",
+ "toolbar.profile_down": "Mover perfil para baixo",
+ "toolbar.profile_order_hint": "Quando dois perfis têm a mesma extensão, abre o que está mais acima. Alt+↑ / Alt+↓ move o perfil selecionado.",
"toolbar.profile_new": "Novo perfil",
"toolbar.delete_profile": "Excluir perfil",
"toolbar.reset_profile": "Restaurar padrão",
@@ -595,7 +598,7 @@
"toolbar.ext_duplicate": "{0} já está na lista.",
"toolbar.ext_also_in": "Também em “{0}”",
"toolbar.ext_in_profile": "em {0}",
- "toolbar.ext_claimed_first": "{0}: também em “{1}”, que vem primeiro na lista, então estes arquivos ainda abrem “{1}”.",
+ "toolbar.ext_claimed_first": "{0}: também em “{1}”, que vem primeiro na lista, então estes arquivos ainda abrem “{1}”. Mova este perfil para cima de “{1}” para abri-los aqui.",
"toolbar.ext_claimed_later": "{0}: também em “{1}”.\nEste perfil vem primeiro na lista, então estes arquivos agora abrem este.",
"toolbar.ext_unknown": "{0}: o Filee não conhece este tipo de arquivo.\nVocê pode manter, mas estes arquivos não podem ser convertidos.",
"toolbar.ext_unknown_tip": "Tipo de arquivo desconhecido",
diff --git a/src/Filee.App/Assets/i18n/pt-PT.json b/src/Filee.App/Assets/i18n/pt-PT.json
index f89ce25c..6b1e6e36 100644
--- a/src/Filee.App/Assets/i18n/pt-PT.json
+++ b/src/Filee.App/Assets/i18n/pt-PT.json
@@ -550,6 +550,9 @@
"toolbar.step_profile": "1. Escolhe um perfil",
"toolbar.step_arrange": "2. Organiza as predefinições",
"toolbar.add_profile": "Novo perfil",
+ "toolbar.profile_up": "Mover perfil para cima",
+ "toolbar.profile_down": "Mover perfil para baixo",
+ "toolbar.profile_order_hint": "Quando dois perfis têm a mesma extensão, abre o que está mais acima. Alt+↑ / Alt+↓ move o perfil selecionado.",
"toolbar.profile_new": "Novo perfil",
"toolbar.delete_profile": "Eliminar perfil",
"toolbar.reset_profile": "Repor valores de origem",
@@ -595,7 +598,7 @@
"toolbar.ext_duplicate": "{0} já está na lista.",
"toolbar.ext_also_in": "Também em «{0}»",
"toolbar.ext_in_profile": "em {0}",
- "toolbar.ext_claimed_first": "{0}: também em «{1}», que aparece primeiro na lista. Estes ficheiros continuam, por isso, a abrir «{1}».",
+ "toolbar.ext_claimed_first": "{0}: também em «{1}», que aparece primeiro na lista. Estes ficheiros continuam, por isso, a abrir «{1}». Move este perfil para cima de «{1}» para os abrir aqui.",
"toolbar.ext_claimed_later": "{0}: também em «{1}».\nEste perfil aparece primeiro na lista, pelo que estes ficheiros passam a abri-lo.",
"toolbar.ext_unknown": "{0}: o Filee não conhece este tipo de ficheiro.\nPodes mantê-lo, mas estes ficheiros não podem ser convertidos.",
"toolbar.ext_unknown_tip": "Tipo de ficheiro desconhecido",
diff --git a/src/Filee.App/Assets/i18n/ru.json b/src/Filee.App/Assets/i18n/ru.json
index 47f36cb2..83f6bd04 100644
--- a/src/Filee.App/Assets/i18n/ru.json
+++ b/src/Filee.App/Assets/i18n/ru.json
@@ -550,6 +550,9 @@
"toolbar.step_profile": "1. Выберите профиль",
"toolbar.step_arrange": "2. Расставьте пресеты",
"toolbar.add_profile": "Новый профиль",
+ "toolbar.profile_up": "Переместить профиль выше",
+ "toolbar.profile_down": "Переместить профиль ниже",
+ "toolbar.profile_order_hint": "Если у двух профилей есть одно и то же расширение, открывается тот, что выше. Alt+↑ / Alt+↓ перемещает выбранный профиль.",
"toolbar.profile_new": "Новый профиль",
"toolbar.delete_profile": "Удалить профиль",
"toolbar.reset_profile": "Сбросить",
@@ -595,7 +598,7 @@
"toolbar.ext_duplicate": "{0} уже есть в списке.",
"toolbar.ext_also_in": "Также в «{0}»",
"toolbar.ext_in_profile": "в {0}",
- "toolbar.ext_claimed_first": "{0}: также в «{1}», а он выше в списке, поэтому такие файлы по-прежнему открывают «{1}».",
+ "toolbar.ext_claimed_first": "{0}: также в «{1}», а он выше в списке, поэтому такие файлы по-прежнему открывают «{1}». Переместите этот профиль выше «{1}», чтобы они открывались здесь.",
"toolbar.ext_claimed_later": "{0}: также в «{1}».\nЭтот профиль выше в списке, поэтому такие файлы теперь открывают его.",
"toolbar.ext_unknown": "{0}: Filee не знает такой тип файлов.\nЕго можно оставить, но такие файлы не сконвертируются.",
"toolbar.ext_unknown_tip": "Неизвестный тип файлов",
diff --git a/src/Filee.App/Assets/i18n/th.json b/src/Filee.App/Assets/i18n/th.json
index ff9466b6..e4088b3c 100644
--- a/src/Filee.App/Assets/i18n/th.json
+++ b/src/Filee.App/Assets/i18n/th.json
@@ -536,6 +536,9 @@
"toolbar.step_profile": "1. เลือกโปรไฟล์",
"toolbar.step_arrange": "2. จัดเรียงพรีเซ็ต",
"toolbar.add_profile": "โปรไฟล์ใหม่",
+ "toolbar.profile_up": "เลื่อนโปรไฟล์ขึ้น",
+ "toolbar.profile_down": "เลื่อนโปรไฟล์ลง",
+ "toolbar.profile_order_hint": "ถ้าสองโปรไฟล์มีนามสกุลไฟล์เดียวกัน จะเปิดด้วยโปรไฟล์ที่อยู่สูงกว่า กด Alt+↑ / Alt+↓ เพื่อเลื่อนโปรไฟล์ที่เลือก",
"toolbar.profile_new": "โปรไฟล์ใหม่",
"toolbar.delete_profile": "ลบโปรไฟล์",
"toolbar.reset_profile": "รีเซ็ตเป็นค่าเริ่มต้น",
@@ -581,7 +584,7 @@
"toolbar.ext_duplicate": "{0} มีอยู่ในรายการแล้ว",
"toolbar.ext_also_in": "อยู่ใน “{0}” ด้วย",
"toolbar.ext_in_profile": "ใน {0}",
- "toolbar.ext_claimed_first": "{0}: อยู่ใน “{1}” ด้วย ซึ่งอยู่ก่อนหน้าในรายการ ดังนั้นไฟล์เหล่านี้จะยังคงเปิดด้วย “{1}”",
+ "toolbar.ext_claimed_first": "{0}: อยู่ใน “{1}” ด้วย ซึ่งอยู่ก่อนหน้าในรายการ ดังนั้นไฟล์เหล่านี้จะยังคงเปิดด้วย “{1}” เลื่อนโปรไฟล์นี้ขึ้นไปไว้เหนือ “{1}” เพื่อให้เปิดด้วยโปรไฟล์นี้",
"toolbar.ext_claimed_later": "{0}: อยู่ใน “{1}” ด้วย\nโปรไฟล์นี้อยู่ก่อนหน้าในรายการ ดังนั้นไฟล์เหล่านี้จะเปิดด้วยโปรไฟล์นี้แทน",
"toolbar.ext_unknown": "{0}: Filee ไม่รู้จักประเภทไฟล์นี้\nคุณสามารถเก็บไว้ได้ แต่ไฟล์เหล่านี้จะไม่สามารถแปลงได้",
"toolbar.ext_unknown_tip": "ไม่รู้จักประเภทไฟล์นี้",
diff --git a/src/Filee.App/Assets/i18n/tr.json b/src/Filee.App/Assets/i18n/tr.json
index ad1043c9..8a967138 100644
--- a/src/Filee.App/Assets/i18n/tr.json
+++ b/src/Filee.App/Assets/i18n/tr.json
@@ -536,6 +536,9 @@
"toolbar.step_profile": "1. Profil seçin",
"toolbar.step_arrange": "2. Ön ayarları düzenleyin",
"toolbar.add_profile": "Yeni profil",
+ "toolbar.profile_up": "Profili yukarı taşı",
+ "toolbar.profile_down": "Profili aşağı taşı",
+ "toolbar.profile_order_hint": "İki profil aynı uzantıya sahipse listede üstte olan açılır. Alt+↑ / Alt+↓ seçili profili taşır.",
"toolbar.profile_new": "Yeni profil",
"toolbar.delete_profile": "Profili sil",
"toolbar.reset_profile": "Varsayılana sıfırla",
@@ -581,7 +584,7 @@
"toolbar.ext_duplicate": "{0} zaten listede.",
"toolbar.ext_also_in": "“{0}” profilinde de var",
"toolbar.ext_in_profile": "{0} içinde",
- "toolbar.ext_claimed_first": "{0}: listede önce gelen “{1}” profilinde de var; bu dosyalar hâlâ “{1}” profilini açar.",
+ "toolbar.ext_claimed_first": "{0}: listede önce gelen “{1}” profilinde de var; bu dosyalar hâlâ “{1}” profilini açar. Burada açılmaları için bu profili “{1}” profilinin üstüne taşıyın.",
"toolbar.ext_claimed_later": "{0}: “{1}” profilinde de var.\nBu profil listede önce geldiği için dosyalar artık bunu açar.",
"toolbar.ext_unknown": "{0}: Filee bu dosya türünü tanımıyor.\nTutabilirsiniz ancak bu dosyalar dönüştürülemez.",
"toolbar.ext_unknown_tip": "Bilinmeyen dosya türü",
diff --git a/src/Filee.App/Assets/i18n/zh-CN.json b/src/Filee.App/Assets/i18n/zh-CN.json
index e0b384c6..78ef80a8 100644
--- a/src/Filee.App/Assets/i18n/zh-CN.json
+++ b/src/Filee.App/Assets/i18n/zh-CN.json
@@ -550,6 +550,9 @@
"toolbar.step_profile": "1. 选择配置",
"toolbar.step_arrange": "2. 排列预设",
"toolbar.add_profile": "新建配置",
+ "toolbar.profile_up": "上移配置",
+ "toolbar.profile_down": "下移配置",
+ "toolbar.profile_order_hint": "两个配置包含相同的扩展名时,打开列表中靠上的那个。按 Alt+↑ / Alt+↓ 可移动所选配置。",
"toolbar.profile_new": "新配置",
"toolbar.delete_profile": "删除配置",
"toolbar.reset_profile": "恢复默认",
@@ -595,7 +598,7 @@
"toolbar.ext_duplicate": "{0} 已在列表中。",
"toolbar.ext_also_in": "也在“{0}”中",
"toolbar.ext_in_profile": "在“{0}”中",
- "toolbar.ext_claimed_first": "{0}:也在“{1}”中。\n“{1}”在列表中靠前,所以这些文件仍会打开“{1}”。",
+ "toolbar.ext_claimed_first": "{0}:也在“{1}”中。\n“{1}”在列表中靠前,所以这些文件仍会打开“{1}”。把此配置移到“{1}”上方,这些文件就会用此配置打开。",
"toolbar.ext_claimed_later": "{0}:也在“{1}”中。\n此配置在列表中靠前,所以这些文件现在会改用此配置。",
"toolbar.ext_unknown": "{0}:Filee 不认识这种文件类型。\n可以保留,但这些文件无法转换。",
"toolbar.ext_unknown_tip": "未知文件类型",
diff --git a/src/Filee.App/Assets/i18n/zh-TW.json b/src/Filee.App/Assets/i18n/zh-TW.json
index ae6a3806..322a6791 100644
--- a/src/Filee.App/Assets/i18n/zh-TW.json
+++ b/src/Filee.App/Assets/i18n/zh-TW.json
@@ -550,6 +550,9 @@
"toolbar.step_profile": "1. 選擇設定檔",
"toolbar.step_arrange": "2. 排列預設",
"toolbar.add_profile": "新增設定檔",
+ "toolbar.profile_up": "上移設定檔",
+ "toolbar.profile_down": "下移設定檔",
+ "toolbar.profile_order_hint": "兩個設定檔包含相同的副檔名時,會開啟清單中較上方的那個。按 Alt+↑ / Alt+↓ 可移動所選設定檔。",
"toolbar.profile_new": "新設定檔",
"toolbar.delete_profile": "刪除設定檔",
"toolbar.reset_profile": "還原為初始設定",
@@ -595,7 +598,7 @@
"toolbar.ext_duplicate": "{0} 已在清單中。",
"toolbar.ext_also_in": "也在「{0}」中",
"toolbar.ext_in_profile": "在「{0}」中",
- "toolbar.ext_claimed_first": "{0}:也在「{1}」中。\n「{1}」在清單中排在前面,所以這些檔案仍會開啟「{1}」。",
+ "toolbar.ext_claimed_first": "{0}:也在「{1}」中。\n「{1}」在清單中排在前面,所以這些檔案仍會開啟「{1}」。把此設定檔移到「{1}」上方,這些檔案就會改用此設定檔開啟。",
"toolbar.ext_claimed_later": "{0}:也在「{1}」中。\n此設定檔在清單中排在前面,所以這些檔案現在會改用此設定檔。",
"toolbar.ext_unknown": "{0}:Filee 不認識這種檔案類型。\n可以保留,但這些檔案無法轉換。",
"toolbar.ext_unknown_tip": "未知檔案類型",
diff --git a/src/Filee.App/ViewModels/Pages/ToolbarPageViewModel.cs b/src/Filee.App/ViewModels/Pages/ToolbarPageViewModel.cs
index bdc6354f..f01f584c 100644
--- a/src/Filee.App/ViewModels/Pages/ToolbarPageViewModel.cs
+++ b/src/Filee.App/ViewModels/Pages/ToolbarPageViewModel.cs
@@ -3,7 +3,8 @@
// The drag gestures themselves live in the view (ToolbarPage.axaml.cs); this class only mutates the model.
// A profile is either normal (extension chips, ExtensionTagsViewModel) or for mixed selections (check list,
// MixedExtensionsViewModel). Normal profiles are kept before the mixed ones, so a new mixed profile never takes over
-// the catch-all role of the built-in "Mixed files" donut (see ProfileSelector).
+// the catch-all role of the built-in "Mixed files" donut (see ProfileSelector). Move up / Move down (Alt+↑ / Alt+↓)
+// reorder a profile among its own kind, which decides the profile that opens for a shared extension (#522).
using System.Collections.ObjectModel;
using System.Diagnostics;
@@ -235,7 +236,11 @@ public sealed partial class ToolbarPageViewModel : ObservableObject, IDisposable
[ObservableProperty] private PaletteTabItem? _selectedTab;
[ObservableProperty] private bool _showTabRow;
- partial void OnProfileSearchChanged(string value) => VisibleProfiles.Query = value;
+ partial void OnProfileSearchChanged(string value)
+ {
+ VisibleProfiles.Query = value;
+ NotifyMoveChanged();
+ }
partial void OnPaletteSearchChanged(string value)
{
_pendingTabRestore = null;
@@ -309,6 +314,7 @@ public sealed partial class ToolbarPageViewModel : ObservableObject, IDisposable
// The list box briefly drops its selection while the selected profile is moved (see Reposition).
if (_repositioning)
return;
+ NotifyMoveChanged();
_loading = true;
ProfileName = value is null ? "" : _loc.DisplayName(value.Profile);
_loading = false;
@@ -369,6 +375,54 @@ public sealed partial class ToolbarPageViewModel : ObservableObject, IDisposable
{
_repositioning = false;
}
+ NotifyMoveChanged();
+ }
+
+ /// <summary>The profile the selected one would pass going <paramref name="direction"/>, among those the search shows.</summary>
+ private ToolbarProfile? MoveNeighbor(int direction) =>
+ Profile is { } profile
+ ? ProfileOrder.Neighbor(_store.Profiles, profile, direction, p => VisibleProfiles.Any(v => v.Profile == p))
+ : null;
+
+ private bool CanMoveProfileUp() => MoveNeighbor(-1) is not null;
+ private bool CanMoveProfileDown() => MoveNeighbor(1) is not null;
+
+ /// <summary>
+ /// Moves the selected profile above the profile of its kind shown above it: the higher of two profiles with the
+ /// same extension opens for it (#522). With a search, it passes the one the list shows, not a hidden one.
+ /// </summary>
+ [RelayCommand(CanExecute = nameof(CanMoveProfileUp))]
+ private void MoveProfileUp() => MoveProfile(-1);
+
+ /// <summary>Moves the selected profile below the profile of its kind shown below it.</summary>
+ [RelayCommand(CanExecute = nameof(CanMoveProfileDown))]
+ private void MoveProfileDown() => MoveProfile(1);
+
+ private void MoveProfile(int direction)
+ {
+ if (SelectedProfile is not { } item
+ || ProfileOrder.Move(_store.Profiles, item.Profile, direction, p => VisibleProfiles.Any(v => v.Profile == p)) is not { } move)
+ return;
+ _repositioning = true;
+ try
+ {
+ Profiles.Move(move.From, move.To);
+ SelectedProfile = item;
+ }
+ finally
+ {
+ _repositioning = false;
+ }
+ SaveOwnLibrary();
+ // The remarks under the extensions say which profile comes first; that just changed.
+ RebuildProfileEditor();
+ NotifyMoveChanged();
+ }
+
+ private void NotifyMoveChanged()
+ {
+ MoveProfileUpCommand.NotifyCanExecuteChanged();
+ MoveProfileDownCommand.NotifyCanExecuteChanged();
}
/// <summary>Shows the chips or the check list for the selected profile.</summary>
@@ -523,6 +577,7 @@ public sealed partial class ToolbarPageViewModel : ObservableObject, IDisposable
var item = new ProfileItemViewModel(profile, _loc);
Profiles.Insert(index, item);
SelectedProfile = item;
+ NotifyMoveChanged();
}
[RelayCommand]
@@ -539,6 +594,7 @@ public sealed partial class ToolbarPageViewModel : ObservableObject, IDisposable
SaveOwnLibrary();
Profiles.Remove(SelectedProfile!);
SelectedProfile = Profiles.FirstOrDefault();
+ NotifyMoveChanged();
}
[RelayCommand]
@@ -580,6 +636,7 @@ public sealed partial class ToolbarPageViewModel : ObservableObject, IDisposable
foreach (var other in Profiles)
other.Refresh(_loc);
RebuildProfileEditor();
+ NotifyMoveChanged();
ForgetJudgements(item.Profile.Id);
Rebuild();
}
diff --git a/src/Filee.App/Views/Pages/ToolbarPage.axaml b/src/Filee.App/Views/Pages/ToolbarPage.axaml
index 61189913..c57d78ad 100644
--- a/src/Filee.App/Views/Pages/ToolbarPage.axaml
+++ b/src/Filee.App/Views/Pages/ToolbarPage.axaml
@@ -45,6 +45,14 @@
<Setter Property="BoxShadow" Value="0 6 18 0 #33000000" />
</Style>
+ <!-- Move up / Move down at the end of the list: a dimmed arrow, not a grey box, where the profile can't go further. -->
+ <Style Selector="StackPanel#ProfileOrderButtons > Button:disabled /template/ ContentPresenter#PART_ContentPresenter">
+ <Setter Property="Background" Value="Transparent" />
+ </Style>
+ <Style Selector="StackPanel#ProfileOrderButtons > Button:disabled">
+ <Setter Property="Opacity" Value="0.4" />
+ </Style>
+
<!-- Remarks under the extension editors -->
<Style Selector="PathIcon.note">
<Setter Property="Width" Value="13" />
@@ -245,7 +253,13 @@
<PathIcon Width="14" Height="14" Margin="10,0,0,0" Data="{StaticResource Icon.Search}" Foreground="{DynamicResource TextSecondaryBrush}" />
</TextBox.InnerLeftContent>
</TextBox>
- <ListBox Classes="soft" ItemsSource="{Binding VisibleProfiles}" SelectedItem="{Binding SelectedProfile}">
+ <!-- The order decides which profile opens for an extension two share (#522): Alt+↑ / Alt+↓ or the arrows below. -->
+ <ListBox x:Name="ProfileList" Classes="soft" ItemsSource="{Binding VisibleProfiles}" SelectedItem="{Binding SelectedProfile}"
+ AutomationProperties.Name="{DynamicResource toolbar.step_profile}">
+ <ListBox.KeyBindings>
+ <KeyBinding Gesture="Alt+Up" Command="{Binding MoveProfileUpCommand}" />
+ <KeyBinding Gesture="Alt+Down" Command="{Binding MoveProfileDownCommand}" />
+ </ListBox.KeyBindings>
<ListBox.ItemTemplate>
<DataTemplate x:DataType="vm:ProfileItemViewModel">
<DockPanel>
@@ -260,12 +274,24 @@
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
+ <!-- Under the list, at its end: a row of their own, so "New profile" keeps the column's whole width. -->
+ <StackPanel x:Name="ProfileOrderButtons" Orientation="Horizontal" HorizontalAlignment="Right" Spacing="2" Margin="0,-4,0,0">
+ <Button x:Name="MoveProfileUp" Classes="icon" Command="{Binding MoveProfileUpCommand}"
+ ToolTip.Tip="{DynamicResource toolbar.profile_up}" AutomationProperties.Name="{DynamicResource toolbar.profile_up}">
+ <PathIcon Width="14" Height="14" Data="{StaticResource Icon.ArrowUp}" />
+ </Button>
+ <Button x:Name="MoveProfileDown" Classes="icon" Command="{Binding MoveProfileDownCommand}"
+ ToolTip.Tip="{DynamicResource toolbar.profile_down}" AutomationProperties.Name="{DynamicResource toolbar.profile_down}">
+ <PathIcon Width="14" Height="14" Data="{StaticResource Icon.ArrowDown}" />
+ </Button>
+ </StackPanel>
<Button HorizontalAlignment="Stretch" Command="{Binding AddProfileCommand}">
<StackPanel Orientation="Horizontal" Spacing="6">
<PathIcon Width="12" Height="12" Data="{StaticResource Icon.Plus}" />
<TextBlock Text="{DynamicResource toolbar.add_profile}" />
</StackPanel>
</Button>
+ <TextBlock x:Name="ProfileOrderHint" Classes="caption" TextWrapping="Wrap" Text="{DynamicResource toolbar.profile_order_hint}" />
</StackPanel>
<!-- 2. Donut -->
diff --git a/src/Filee.Core/Profiles/ProfileOrder.cs b/src/Filee.Core/Profiles/ProfileOrder.cs
new file mode 100644
index 00000000..73f71cb5
--- /dev/null
+++ b/src/Filee.Core/Profiles/ProfileOrder.cs
@@ -0,0 +1,56 @@
+// Moving a donut profile up or down the list (#522). The list order is what ProfileSelector reads: of two normal
+// profiles with the same extension the higher one opens, and of the mixed ones the higher match (and catch-all) wins.
+// So a profile only trades places with one of its own kind; normal and mixed profiles never compete for a file.
+
+namespace Filee.Core.Profiles;
+
+public static class ProfileOrder
+{
+ /// <summary>
+ /// The profile <paramref name="profile"/> would pass: the nearest one of the same kind (normal or mixed) above it
+ /// (<paramref name="direction"/> -1) or below it (+1), among those <paramref name="shown"/> lets through (all when
+ /// null, e.g. the ones a search box shows). Null when there is none.
+ /// </summary>
+ public static ToolbarProfile? Neighbor(IReadOnlyList<ToolbarProfile> profiles, ToolbarProfile profile, int direction,
+ Func<ToolbarProfile, bool>? shown = null)
+ {
+ var index = IndexOf(profiles, profile);
+ if (index < 0 || direction == 0)
+ return null;
+ for (var i = index + Math.Sign(direction); i >= 0 && i < profiles.Count; i += Math.Sign(direction))
+ {
+ var other = profiles[i];
+ if (other.IsFallback == profile.IsFallback && (shown is null || shown(other)))
+ return other;
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// Moves <paramref name="profile"/> just past its <see cref="Neighbor"/>: above it when going up, below it when going
+ /// down. Profiles in between (hidden by <paramref name="shown"/>, or of the other kind) keep their order.
+ /// </summary>
+ /// <returns>The old and the new index, or null when there is nothing to pass.</returns>
+ public static (int From, int To)? Move(List<ToolbarProfile> profiles, ToolbarProfile profile, int direction,
+ Func<ToolbarProfile, bool>? shown = null)
+ {
+ if (Neighbor(profiles, profile, direction, shown) is not { } neighbor)
+ return null;
+ var from = IndexOf(profiles, profile);
+ // Removing the profile first shifts a neighbor below it up by one, which is the "just below it" slot.
+ var to = IndexOf(profiles, neighbor);
+ profiles.RemoveAt(from);
+ profiles.Insert(to, profile);
+ return (from, to);
+ }
+
+ private static int IndexOf(IReadOnlyList<ToolbarProfile> profiles, ToolbarProfile profile)
+ {
+ for (var i = 0; i < profiles.Count; i++)
+ {
+ if (ReferenceEquals(profiles[i], profile))
+ return i;
+ }
+ return -1;
+ }
+}
diff --git a/tests/Filee.App.Tests/RenderTests.cs b/tests/Filee.App.Tests/RenderTests.cs
index 5412324c..bbe3de5b 100644
--- a/tests/Filee.App.Tests/RenderTests.cs
+++ b/tests/Filee.App.Tests/RenderTests.cs
@@ -1709,6 +1709,61 @@ public class RenderTests
});
}
+ /// <summary>
+ /// #522: the profile list's Move up / Move down arrows beside "New profile", the hint under them, and the remark under
+ /// the chips before and after a new profile with .jpg moves above "Images".
+ /// </summary>
+ [AvaloniaTheory]
+ [InlineData("en", false)]
+ [InlineData("en", true)]
+ [InlineData("de", false)]
+ [InlineData("de", true)]
+ [InlineData("ar", false)]
+ [InlineData("ar", true)]
+ public void Toolbar_profile_order_renders(string language, bool dark)
+ {
+ var photos = new ToolbarProfile
+ {
+ Id = "render-photos",
+ Name = language == "de" ? "Fotos" : language == "ar" ? "صوري" : "Photos",
+ Extensions = ["jpg", "heic"],
+ PresetIds = ["to-jpg", "to-webp", "half-size", "to-pdf"],
+ };
+ WithProfiles(language, dark, 1240, profiles => profiles.Insert(profiles.FindIndex(p => p.IsFallback), photos), (window, vm) =>
+ {
+ var item = vm.Profiles.Single(p => p.Profile == photos);
+ vm.SelectedProfile = item;
+ Pump();
+ var up = window.GetVisualDescendants().OfType<Button>().Single(b => b.Name == "MoveProfileUp");
+ var down = window.GetVisualDescendants().OfType<Button>().Single(b => b.Name == "MoveProfileDown");
+ var hint = window.GetVisualDescendants().OfType<TextBlock>().Single(t => t.Name == "ProfileOrderHint");
+ Assert.True(up.IsEffectivelyEnabled);
+ Assert.False(down.IsEffectivelyEnabled); // the last normal profile
+ Assert.True(hint.IsEffectivelyVisible && hint.Bounds.Height > 0);
+ // The arrows sit between the list and "New profile", which keeps the column's width and shows its whole name.
+ var list = window.GetVisualDescendants().OfType<ListBox>().Single(l => l.Name == "ProfileList");
+ var add = window.GetVisualDescendants().OfType<Button>().Single(b => b.Command == vm.AddProfileCommand);
+ var name = add.GetVisualDescendants().OfType<TextBlock>().Single();
+ Assert.Equal(list.Bounds.Width, add.Bounds.Width, 0.5);
+ Assert.True(name.DesiredSize.Width <= add.Bounds.Width - 30, $"{name.DesiredSize.Width} in {add.Bounds.Width}");
+ Assert.True(Avalonia.VisualExtensions.TranslatePoint(up, default, list)!.Value.Y > list.Bounds.Height - 1);
+ Assert.True(Avalonia.VisualExtensions.TranslatePoint(add, default, up)!.Value.Y > up.Bounds.Height - 1);
+ Assert.Contains(vm.ExtensionTags!.Notes, n => n.IsWarning);
+ Save(window, $"toolbar-profile-order-before-{language}{(dark ? "-dark" : "")}.png");
+
+ vm.ProfileSearch = "jpg";
+ Pump();
+ vm.MoveProfileUpCommand.Execute(null);
+ vm.ProfileSearch = "";
+ Pump();
+ var store = AppHost.Get<UserDataStore>();
+ Assert.Equal(store.Profiles.FindIndex(p => p.Id == "images") - 1, store.Profiles.IndexOf(photos));
+ Assert.Same(item, vm.SelectedProfile);
+ Assert.True(down.IsEffectivelyEnabled);
+ Save(window, $"toolbar-profile-order-after-{language}{(dark ? "-dark" : "")}.png");
+ });
+ }
+
/// <summary>A second mixed-selection donut limited to images and PDF, two groups expanded.</summary>
[AvaloniaTheory]
[InlineData("en", false, "render-scans")]
diff --git a/tests/Filee.App.Tests/ToolbarEditorTests.cs b/tests/Filee.App.Tests/ToolbarEditorTests.cs
index 5ae44b9d..a0d97182 100644
--- a/tests/Filee.App.Tests/ToolbarEditorTests.cs
+++ b/tests/Filee.App.Tests/ToolbarEditorTests.cs
@@ -399,6 +399,132 @@ public class ToolbarPageTests
}
}
+ [AvaloniaFact]
+ public void Moving_a_profile_up_lets_it_open_a_shared_extension_and_is_saved()
+ {
+ TestServices.EnsureInitialized("en");
+ var store = AppHost.Get<UserDataStore>();
+ var profiles = store.Profiles.Select(p => p.Clone()).ToList();
+ try
+ {
+ using var vm = new ToolbarPageViewModel(store, AppHost.Get<Filee.Core.Localization.ILocalizer>(), AppHost.Get<WindowService>(),
+ AppHost.Get<PresetAvailability>(), AppHost.Get<ConverterCatalog>(), NullLogger<ToolbarPageViewModel>.Instance);
+ vm.AddProfileCommand.Execute(null);
+ var mine = vm.SelectedProfile!;
+ vm.ExtensionTags!.AddCommand.Execute("jpg");
+ Assert.StartsWith(".jpg: also in “Images”, which comes first in the list", Assert.Single(vm.ExtensionTags.Notes).Text);
+ Assert.Equal("images", ProfileSelector.Select(store.Profiles, ["a.jpg"])!.Id);
+ // The last normal profile: it can go up, not down among the mixed ones.
+ Assert.True(vm.MoveProfileUpCommand.CanExecute(null));
+ Assert.False(vm.MoveProfileDownCommand.CanExecute(null));
+
+ // #522: a search for the extension shows Images right above it, so one step up passes it.
+ vm.ProfileSearch = "jpg";
+ Assert.Equal(["images", mine.Profile.Id], vm.VisibleProfiles.Select(p => p.Profile.Id));
+ vm.MoveProfileUpCommand.Execute(null);
+
+ Assert.Same(mine, vm.SelectedProfile);
+ Assert.Equal([mine.Profile.Id, "images"], vm.VisibleProfiles.Select(p => p.Profile.Id));
+ Assert.Equal(store.Profiles.Select(p => p.Id), vm.Profiles.Select(p => p.Profile.Id));
+ Assert.Equal(store.Profiles.FindIndex(p => p.Id == "images") - 1, store.Profiles.IndexOf(mine.Profile));
+ Assert.Equal(mine.Profile.Id, ProfileSelector.Select(store.Profiles, ["a.jpg"])!.Id);
+ // The remark under the chips follows the new order.
+ Assert.StartsWith(".jpg: also in “Images”.\nThis profile comes first", Assert.Single(vm.ExtensionTags!.Notes).Text);
+ Assert.False(vm.MoveProfileUpCommand.CanExecute(null)); // nothing shown above it any more
+ Assert.True(vm.MoveProfileDownCommand.CanExecute(null));
+ vm.ProfileSearch = "";
+ Assert.Same(mine.Profile, store.Profiles[0]); // Images heads the built-in list
+ Assert.False(vm.MoveProfileUpCommand.CanExecute(null));
+
+ // Saved as the order of profiles.json, no schema change needed.
+ var reloaded = new UserDataStore(store.Directory);
+ reloaded.Load();
+ Assert.Equal(store.Profiles.Select(p => p.Id), reloaded.Profiles.Select(p => p.Id));
+
+ // Down again, one step at a time: Images opens .jpg once more.
+ vm.MoveProfileDownCommand.Execute(null);
+ Assert.Equal(store.Profiles.FindIndex(p => p.Id == "images") + 1, store.Profiles.IndexOf(mine.Profile));
+ Assert.Equal("images", ProfileSelector.Select(store.Profiles, ["a.jpg"])!.Id);
+
+ // A mixed profile moves among the mixed ones only.
+ vm.SelectedProfile = vm.Profiles.Single(p => p.Profile.Id == "mixed");
+ Assert.False(vm.MoveProfileUpCommand.CanExecute(null));
+ vm.SelectedProfile = vm.Profiles.Single(p => p.Profile.Id == "images");
+ vm.IsMixed = true; // now the last mixed profile
+ Assert.False(vm.MoveProfileDownCommand.CanExecute(null));
+ vm.MoveProfileUpCommand.Execute(null);
+ Assert.Equal("images", store.Profiles.First(p => p.IsFallback).Id);
+ Assert.Equal("mixed", ProfileSelector.CatchAll(store.Profiles)!.Id); // limited to images: not the catch-all
+ Assert.False(vm.MoveProfileUpCommand.CanExecute(null));
+ }
+ finally
+ {
+ store.Profiles.Clear();
+ store.Profiles.AddRange(profiles);
+ store.SaveLibrary();
+ }
+ }
+
+ [AvaloniaFact]
+ public void Profiles_move_with_the_arrow_buttons_and_alt_arrows_and_keep_focus()
+ {
+ TestServices.EnsureInitialized("en");
+ var store = AppHost.Get<UserDataStore>();
+ var profiles = store.Profiles.Select(p => p.Clone()).ToList();
+ Window? window = null;
+ try
+ {
+ using var vm = new ToolbarPageViewModel(store, AppHost.Get<Filee.Core.Localization.ILocalizer>(), AppHost.Get<WindowService>(),
+ AppHost.Get<PresetAvailability>(), AppHost.Get<ConverterCatalog>(), NullLogger<ToolbarPageViewModel>.Instance);
+ var page = new ToolbarPage { DataContext = vm };
+ window = new Window { Content = page, Width = 1100, Height = 900 };
+ window.Show();
+ vm.SelectedProfile = vm.Profiles[1];
+ Dispatcher.UIThread.RunJobs();
+
+ var up = page.GetVisualDescendants().OfType<Button>().Single(b => b.Name == "MoveProfileUp");
+ var down = page.GetVisualDescendants().OfType<Button>().Single(b => b.Name == "MoveProfileDown");
+ Assert.Equal("Move profile up", AutomationProperties.GetName(up));
+ Assert.Equal("Move profile up", ToolTip.GetTip(up));
+ Assert.Equal("Move profile down", AutomationProperties.GetName(down));
+ Assert.Same(vm.MoveProfileUpCommand, up.Command);
+ Assert.Same(vm.MoveProfileDownCommand, down.Command);
+
+ var second = vm.Profiles[1].Profile.Id;
+ up.Command!.Execute(null);
+ Dispatcher.UIThread.RunJobs();
+ Assert.Equal(second, store.Profiles[0].Id);
+ Assert.False(up.IsEffectivelyEnabled); // at the top
+
+ // From the list itself: Alt+↓ moves the selected profile, and the keyboard stays on it.
+ var list = page.GetVisualDescendants().OfType<ListBox>().Single(l => l.Name == "ProfileList");
+ Assert.Equal("1. Choose a profile", AutomationProperties.GetName(list));
+ ((ListBoxItem)list.ContainerFromIndex(0)!).Focus(NavigationMethod.Tab);
+ Dispatcher.UIThread.RunJobs();
+ window.KeyPress(Key.Down, RawInputModifiers.Alt, PhysicalKey.ArrowDown, null);
+ window.KeyRelease(Key.Down, RawInputModifiers.Alt, PhysicalKey.ArrowDown, null);
+ Dispatcher.UIThread.RunJobs();
+ Assert.Equal(second, store.Profiles[1].Id);
+ Assert.Equal(second, vm.SelectedProfile!.Profile.Id);
+ Assert.True(up.IsEffectivelyEnabled);
+ var focused = window.FocusManager!.GetFocusedElement() as Visual;
+ Assert.NotNull(focused);
+ Assert.True(focused == list || list.IsVisualAncestorOf(focused), $"focus on {focused}");
+
+ window.KeyPress(Key.Up, RawInputModifiers.Alt, PhysicalKey.ArrowUp, null);
+ window.KeyRelease(Key.Up, RawInputModifiers.Alt, PhysicalKey.ArrowUp, null);
+ Dispatcher.UIThread.RunJobs();
+ Assert.Equal(second, store.Profiles[0].Id);
+ }
+ finally
+ {
+ window?.Close();
+ store.Profiles.Clear();
+ store.Profiles.AddRange(profiles);
+ store.SaveLibrary();
+ }
+ }
+
[AvaloniaFact]
public void The_last_mixed_profile_stays_mixed()
{
diff --git a/tests/Filee.Core.Tests/ProfileOrderTests.cs b/tests/Filee.Core.Tests/ProfileOrderTests.cs
new file mode 100644
index 00000000..1ac939d7
--- /dev/null
+++ b/tests/Filee.Core.Tests/ProfileOrderTests.cs
@@ -0,0 +1,138 @@
+// Moving a donut profile up or down (#522): the list order decides which profile opens for a shared extension, a
+// profile only trades places with one of its own kind, and the order is what profiles.json keeps.
+
+using Filee.Core.Presets;
+using Filee.Core.Profiles;
+using Filee.Core.Settings;
+
+namespace Filee.Core.Tests;
+
+public class ProfileOrderTests
+{
+ private static ToolbarProfile Normal(string id, params string[] extensions) => new() { Id = id, Extensions = [.. extensions] };
+
+ private static ToolbarProfile Mixed(string id, params string[] extensions) =>
+ new() { Id = id, IsFallback = true, Extensions = [.. extensions] };
+
+ private static List<string> Ids(IEnumerable<ToolbarProfile> profiles) => profiles.Select(p => p.Id).ToList();
+
+ [Fact]
+ public void A_new_profile_moved_above_images_opens_for_jpg()
+ {
+ var profiles = BuiltInData.CreateProfiles();
+ var mine = Normal("mine", "jpg", "heic");
+ profiles.Insert(profiles.FindIndex(p => p.IsFallback), mine);
+ Assert.Equal("images", ProfileSelector.Select(profiles, ["a.jpg"])!.Id);
+
+ while (profiles.IndexOf(mine) > profiles.FindIndex(p => p.Id == "images"))
+ Assert.NotNull(ProfileOrder.Move(profiles, mine, -1));
+
+ Assert.Equal("mine", ProfileSelector.Select(profiles, ["a.jpg"])!.Id);
+ Assert.Equal("mine", ProfileSelector.Select(profiles, ["a.JPG", "b.heic"])!.Id);
+ Assert.Equal("images", ProfileSelector.Select(profiles, ["a.png"])!.Id); // what only Images has stays there
+
+ // And back down: Images wins again.
+ Assert.NotNull(ProfileOrder.Move(profiles, mine, 1));
+ Assert.Equal("images", ProfileSelector.Select(profiles, ["a.jpg"])!.Id);
+ }
+
+ [Fact]
+ public void Moving_passes_one_profile_and_reports_both_indexes()
+ {
+ List<ToolbarProfile> profiles = [Normal("a"), Normal("b"), Normal("c"), Mixed("mixed")];
+
+ Assert.Equal((2, 1), ProfileOrder.Move(profiles, profiles[2], -1));
+ Assert.Equal(["a", "c", "b", "mixed"], Ids(profiles));
+ Assert.Equal((0, 1), ProfileOrder.Move(profiles, profiles[0], 1));
+ Assert.Equal(["c", "a", "b", "mixed"], Ids(profiles));
+ }
+
+ [Fact]
+ public void A_profile_only_trades_places_with_its_own_kind()
+ {
+ List<ToolbarProfile> profiles = [Normal("images", "jpg"), Normal("mine", "jpg"), Mixed("mixed"), Mixed("scans", "jpg", "pdf")];
+
+ // The last normal profile can't go below the mixed ones, nor the first mixed one above the normal ones.
+ Assert.Null(ProfileOrder.Neighbor(profiles, profiles[1], 1));
+ Assert.Null(ProfileOrder.Move(profiles, profiles[1], 1));
+ Assert.Null(ProfileOrder.Move(profiles, profiles[2], -1));
+ Assert.Null(ProfileOrder.Move(profiles, profiles[0], -1));
+ Assert.Null(ProfileOrder.Move(profiles, profiles[3], 1));
+ Assert.Equal(["images", "mine", "mixed", "scans"], Ids(profiles));
+
+ // Among the mixed ones the order counts too: the first one with nothing checked is the catch-all.
+ Assert.Equal("mixed", ProfileSelector.CatchAll(profiles)!.Id);
+ profiles.Add(Mixed("second"));
+ Assert.NotNull(ProfileOrder.Move(profiles, profiles[4], -1));
+ Assert.NotNull(ProfileOrder.Move(profiles, profiles[3], -1));
+ Assert.Equal(["images", "mine", "second", "mixed", "scans"], Ids(profiles));
+ Assert.Equal("second", ProfileSelector.CatchAll(profiles)!.Id);
+ }
+
+ [Fact]
+ public void Profiles_of_the_other_kind_in_between_keep_their_place()
+ {
+ // An imported normal profile lands after the mixed ones: it still moves up past the normal one above it.
+ List<ToolbarProfile> profiles = [Normal("images", "jpg"), Mixed("mixed"), Normal("imported", "jpg")];
+
+ Assert.Same(profiles[0], ProfileOrder.Neighbor(profiles, profiles[2], -1));
+ Assert.Equal((2, 0), ProfileOrder.Move(profiles, profiles[2], -1));
+ Assert.Equal(["imported", "images", "mixed"], Ids(profiles));
+ Assert.Equal("imported", ProfileSelector.Select(profiles, ["a.jpg"])!.Id);
+ }
+
+ [Fact]
+ public void Profiles_a_search_hides_are_passed_over_and_keep_their_order()
+ {
+ List<ToolbarProfile> profiles = [Normal("images", "jpg"), Normal("pdf", "pdf"), Normal("video", "mp4"), Normal("mine", "jpg"), Mixed("mixed")];
+ bool ShowsJpg(ToolbarProfile p) => p.Matches("jpg");
+
+ // A search for "jpg" shows Images and mine: one step up puts mine right above Images.
+ Assert.Equal((3, 0), ProfileOrder.Move(profiles, profiles[3], -1, ShowsJpg));
+ Assert.Equal(["mine", "images", "pdf", "video", "mixed"], Ids(profiles));
+ Assert.Null(ProfileOrder.Move(profiles, profiles[0], -1, ShowsJpg));
+
+ // And one step down puts it right below Images again.
+ Assert.Equal((0, 1), ProfileOrder.Move(profiles, profiles[0], 1, ShowsJpg));
+ Assert.Equal(["images", "mine", "pdf", "video", "mixed"], Ids(profiles));
+ Assert.Null(ProfileOrder.Move(profiles, profiles[1], 1, ShowsJpg));
+ }
+
+ [Fact]
+ public void A_profile_not_in_the_list_or_no_direction_moves_nothing()
+ {
+ List<ToolbarProfile> profiles = [Normal("a"), Normal("b")];
+ Assert.Null(ProfileOrder.Move(profiles, Normal("elsewhere"), -1));
+ Assert.Null(ProfileOrder.Move(profiles, profiles[1], 0));
+ Assert.Equal(["a", "b"], Ids(profiles));
+ }
+
+ [Fact]
+ public void The_order_is_saved_and_reset_to_default_leaves_it_alone()
+ {
+ using var dir = new TempDir();
+ var store = new UserDataStore(dir.Path);
+ store.Load();
+ var mine = new ToolbarProfile { Id = "mine", Name = "Mine", Extensions = ["heic"], PresetIds = ["to-jpg"] };
+ store.Profiles.Insert(store.Profiles.FindIndex(p => p.IsFallback), mine);
+ while (store.Profiles[0] != mine)
+ ProfileOrder.Move(store.Profiles, mine, -1);
+ var images = store.Profiles.Single(p => p.Id == "images");
+ ProfileOrder.Move(store.Profiles, images, 1); // below "pdf"
+ store.SaveLibrary();
+ var order = Ids(store.Profiles);
+
+ var reloaded = new UserDataStore(dir.Path);
+ reloaded.Load();
+ Assert.Equal(order, Ids(reloaded.Profiles));
+ Assert.Equal(AppSettings.CurrentSchemaVersion, reloaded.Settings.SchemaVersion);
+
+ // "Reset to default" puts the donut's content back, not its place: the user chose that.
+ var reloadedImages = reloaded.Profiles.Single(p => p.Id == "images");
+ reloadedImages.Name = "Pictures";
+ Assert.True(reloaded.ResetProfile(reloadedImages));
+ Assert.Equal(order, Ids(reloaded.Profiles));
+ Assert.Equal("heic", Assert.Single(reloaded.Profiles[0].Extensions));
+ Assert.DoesNotContain("heic", reloadedImages.Extensions); // mine, above it, still has .heic
+ }
+}