Preferences: Reset Preferences asks first

Part of #6435.

Reset Preferences in the Preferences dialog now opens a question over
the dialog (`resetPreferences`). Cancel or Escape goes back to
Preferences as it was, with its edits, category and search kept. OK goes
back with every preference at its default value; OK in Preferences
applies them and Cancel there discards them, as before. `prefs.reset`
still resets at once.

Docs: docs/mcp.md, docs/target-app-parity.md.
This commit is contained in:
dotCooCoo
2026-11-10 16:07:25 -08:00
parent 667237ab47
commit 4574ab047d
33 changed files with 201 additions and 6 deletions
+1
View File
@@ -322,6 +322,7 @@ registry! {
BrushDelete: [brush_delete::KIND] => brush_delete::SPEC,
Message: [confirm::MESSAGE] => confirm::MESSAGE_SPEC,
Replace: [confirm::REPLACE] => confirm::REPLACE_SPEC,
ResetPreferences: [confirm::RESET_PREFS] => confirm::RESET_PREFS_SPEC,
NewSwatch: [new_swatch::KIND] => new_swatch::SPEC,
NewColorGroup: [new_color_group::KIND] => new_color_group::SPEC,
GraphData: [graph_data::KIND] => graph_data::SPEC,
+25
View File
@@ -63,6 +63,31 @@ pub(crate) fn ask_replace(app: &mut VectorcraftApp, path: &str, typed: &str) {
app.ui.dialog = Some(Dialog::new(REPLACE, fields));
}
/// The dialog kind of the question Reset Preferences asks over the Preferences dialog
/// ([`ask_reset_prefs`]). Fields: `message`, `detail`.
pub const RESET_PREFS: &str = "resetPreferences";
pub(super) const RESET_PREFS_SPEC: DialogSpec = DialogSpec { confirm: reset_prefs, ..SPEC };
/// Ask whether to reset the preferences, over the Preferences dialog open now. Cancel and Escape
/// show Preferences again as it was; OK shows it again with every preference at its default value
/// ([`crate::prefs_dialog::reset_fields`]). Nothing is applied until OK in Preferences.
pub(crate) fn ask_reset_prefs(app: &mut VectorcraftApp) {
let under = app.ui.dialog.take().and_then(|d| serde_json::to_value(d).ok());
let message = tl!("Reset all preferences to their defaults?");
let detail = tl!("The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences.");
let fields = json!({"message": message, "detail": detail, super::PARENT: under});
app.ui.dialog = Some(Dialog::new(RESET_PREFS, fields));
}
/// OK on [`ask_reset_prefs`]: Preferences again, its fields at their defaults.
fn reset_prefs(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
let mut prefs = super::parent(d).filter(|p| p.kind == "preferences").ok_or("the dialog it was opened over is no longer open")?;
crate::prefs_dialog::reset_fields(&mut prefs);
app.ui.dialog = Some(prefs);
Ok(Value::Null)
}
/// Most messages kept for later while a dialog is open ([`tell`]).
const MAX_WAITING: usize = 16;
+2
View File
@@ -2766,6 +2766,8 @@ digits Malayalam Малаялам
Responsive Адаптивен
Restore Възстановяване
Restore every preference to its default (applied on OK) Възстановяване на всички настройки по подразбиране (прилага се при ОПК)
Reset all preferences to their defaults? Да се нулират ли всички настройки до стойностите по подразбиране?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Стойностите по подразбиране се прилагат, когато щракнете върху ОК в Настройки. Отказ там запазва текущите ви настройки.
Restore Recovered Documents Възстановяване на възстановените документи
Restored documents open unsaved: save them to keep them. Възстановените документи се отварят незаписани: запазете ги, за да ги съхраните.
Restrict printing, editing and other tasks Ограничаване на печата, редактирането и други задачи
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4091,6 +4091,8 @@ font-technology Variable Varijabilni
Preferences Postavke
Previous Prethodno
Restore every preference to its default (applied on OK) Vrati svaku postavku na zadanu vrijednost (primjenjuje se na U redu)
Reset all preferences to their defaults? Vratiti sve postavke na zadane vrijednosti?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Zadane vrijednosti primjenjuju se kada kliknete U redu u Postavkama. Otkaži tamo zadržava vaše trenutne postavke.
Smaller ↔ Larger Manje ↔ veće
Smart Guides (View → Smart Guides) Pametne vodilice (Prikaz → Pametne vodilice)
Couldn't save recovery data: {e} Nije moguće sačuvati podatke za oporavak: {e}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3511,6 +3511,8 @@ digits Malayalam Malaiàlam
Responsive Adaptatiu
Restore Restaura
Restore every preference to its default (applied on OK) Restaura cada preferència al seu valor predeterminat (s’aplica en prémer D’acord)
Reset all preferences to their defaults? Voleu restablir totes les preferències als valors predeterminats?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Els valors predeterminats s’apliquen quan feu clic a D’acord a Preferències. Cancel·la allà conserva les preferències actuals.
Restore Recovered Documents Restaura els documents recuperats
Restored documents open unsaved: save them to keep them. Els documents restaurats s’obren sense desar: desa’ls per conservar-los.
Restrict printing, editing and other tasks Restringeix la impressió, l’edició i altres tasques
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4143,6 +4143,8 @@ font-technology Variable Variabilní
Preferences Předvolby
Previous Předchozí
Restore every preference to its default (applied on OK) Obnovit všechny předvolby na výchozí hodnoty (použije se po OK)
Reset all preferences to their defaults? Obnovit všechny předvolby na výchozí hodnoty?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Výchozí hodnoty se použijí po klepnutí na OK v Předvolbách. Zrušit tam zachová vaše současné předvolby.
Smaller ↔ Larger Menší ↔ Větší
Smart Guides (View → Smart Guides) Chytrá vodítka (Zobrazení → Chytrá vodítka)
Couldn't save recovery data: {e} Data pro obnovení nelze uložit: {e}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3857,6 +3857,8 @@ font-technology Variable Variable
Preferences Præferencer
Previous Forrige
Restore every preference to its default (applied on OK) Gendan alle præferencer til standard (anvendes ved OK)
Reset all preferences to their defaults? Nulstil alle præferencer til standard?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Standardværdierne anvendes, når du klikker på OK i Præferencer. Annullér der beholder dine nuværende præferencer.
Smaller ↔ Larger Mindre ↔ Større
Smart Guides (View → Smart Guides) Smarte hjælpelinjer (Vis → Smarte hjælpelinjer)
Couldn't save recovery data: {e} Kunne ikke gemme gendannelsesdata: {e}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -2799,6 +2799,8 @@ digits Malayalam Malayalam
Responsive Responsiv
Restore Wiederherstellen
Restore every preference to its default (applied on OK) Alle Voreinstellungen auf ihre Standardwerte zurücksetzen (wird bei OK angewendet)
Reset all preferences to their defaults? Alle Voreinstellungen auf ihre Standardwerte zurücksetzen?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Die Standardwerte werden angewendet, wenn Sie in den Voreinstellungen auf OK klicken. Abbrechen dort behält Ihre aktuellen Voreinstellungen.
Restore Recovered Documents Wiederhergestellte Dokumente öffnen
Restored documents open unsaved: save them to keep them. Wiederhergestellte Dokumente werden ungespeichert geöffnet: Speichern Sie sie, um sie zu behalten.
Restrict printing, editing and other tasks Drucken, Bearbeiten und andere Aufgaben einschränken
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3421,6 +3421,8 @@ digits Malayalam Μαλαγιάλαμ
Reshape Type Area Αναδιαμόρφωση περιοχής κειμένου
Responsive Αποκρινόμενο
Restore every preference to its default (applied on OK) Επαναφορά όλων των προτιμήσεων στις προεπιλογές τους (εφαρμογή με το Εντάξει)
Reset all preferences to their defaults? Επαναφορά όλων των προτιμήσεων στις προεπιλογές τους;
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Οι προεπιλογές εφαρμόζονται όταν κάνετε κλικ στο Εντάξει στις Προτιμήσεις. Το Ακύρωση εκεί διατηρεί τις τρέχουσες προτιμήσεις σας.
Restore Recovered Documents Επαναφορά ανακτημένων εγγράφων
Restored documents open unsaved: save them to keep them. Τα ανακτημένα έγγραφα ανοίγουν χωρίς να είναι αποθηκευμένα: αποθηκεύστε τα για να τα διατηρήσετε.
Restrict printing, editing and other tasks Περιορισμός εκτύπωσης, επεξεργασίας και άλλων ενεργειών
Can't render this file because it is too large.
+2
View File
@@ -2841,6 +2841,8 @@ digits Malayalam Malayálam
Responsive Adaptable
Restore Restaurar
Restore every preference to its default (applied on OK) Restaurar todas las preferencias a sus valores predeterminados (se aplica al Aceptar)
Reset all preferences to their defaults? ¿Restablecer todas las preferencias a sus valores predeterminados?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Los valores predeterminados se aplican al hacer clic en Aceptar en Preferencias. Cancelar ahí conserva sus preferencias actuales.
Restore Recovered Documents Restaurar documentos recuperados
Restored documents open unsaved: save them to keep them. Los documentos restaurados se abren sin guardar: guárdalos para conservarlos.
Restrict printing, editing and other tasks Restringir la impresión, la edición y otras tareas
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4062,6 +4062,8 @@ font-technology Variable Muuttuvat
Preferences Asetukset
Previous Edellinen
Restore every preference to its default (applied on OK) Palauta kaikki asetukset oletuksiin (käytetään, kun valitaan OK)
Reset all preferences to their defaults? Palautetaanko kaikki asetukset oletuksiin?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Oletukset otetaan käyttöön, kun valitset Asetuksissa OK. Peruuta siellä säilyttää nykyiset asetuksesi.
Smaller ↔ Larger Pienempi ↔ Suurempi
Smart Guides (View → Smart Guides) Älykkäät apuviivat (Näytä → Älykkäät apuviivat)
Couldn't save recovery data: {e} Palautustietoja ei voitu tallentaa: {e}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -2833,6 +2833,8 @@ digits Malayalam Malayalam
Responsive Adaptatif
Restore Restaurer
Restore every preference to its default (applied on OK) Rétablir toutes les préférences à leur valeur par défaut (appliqué avec OK)
Reset all preferences to their defaults? Rétablir toutes les préférences à leur valeur par défaut ?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Les valeurs par défaut sont appliquées lorsque vous cliquez sur OK dans Préférences. Annuler y conserve vos préférences actuelles.
Restore Recovered Documents Restaurer les documents récupérés
Restored documents open unsaved: save them to keep them. Les documents restaurés s’ouvrent sans être enregistrés : enregistrez-les pour les conserver.
Restrict printing, editing and other tasks Restreindre l’impression, la modification et d’autres tâches
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3820,6 +3820,8 @@ antiAlias Sharp शार्प
Responsive उत्तरदायी
Restore पुनर्स्थापित करें
Restore every preference to its default (applied on OK) प्रत्येक वरीयता को उसके डिफ़ॉल्ट में पुनर्स्थापित करें ( OK पर लागू)
Reset all preferences to their defaults? सभी प्रेफ़रेंसेज़ को उनके डिफ़ॉल्ट पर रीसेट करें?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. डिफ़ॉल्ट तब लागू होते हैं जब आप प्रेफ़रेंसेज़ में ठीक है पर क्लिक करते हैं। वहाँ रद्द करें आपकी मौजूदा प्रेफ़रेंसेज़ बनाए रखता है।
Restore Recovered Documents पुनर्स्थापना डॉक्यूमेंट
Restored documents open unsaved: save them to keep them. रिकवर किए डॉक्यूमेंट बिना सेव किए ओपन होते हैं। रखने के लिए उन्हें सेव करें।
Restrict printing, editing and other tasks प्रिंटिंग, एडिटिंग और बाकी कामों पर पाबंदी लगाएँ
Can't render this file because it is too large.
+2
View File
@@ -3397,6 +3397,8 @@ mark-style Japanese Japán
Responsive Reszponzív
Restore Visszaállít
Restore every preference to its default (applied on OK) Minden beállítás visszaállítása az alapértékre (az OK gombbal lép életbe)
Reset all preferences to their defaults? Visszaállítja az összes beállítást az alapértékre?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Az alapértékek akkor lépnek életbe, amikor a Beállításokban az OK gombra kattint. Az ottani Mégse megtartja a jelenlegi beállításokat.
Restore Recovered Documents Helyreállított dokumentumok visszaállítása
Restored documents open unsaved: save them to keep them. A visszaállított dokumentumok mentetlenül nyílnak meg: mentsd őket, ha meg akarod tartani.
Restrict printing, editing and other tasks Nyomtatás, szerkesztés és más műveletek korlátozása
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3857,6 +3857,8 @@ font-technology Variable Variabel
Preferences Preferensi
Previous Sebelumnya
Restore every preference to its default (applied on OK) Kembalikan semua preferensi ke defaultnya (diterapkan saat OK)
Reset all preferences to their defaults? Atur ulang semua preferensi ke defaultnya?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Nilai default diterapkan saat Anda mengklik OK di Preferensi. Batal di sana mempertahankan preferensi Anda saat ini.
Smaller ↔ Larger Lebih kecil ↔ Lebih besar
Smart Guides (View → Smart Guides) Panduan pintar (Tampilan → Panduan pintar)
Couldn't save recovery data: {e} Tidak dapat menyimpan data pemulihan: {e}
Can't render this file because it contains an unexpected character in line 2315 and column 5.
+2
View File
@@ -2875,6 +2875,8 @@ digits Malayalam Malayalam
Responsive Adattivo
Restore Ripristina
Restore every preference to its default (applied on OK) Ripristina tutte le preferenze ai valori predefiniti (applicato con OK)
Reset all preferences to their defaults? Ripristinare tutte le preferenze ai valori predefiniti?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. I valori predefiniti vengono applicati quando fai clic su OK in Preferenze. Annulla lì mantiene le preferenze attuali.
Restore Recovered Documents Ripristina documenti recuperati
Restored documents open unsaved: save them to keep them. I documenti ripristinati si aprono senza essere salvati: salvali per conservarli.
Restrict printing, editing and other tasks Limita la stampa, la modifica e altre operazioni
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -2859,6 +2859,8 @@ mark-style Japanese 日本式
Restore 復元
Restore Recovered Documents 復帰したドキュメントを復元
Restore every preference to its default (applied on OK) すべての環境設定を初期値に戻す (OK で適用)
Reset all preferences to their defaults? すべての環境設定を初期値に戻しますか?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 初期値は環境設定で OK をクリックすると適用されます。そこでキャンセルすると現在の環境設定が保たれます。
Restored documents open unsaved: save them to keep them. 復元したドキュメントは未保存の状態で開きます。保存して残してください。
Restrict printing, editing and other tasks 印刷、編集などの操作を制限
Reverse Gradient グラデーションを反転
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3648,6 +3648,8 @@ font-technology Variable ცვლადი
Preferences პარამეტრები
Previous წინა
Restore every preference to its default (applied on OK) ყველა პარამეტრის ნაგულისხმევ მნიშვნელობაზე დაბრუნება (გამოიყენება OK-ზე დაჭერისას)
Reset all preferences to their defaults? დავაბრუნოთ ყველა პარამეტრი ნაგულისხმევ მნიშვნელობებზე?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. ნაგულისხმევი მნიშვნელობები გამოიყენება, როცა პარამეტრებში OK-ს დააჭერთ. იქ გაუქმება ინარჩუნებს თქვენს მიმდინარე პარამეტრებს.
Smaller ↔ Larger უფრო პატარა ↔ უფრო დიდი
Smart Guides (View → Smart Guides) ჭკვიანი დამხმარე ხაზები (ხედი → ჭკვიანი დამხმარე ხაზები)
Couldn't save recovery data: {e} აღდგენის მონაცემები ვერ შეინახა: {e}
Can't render this file because it is too large.
+2
View File
@@ -2848,6 +2848,8 @@ mark-style Japanese 일본식
Restore 복원
Restore Recovered Documents 복구된 문서 복원
Restore every preference to its default (applied on OK) 모든 환경 설정을 기본값으로 복원(확인 시 적용)
Reset all preferences to their defaults? 모든 환경 설정을 기본값으로 재설정하시겠습니까?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 기본값은 환경 설정에서 확인을 클릭하면 적용됩니다. 그곳에서 취소를 누르면 현재 환경 설정이 유지됩니다.
Restored documents open unsaved: save them to keep them. 복원된 문서는 저장되지 않은 상태로 열립니다. 보존하려면 저장하세요.
Restrict printing, editing and other tasks 인쇄, 편집 등의 작업 제한
Reverse Gradient 그레이디언트 반전
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3871,6 +3871,8 @@ font-technology Variable Variabel
Preferences Voorkeuren
Previous Vorige
Restore every preference to its default (applied on OK) Elke voorkeur terugzetten naar de standaard (toegepast bij OK)
Reset all preferences to their defaults? Alle voorkeuren terugzetten naar de standaardwaarden?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. De standaardwaarden worden toegepast wanneer u in Voorkeuren op OK klikt. Annuleren daar behoudt uw huidige voorkeuren.
Smaller ↔ Larger Kleiner ↔ Groter
Smart Guides (View → Smart Guides) Slimme hulplijnen (Beeld → Slimme hulplijnen)
Couldn't save recovery data: {e} Kon herstelgegevens niet opslaan: {e}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3983,6 +3983,8 @@ font-technology Variable Zmienne
Preferences Preferencje
Previous Wstecz
Restore every preference to its default (applied on OK) Przywróć domyślne wartości wszystkich preferencji (zastosowane po OK)
Reset all preferences to their defaults? Przywrócić domyślne wartości wszystkich preferencji?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Wartości domyślne zostaną zastosowane po kliknięciu OK w Preferencjach. Anuluj w tym oknie zachowuje bieżące preferencje.
Smaller ↔ Larger Mniejszy ↔ większy
Smart Guides (View → Smart Guides) Inteligentne linie pomocnicze (Widok → Inteligentne linie pomocnicze)
Couldn't save recovery data: {e} Nie udało się zapisać danych odzyskiwania: {e}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -2377,6 +2377,8 @@ digits Malayalam Malaiala
Restore Restaurar
Restore Recovered Documents Restaurar Documentos Recuperados
Restore every preference to its default (applied on OK) Restaurar toda preferência ao padrão (aplicado em OK)
Reset all preferences to their defaults? Redefinir todas as preferências para o padrão?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Os padrões são aplicados quando você clica em OK em Preferências. Cancelar ali mantém suas preferências atuais.
Restored documents open unsaved: save them to keep them. Os documentos restaurados abrem sem salvar: salve-os para mantê-los.
Restrict printing, editing and other tasks Restringir impressão, edição e outras tarefas
Reverse Front to Back Inverter da Frente para Trás
Can't render this file because it contains an unexpected character in line 6 and column 47.
+2
View File
@@ -2870,6 +2870,8 @@ digits Malayalam Малаялам
Responsive Адаптивный
Restore Восстановить
Restore every preference to its default (applied on OK) Восстановить все настройки по умолчанию (применяется при нажатии ОК)
Reset all preferences to their defaults? Сбросить все настройки до значений по умолчанию?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Значения по умолчанию применяются, когда вы нажимаете ОК в окне «Настройки». Отмена там сохраняет текущие настройки.
Restore Recovered Documents Восстановить восстановленные документы
Restored documents open unsaved: save them to keep them. Восстановленные документы открываются несохранёнными: сохраните их, чтобы оставить.
Restrict printing, editing and other tasks Ограничить печать, редактирование и другие задачи
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -2777,6 +2777,8 @@ digits Malayalam Malayalam
Responsive Responsiv
Restore Återställ
Restore every preference to its default (applied on OK) Återställ alla inställningar till standard (verkställs vid OK)
Reset all preferences to their defaults? Återställa alla inställningar till standard?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Standardvärdena verkställs när du klickar på OK i Inställningar. Avbryt där behåller dina nuvarande inställningar.
Restore Recovered Documents Återställ återskapade dokument
Restored documents open unsaved: save them to keep them. Återställda dokument öppnas osparade: spara dem för att behålla dem.
Restrict printing, editing and other tasks Begränsa utskrift, redigering och andra åtgärder
Can't render this file because it contains an unexpected character in line 5 and column 25.
+2
View File
@@ -2646,6 +2646,8 @@ digits Malayalam Malayalam
Responsive duyarlı
Restore Geri yükle
Restore every preference to its default (applied on OK) Her tercihi varsayılana geri yükleyin (Tamam'a uygulanır)
Reset all preferences to their defaults? Tüm tercihler varsayılanlarına sıfırlansın mı?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Varsayılanlar, Tercihler'de Tamam'a tıkladığınızda uygulanır. Oradaki İptal, mevcut tercihlerinizi korur.
Restore Recovered Documents Kurtarılan Belgeleri Geri Yükle
Restored documents open unsaved: save them to keep them. Geri yüklenen belgeler kaydedilmeden açılır: saklamak için kaydedin.
Restrict printing, editing and other tasks Yazdırmayı, düzenlemeyi ve diğer görevleri kısıtlayın
Can't render this file because it contains an unexpected character in line 5 and column 25.
+2
View File
@@ -2867,6 +2867,8 @@ digits Malayalam Малаялам
Responsive Адаптивний
Restore Відновити
Restore every preference to its default (applied on OK) Відновити всі параметри за промовчанням (застосовується при натисканні ОК)
Reset all preferences to their defaults? Скинути всі налаштування до значень за промовчанням?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Значення за промовчанням застосовуються, коли ви натискаєте ОК у вікні «Налаштування». Скасувати там зберігає поточні налаштування.
Restore Recovered Documents Відновити відновлені документи
Restored documents open unsaved: save them to keep them. Відновлені документи відкриваються незбереженими: збережіть їх, щоб залишити.
Restrict printing, editing and other tasks Обмежити друк, редагування та інші завдання
Can't render this file because it contains an unexpected character in line 182 and column 5.
+2
View File
@@ -3158,6 +3158,8 @@ mark-style Japanese Kiểu Nhật
Responsive Đáp ứng
Restore Khôi phục
Restore every preference to its default (applied on OK) Khôi phục tất cả tùy chọn về mặc định (áp dụng khi nhấn OK)
Reset all preferences to their defaults? Đặt lại tất cả tùy chọn về mặc định?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Giá trị mặc định được áp dụng khi bạn nhấn OK trong Tùy chọn. Hủy ở đó giữ nguyên các tùy chọn hiện tại của bạn.
Restore Recovered Documents Khôi phục tài liệu đã phục hồi
Restored documents open unsaved: save them to keep them. Tài liệu đã khôi phục mở ở trạng thái chưa lưu: hãy lưu để giữ lại.
Restrict printing, editing and other tasks Hạn chế in, chỉnh sửa và các tác vụ khác
Can't render this file because it contains an unexpected character in line 204 and column 5.
+2
View File
@@ -2740,6 +2740,8 @@ digits Malayalam 马拉雅拉姆数字
Responsive 响应式
Restore 恢复
Restore every preference to its default (applied on OK) 把所有首选项恢复为默认值 (点击确定后应用)
Reset all preferences to their defaults? 将所有首选项重置为默认值?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 在首选项中点击确定后才会应用默认值。在那里点击取消会保留当前首选项。
Restore Recovered Documents 恢复已恢复的文档
Restored documents open unsaved: save them to keep them. 恢复的文档处于未存储状态:请存储以保留。
Restrict printing, editing and other tasks 限制打印、编辑及其他操作
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3797,6 +3797,8 @@ digits Malayalam 馬來亞拉姆數字
Responsive 回應式
Restore 還原
Restore every preference to its default (applied on OK) 將所有偏好設定還原為預設值 (按下確定後套用)
Reset all preferences to their defaults? 要將所有偏好設定重設為預設值嗎?
The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 在偏好設定中按下確定後才會套用預設值。在那裡按下取消會保留目前的偏好設定。
Restore Recovered Documents 還原找回的文件
Restored documents open unsaved: save them to keep them. 還原的文件會以未儲存狀態開啟:請儲存以保留。
Restrict printing, editing and other tasks 限制列印、編輯及其他操作
Can't render this file because it contains an unexpected character in line 6 and column 47.
+11 -5
View File
@@ -414,11 +414,6 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
});
});
});
if reset {
for (k, v) in Prefs::default().to_json().as_object().cloned().unwrap_or_default() {
d.fields.insert(k, v);
}
}
// The setting a search went to stays highlighted until another category is shown.
let found = d.str("__found");
if !found.is_empty() && settings().find(|s| s.key == found).is_none_or(|s| s.category != d.str("__category")) {
@@ -430,6 +425,17 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
app.ui.dialog = None;
} else if ok && let Err(e) = confirm(app) {
app.status(e);
} else if reset && !ok {
crate::dialogs::confirm::ask_reset_prefs(app);
}
}
/// Reset Preferences, once its question is confirmed: every preference in the Preferences dialog
/// `d` takes its default value. The category, the search and the UI-only rows stay as they were;
/// nothing is applied until OK.
pub(crate) fn reset_fields(d: &mut Dialog) {
for (k, v) in Prefs::default().to_json().as_object().cloned().unwrap_or_default() {
d.fields.insert(k, v);
}
}
+105
View File
@@ -690,6 +690,111 @@ fn escape_clears_the_search_then_closes_the_dialog() {
assert!(a.ui.dialog.is_none(), "Escape in the empty field closes the dialog");
}
/// One frame of the open dialog as the app draws it, keys first, a quarter second after the last
/// (a window takes a sizing frame and fades in). → The texts it painted, with their rectangles.
fn dialog_frame(a: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<egui::Event>) -> Vec<(String, egui::Rect)> {
let time = ctx.input(|i| i.time) + 0.25;
let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1200.0, 900.0)));
let raw = egui::RawInput { screen_rect, events, time: Some(time), ..Default::default() };
let mut out = ctx.run_ui(raw, |ui| {
crate::shortcuts::handle(a, ui.ctx());
crate::dialogs::show(a, ui.ctx());
});
out.textures_delta.clear();
fn walk(s: &egui::Shape, v: &mut Vec<(String, egui::Rect)>) {
match s {
egui::Shape::Text(t) => v.push((t.galley.text().to_string(), egui::Rect::from_min_size(t.pos, t.galley.size()))),
egui::Shape::Vec(s) => s.iter().for_each(|s| walk(s, v)),
_ => {}
}
}
let mut v = vec![];
out.shapes.iter().for_each(|c| walk(&c.shape, &mut v));
v
}
/// Click the text `label` in the open dialog with the pointer.
fn click_text(a: &mut VectorcraftApp, ctx: &egui::Context, label: &str) {
dialog_frame(a, ctx, vec![]);
let texts = dialog_frame(a, ctx, vec![]);
let at = texts.iter().find(|(t, _)| t == label).map(|(_, r)| r.center()).unwrap_or_else(|| panic!("no `{label}` in {texts:?}"));
let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
dialog_frame(a, ctx, vec![egui::Event::PointerMoved(at)]);
dialog_frame(a, ctx, vec![press(true)]);
dialog_frame(a, ctx, vec![press(false)]);
}
/// Preferences with an edited Keyboard Increment, the Units category and a search, over a stored
/// Keyboard Increment of 5.
fn edited_preferences() -> VectorcraftApp {
let mut a = app();
a.run("prefs.set", json!({"key": "keyboardIncrement", "value": 5})).unwrap();
open(&mut a, Some("Units"));
let d = a.ui.dialog.as_mut().unwrap();
d.fields.insert("keyboardIncrement".into(), json!(7));
d.fields.insert("__search".into(), json!("grid"));
a
}
/// Reset Preferences asks first, over Preferences. Escape, or Cancel, shows Preferences again as it
/// was: its edits, category and search kept, and nothing applied.
#[test]
fn reset_preferences_asks_first_and_cancel_returns_to_preferences() {
let mut a = edited_preferences();
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
for way_back in ["Escape", "Cancel"] {
click_text(&mut a, &ctx, "Reset Preferences");
let d = a.ui.dialog.clone().expect("a question is open");
assert_eq!(d.kind, crate::dialogs::confirm::RESET_PREFS, "Reset Preferences asks first");
let under = crate::dialogs::parent(&d).expect("the question is over Preferences");
assert_eq!((under.kind.as_str(), under.fields["keyboardIncrement"].clone()), ("preferences", json!(7)), "Preferences is unchanged");
dialog_frame(&mut a, &ctx, vec![]);
let shown: Vec<String> = dialog_frame(&mut a, &ctx, vec![]).into_iter().map(|(t, _)| t).collect();
assert!(shown.iter().any(|t| t == "Reset all preferences to their defaults?"), "{shown:?}");
if way_back == "Escape" {
dialog_frame(&mut a, &ctx, key_press(egui::Key::Escape, egui::Modifiers::NONE));
} else {
click_text(&mut a, &ctx, "Cancel");
}
let d = a.ui.dialog.as_ref().unwrap_or_else(|| panic!("{way_back}: Preferences is open again"));
assert_eq!(d.kind, "preferences", "{way_back}");
assert_eq!(d.fields["keyboardIncrement"], json!(7), "{way_back}: the edit is kept");
assert_eq!((d.str("__category").as_str(), d.str("__search").as_str()), ("Units", "grid"), "{way_back}: category and search kept");
assert_eq!(a.session.prefs.keyboard_increment, 5.0, "{way_back}: nothing applied");
}
}
/// OK on the question shows Preferences again with every preference at its default, its category
/// and search kept; nothing is applied until OK in Preferences, and Preferences' Cancel keeps the
/// stored preferences.
#[test]
fn confirming_reset_fills_preferences_and_applies_nothing_until_ok() {
let mut a = edited_preferences();
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let default = Prefs::default().to_json()["keyboardIncrement"].clone();
click_text(&mut a, &ctx, "Reset Preferences");
click_text(&mut a, &ctx, "OK");
let d = a.ui.dialog.as_ref().expect("Preferences is open again");
assert_eq!(d.kind, "preferences");
assert_eq!(d.fields["keyboardIncrement"], default, "the working copy holds the defaults");
assert_eq!((d.str("__category").as_str(), d.str("__search").as_str()), ("Units", "grid"));
assert_eq!(a.session.prefs.keyboard_increment, 5.0, "nothing applied yet");
click_text(&mut a, &ctx, "Cancel");
assert!(a.ui.dialog.is_none());
assert_eq!(a.session.prefs.keyboard_increment, 5.0, "Cancel in Preferences keeps the preferences");
// `ui.dialog.confirm` answers the question as OK does; OK in Preferences then applies the defaults.
let mut a = edited_preferences();
click_text(&mut a, &ctx, "Reset Preferences");
crate::dialogs::confirm(&mut a).unwrap();
assert_eq!(a.ui.dialog.as_ref().map(|d| d.kind.as_str()), Some("preferences"));
crate::dialogs::confirm(&mut a).unwrap();
assert!(a.ui.dialog.is_none());
assert_eq!(a.session.prefs.keyboard_increment, Prefs::default().keyboard_increment);
}
/// Units › Numbers Without Units Are Points (#394): the preference reaches the fields when it
/// changes, and its checkbox is dimmed unless a unit is Picas.
#[test]
+4 -1
View File
@@ -4515,7 +4515,10 @@ a string with a unit. Unit names: `Points`, `Picas`, `Inches`, `Millimeters`, `C
settings whose label, section or category contains it, ignoring case, in the interface language or in English, or by
"No settings found". Choosing a setting sets `__category` to its category, sets `__found` to its key (the row is
highlighted until another category is shown) and clears `__search`. Cmd/Ctrl+F focuses the field again; Escape in the
field with text clears it, and Escape in the empty field closes the dialog.
field with text clears it, and Escape in the empty field closes the dialog. Its Reset Preferences button opens a
`resetPreferences` question (fields `message`, `detail`) over Preferences: `ui.dialog.cancel` shows Preferences again
as it was, and `ui.dialog.confirm` shows it again with every preference at its default value, applied by OK in
Preferences. `prefs.reset` resets the preferences at once, without the question.
```json
{"name":"run_command","arguments":{"command":"prefs.set","params":{"key":"unitsGeneral","value":"millimeters"}}}
+1
View File
@@ -658,6 +658,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Reordering document tabs (G7, #5663):** a document tab dragged along the tab strip moves its document among the others ([public source](https://helpx.adobe.com/illustrator/using/customizing-workspace.html)); a line marks the gap it goes in. The current document stays current, each document keeps its own zoom, centre and artboard, the views Window › New Window opened move with their document, and Window › Next/Previous Document follow the new order. `document.move` (`{from?, to}`) does the same from MCP, the control channel and recordings. `crates/ui-egui/src/tests/tab_reorder.rs`, `crates/engine/src/tests/document_move.rs`.
- **Preferences › User Interface › Open Documents As Tabs (G7, #394):** checked by default, documents open under tabs in one document window ([public source](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/workspace-overview.html)). With the box cleared, each document opened or created afterwards opens in a floating window of its own, at the next cascade place, as Float in Window floats it; documents already open stay where they are, and checking the box again leaves floating documents in their windows. Tests: `crates/ui-egui/src/doc_windows/tests.rs`.
- **Preferences search:** a Search Preferences field above the category list has the keyboard focus when the dialog opens, and Cmd/Ctrl+F gives it back; typing lists the settings it finds, and choosing one shows its category, as the [help page](https://helpx.adobe.com/illustrator/desktop/get-started/preferences-and-settings/set-app-preferences.html) describes. VectorCraft's own rules: the field matches a setting's label, section or category, ignoring case, in the interface language or in English; the list replaces the categories while the field has text and shows every match, or "No settings found"; the chosen setting's row is highlighted and scrolled into view; Escape in the field with text clears it, and Escape in the empty field closes the dialog. The dialog's `__search` field (`ui.dialog.set`) holds the text. Tests: `crates/ui-egui/src/prefs_dialog/tests.rs`.
- **Reset Preferences asks first (#6435):** the Preferences dialog's Reset Preferences button opens a question over the dialog (`resetPreferences`). Cancel or Escape goes back to Preferences unchanged, with its category, search and edits kept; OK goes back with every preference at its default value, which OK in Preferences applies and Cancel there discards. The question and its wording are VectorCraft's own. Tests: `crates/ui-egui/src/prefs_dialog/tests.rs`.
- **Window › New Window (G7, #4116):** New Window (`window.newWindow`) opens another view of the current document ([public source](https://helpx.adobe.com/illustrator/using/viewing-artwork.html) describes showing one document in several windows at once), with its own zoom, center, rotation, artboard and Outline or Preview, as a tab of its own; an edit in one view shows in every view. Tile, Cascade, Float in Window, Float All in Windows and Consolidate All Windows arrange each view as they arrange a document, and Next and Previous Document step through the views. Closing a view leaves the document open; closing its last view closes the document, asking to save it first. The view's number after the name in its tab ("Name:2", while the document has more than one view) is VectorCraft's own. Tests: `crates/ui-egui/src/doc_windows/tests.rs`.
- **Document Setup modal handoff:** Document Setup → Edit Artboards applies valid settings, closes the dialog and activates the Artboard tool. Pointer-click tests cover successful handoff, invalid settings, OK, Cancel and Undo in `dialogs/document_setup.rs`.