mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 08:26:28 +00:00
Merge pull request #8048 from dotCooCoo/feat/actions-reset-actions
Actions: Reset Actions restores the default set
This commit is contained in:
@@ -1647,6 +1647,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"",
|
||||
"{set?: index, action?: index} copy the Actions panel's action at action in set (0 is the top set) to right after it in the same set; without action, copy set with all its actions to right after it (default: the current set). The copy is named after the original with \" copy\" added, a copied set gets an id of its own, and the copy is selected. The panel menu's Duplicate runs this for the selected action, else the current set. An index past the last set or action, or a copy that would give its set more than 1,000 actions or an action set file larger than 8 MiB, is an error and copies nothing → {set, action?}",
|
||||
),
|
||||
(
|
||||
"ui.actionSet.reset",
|
||||
"Reset Actions",
|
||||
"",
|
||||
"{mode?: \"replace\" | \"append\"} Reset Actions. replace (the default) replaces every set in the Actions panel with a new copy of the built-in Default Actions set, makes it current and selected, clears the panel's selected action and step and its expanded actions, and closes an open Set Options, New Action, Batch or step dialog that names a set; when the panel already shows only the built-in set as it comes in that state, nothing changes, the sets keep their ids and changed is false. append adds a new copy of the built-in set after the sets there are, with the next free number when its name is in use (Default Actions 2), and keeps the current set and the selection. Omitted params count as {}. Params of another type, another key, another mode, or a reset while an action records or plays (also while it waits at a stop) is an error and changes nothing. No undo step is recorded. The panel menu's Reset Actions asks first (dialog `resetActions`): OK runs this with replace, Append with append → {changed, mode, set: the first built-in set's index}",
|
||||
),
|
||||
("file.showPackage", "Show Package", "", "{folder} show a package folder (file.package's folder) in the file manager → {folder}"),
|
||||
(
|
||||
"docInfo.save",
|
||||
|
||||
@@ -339,6 +339,7 @@ registry! {
|
||||
Replace: [confirm::REPLACE] => confirm::REPLACE_SPEC,
|
||||
ReplaceFiles: [confirm::REPLACE_FILES] => confirm::REPLACE_FILES_SPEC,
|
||||
ResetPreferences: [confirm::RESET_PREFS] => confirm::RESET_PREFS_SPEC,
|
||||
ResetActions: [confirm::RESET_ACTIONS] => confirm::RESET_ACTIONS_SPEC,
|
||||
NewSwatch: [new_swatch::KIND] => new_swatch::SPEC,
|
||||
NewColorGroup: [new_color_group::KIND] => new_color_group::SPEC,
|
||||
GraphData: [graph_data::KIND] => graph_data::SPEC,
|
||||
|
||||
@@ -134,6 +134,28 @@ fn reset_prefs(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
|
||||
Ok(Value::Null)
|
||||
}
|
||||
|
||||
/// The dialog kind of the question Reset Actions asks in the Actions panel menu
|
||||
/// ([`ask_reset_actions`]). Fields: `message`, `detail`, `append` (set by Append).
|
||||
pub const RESET_ACTIONS: &str = "resetActions";
|
||||
|
||||
pub(super) const RESET_ACTIONS_SPEC: DialogSpec = DialogSpec { confirm: reset_actions, alternate: Some(("Append", "append")), ..SPEC };
|
||||
|
||||
/// Ask whether to replace the Actions panel's sets with the built-in set. OK replaces them, Append
|
||||
/// adds the built-in set after them ([`crate::panels::actions::reset`]), and Cancel or Escape
|
||||
/// changes nothing.
|
||||
pub(crate) fn ask_reset_actions(app: &mut VectorcraftApp) {
|
||||
let message = tl!("Replace the current actions with the default set?");
|
||||
let detail = tl!("Append adds the default set after the current sets instead.");
|
||||
app.ui.dialog = Some(Dialog::new(RESET_ACTIONS, json!({"message": message, "detail": detail, "append": false})));
|
||||
}
|
||||
|
||||
/// OK or Append on [`ask_reset_actions`]: closes, then resets the action sets.
|
||||
fn reset_actions(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
|
||||
let mode = if d.fields.get("append").and_then(Value::as_bool) == Some(true) { "append" } else { "replace" };
|
||||
app.ui.dialog = None;
|
||||
app.run(crate::panels::actions::RESET, json!({ "mode": mode }))
|
||||
}
|
||||
|
||||
/// Most messages kept for later while a dialog is open ([`tell`]).
|
||||
const MAX_WAITING: usize = 16;
|
||||
|
||||
|
||||
@@ -2524,6 +2524,39 @@ fn flare_options_alt_turns_cancel_into_reset() {
|
||||
);
|
||||
}
|
||||
|
||||
/// Reset Actions' question: OK replaces the action sets with the built-in set, Append adds the
|
||||
/// built-in set after them, and Cancel or Escape (`cancel`) leaves them as they are.
|
||||
#[test]
|
||||
fn reset_actions_ok_replaces_append_adds_and_cancel_keeps_the_sets() {
|
||||
use crate::panels::actions::{ActionSet, default_sets};
|
||||
let names = |app: &VectorcraftApp| app.ui.action_sets.iter().map(|s| s.name.clone()).collect::<Vec<_>>();
|
||||
let mut app = app();
|
||||
app.ui.action_sets.push(ActionSet::new("Mine", vec![]));
|
||||
app.ui.action_set = Some(1);
|
||||
let mut f = Frames::new();
|
||||
for (answer, want, current) in [
|
||||
(Some("Cancel"), vec!["Default Actions", "Mine"], Some(1)),
|
||||
(None, vec!["Default Actions", "Mine"], Some(1)),
|
||||
(Some("Append"), vec!["Default Actions", "Mine", "Default Actions 2"], Some(1)),
|
||||
(Some("OK"), vec!["Default Actions"], Some(0)),
|
||||
] {
|
||||
crate::dialogs::confirm::ask_reset_actions(&mut app);
|
||||
match answer {
|
||||
Some(label) => {
|
||||
let at = f.button(&mut app, label);
|
||||
f.press(&mut app, at, true);
|
||||
f.press(&mut app, at, false);
|
||||
}
|
||||
None => cancel(&mut app),
|
||||
}
|
||||
assert!(app.ui.dialog.is_none(), "{answer:?} closes the question");
|
||||
assert_eq!(names(&app), want, "{answer:?}");
|
||||
assert_eq!(app.ui.action_set, current, "{answer:?}");
|
||||
}
|
||||
let saved = |sets: &[ActionSet]| serde_json::to_value(sets).unwrap();
|
||||
assert_eq!(saved(&app.ui.action_sets), saved(&default_sets()), "OK leaves the built-in set as it comes");
|
||||
}
|
||||
|
||||
/// The slider that screen readers name `label` in `out`'s tree: its node id, number and text.
|
||||
fn slider_node(out: &egui::FullOutput, label: &str) -> (egui::accesskit::NodeId, Option<f64>, Option<String>) {
|
||||
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
|
||||
|
||||
@@ -2573,6 +2573,10 @@ font-technology Variable Променливи
|
||||
Play Current Selection Изпълнение на текущия избор
|
||||
Save Actions… Запазване на действия…
|
||||
Load Actions… Зареждане на действия…
|
||||
Reset Actions Нулиране на действия
|
||||
Replace the current actions with the default set? Да се заменят ли текущите действия с набора по подразбиране?
|
||||
Append adds the default set after the current sets instead. С „Добавяне“ наборът по подразбиране се добавя след текущите набори.
|
||||
Append Добавяне
|
||||
Plug-in Info Информация за приставката
|
||||
Plug-ins Приставки
|
||||
Plug-in… Приставка…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1503,6 +1503,10 @@ lighting Light Svjetlo
|
||||
Play Current Selection Reprodukuj trenutni odabir
|
||||
Save Actions… Sačuvaj akcije…
|
||||
Load Actions… Učitaj akcije…
|
||||
Reset Actions Vrati akcije na početno
|
||||
Replace the current actions with the default set? Zamijeniti trenutne akcije zadanim skupom?
|
||||
Append adds the default set after the current sets instead. Dugme Dodaj umjesto toga dodaje zadani skup iza trenutnih skupova.
|
||||
Append Dodaj
|
||||
Reflect Horizontal Odrazi vodoravno
|
||||
Rotate 90° CW Rotiraj za 90° u smjeru kazaljke
|
||||
Set 1 Skup 1
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -3332,6 +3332,10 @@ digits Malayalam Malaiàlam
|
||||
Play Current Selection Reprodueix la selecció actual
|
||||
Save Actions… Desa les accions…
|
||||
Load Actions… Carrega accions…
|
||||
Reset Actions Restableix les accions
|
||||
Replace the current actions with the default set? Voleu reemplaçar les accions actuals pel conjunt predeterminat?
|
||||
Append adds the default set after the current sets instead. Amb Afegeix, el conjunt predeterminat s’afegeix després dels conjunts actuals.
|
||||
Append Afegeix
|
||||
Play: Reprodueix:
|
||||
Plug-in Info Informació del complement
|
||||
Plug-ins Complements
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -1531,6 +1531,10 @@ lighting Light Světlo
|
||||
Play Current Selection Přehrát aktuální výběr
|
||||
Save Actions… Uložit akce…
|
||||
Load Actions… Načíst akce…
|
||||
Reset Actions Obnovit akce
|
||||
Replace the current actions with the default set? Nahradit aktuální akce výchozí sadou?
|
||||
Append adds the default set after the current sets instead. Tlačítko Připojit místo toho přidá výchozí sadu za aktuální sady.
|
||||
Append Připojit
|
||||
Reflect Horizontal Zrcadlit vodorovně
|
||||
Rotate 90° CW Otočit o 90° po směru hodin
|
||||
Set 1 Sada 1
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4104,6 +4104,10 @@ lighting Light Lys
|
||||
Play Current Selection Afspil aktuel markering
|
||||
Save Actions… Gem handlinger…
|
||||
Load Actions… Indlæs handlinger…
|
||||
Reset Actions Nulstil handlinger
|
||||
Replace the current actions with the default set? Vil du erstatte de aktuelle handlinger med standardsættet?
|
||||
Append adds the default set after the current sets instead. Tilføj tilføjer i stedet standardsættet efter de aktuelle sæt.
|
||||
Append Tilføj
|
||||
Reflect Horizontal Spejl vandret
|
||||
Rotate 90° CW Rotér 90° med uret
|
||||
Set 1 Sæt 1
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2619,6 +2619,10 @@ diagnostics ui Oberfläche
|
||||
Play Current Selection Aktuelle Auswahl abspielen
|
||||
Save Actions… Aktionen speichern…
|
||||
Load Actions… Aktionen laden…
|
||||
Reset Actions Aktionen zurücksetzen
|
||||
Replace the current actions with the default set? Aktuelle Aktionen durch den Standardsatz ersetzen?
|
||||
Append adds the default set after the current sets instead. Mit „Anhängen“ wird der Standardsatz stattdessen nach den aktuellen Sätzen hinzugefügt.
|
||||
Append Anhängen
|
||||
Plug-in Info Plug-in-Informationen
|
||||
Plug-ins Plug-ins
|
||||
Plug-in… Plug-in…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3527,6 +3527,10 @@ theme Appearance Εμφάνιση
|
||||
Play Current Selection Αναπαραγωγή τρέχουσας επιλογής
|
||||
Save Actions… Αποθήκευση ενεργειών…
|
||||
Load Actions… Φόρτωση ενεργειών…
|
||||
Reset Actions Επαναφορά ενεργειών
|
||||
Replace the current actions with the default set? Να αντικατασταθούν οι τρέχουσες ενέργειες με το προεπιλεγμένο σύνολο;
|
||||
Append adds the default set after the current sets instead. Η Προσάρτηση προσθέτει αντί γι’ αυτό το προεπιλεγμένο σύνολο μετά τα τρέχοντα σύνολα.
|
||||
Append Προσάρτηση
|
||||
Plug-in Info Πληροφορίες προσθέτου
|
||||
Plug-in… Πρόσθετο…
|
||||
Point Text Objects Αντικείμενα κειμένου σημείου
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2662,6 +2662,10 @@ font-technology Variable Variables
|
||||
Play Current Selection Reproducir la selección actual
|
||||
Save Actions… Guardar acciones…
|
||||
Load Actions… Cargar acciones…
|
||||
Reset Actions Restablecer acciones
|
||||
Replace the current actions with the default set? ¿Reemplazar las acciones actuales por el conjunto predeterminado?
|
||||
Append adds the default set after the current sets instead. Añadir agrega en su lugar el conjunto predeterminado después de los conjuntos actuales.
|
||||
Append Añadir
|
||||
Plug-in Info Información del plugin
|
||||
Plug-ins Plugins
|
||||
Plug-in… Plugin…
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -1505,6 +1505,10 @@ lighting Light Valo
|
||||
Play Current Selection Toista nykyinen valinta
|
||||
Save Actions… Tallenna toiminnot…
|
||||
Load Actions… Lataa toiminnot…
|
||||
Reset Actions Palauta toiminnot
|
||||
Replace the current actions with the default set? Korvataanko nykyiset toiminnot oletussarjalla?
|
||||
Append adds the default set after the current sets instead. Lisää-painike lisää sen sijaan oletussarjan nykyisten sarjojen perään.
|
||||
Append Lisää
|
||||
Reflect Horizontal Peilaa vaakasuunnassa
|
||||
Rotate 90° CW Kierrä 90° myötäpäivään
|
||||
Set 1 Sarja 1
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -2650,6 +2650,10 @@ font-technology Variable Variables
|
||||
Play Current Selection Exécuter la sélection actuelle
|
||||
Save Actions… Enregistrer les scripts…
|
||||
Load Actions… Charger des scripts…
|
||||
Reset Actions Réinitialiser les scripts
|
||||
Replace the current actions with the default set? Remplacer les scripts actuels par le jeu par défaut ?
|
||||
Append adds the default set after the current sets instead. Le bouton Ajouter ajoute plutôt le jeu par défaut après les jeux actuels.
|
||||
Append Ajouter
|
||||
Plug-in Info Informations sur le module externe
|
||||
Plug-ins Modules externes
|
||||
Plug-in… Module externe…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2052,6 +2052,10 @@
|
||||
Live curve fitting લાઇવ કર્વ ફિટિંગ
|
||||
Live preview લાઇવ પૂર્વાવલોકન
|
||||
Load Actions… ઍક્શન લોડ કરો…
|
||||
Reset Actions ઍક્શન રીસેટ કરો
|
||||
Replace the current actions with the default set? વર્તમાન ઍક્શનને ડિફૉલ્ટ સેટથી બદલવા છે?
|
||||
Append adds the default set after the current sets instead. ઉમેરો તેના બદલે ડિફૉલ્ટ સેટને વર્તમાન સેટ પછી ઉમેરે છે.
|
||||
Append ઉમેરો
|
||||
Load All Styles બધી સ્ટાઇલ લોડ કરો
|
||||
Load All Styles… બધી સ્ટાઇલ લોડ કરો…
|
||||
Load Character Styles કેરેક્ટર સ્ટાઇલ લોડ કરો
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -2757,6 +2757,10 @@ antiAlias Sharp शार्प
|
||||
Live Shape लाइव आकार
|
||||
Live Shape Properties लाइव शेप प्रॉपर्टीज़
|
||||
Load Actions… एक्शन्स लोड करें…
|
||||
Reset Actions एक्शन्स रीसेट करें
|
||||
Replace the current actions with the default set? मौजूदा एक्शन्स को डिफ़ॉल्ट सेट से बदलें?
|
||||
Append adds the default set after the current sets instead. जोड़ें इसके बजाय डिफ़ॉल्ट सेट को मौजूदा सेट के बाद जोड़ता है।
|
||||
Append जोड़ें
|
||||
Load Color Profile… लोड कलर प्रोफ़ाइल…
|
||||
Load EPS into Clipboard ईपीएस को क्लिपबोर्ड में लोड करें
|
||||
Load Image into Clipboard क्लिपबोर्ड में इमेज लोड करें
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3209,6 +3209,10 @@ diagnostics ui felület
|
||||
Play Current Selection Kijelölt művelet lejátszása
|
||||
Save Actions… Műveletek mentése…
|
||||
Load Actions… Műveletek betöltése…
|
||||
Reset Actions Műveletek visszaállítása
|
||||
Replace the current actions with the default set? Lecseréled az aktuális műveleteket az alapértelmezett készletre?
|
||||
Append adds the default set after the current sets instead. A Hozzáfűzés ehelyett az aktuális készletek után adja hozzá az alapértelmezett készletet.
|
||||
Append Hozzáfűzés
|
||||
Plug-in Info Bővítmény adatai
|
||||
Plug-ins Bővítmények
|
||||
Plug-in… Bővítmény…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1430,6 +1430,10 @@ lighting Light Cahaya
|
||||
Play Current Selection Putar seleksi saat ini
|
||||
Save Actions… Simpan tindakan…
|
||||
Load Actions… Muat tindakan…
|
||||
Reset Actions Atur ulang tindakan
|
||||
Replace the current actions with the default set? Ganti tindakan saat ini dengan set default?
|
||||
Append adds the default set after the current sets instead. Tambahkan justru menambahkan set default setelah set saat ini.
|
||||
Append Tambahkan
|
||||
Reflect Horizontal Pencerminan horizontal
|
||||
Rotate 90° CW Putar 90° searah jarum jam
|
||||
Set 1 Set 1
|
||||
|
||||
|
@@ -2700,6 +2700,10 @@ diagnostics ui interfaccia
|
||||
Play Current Selection Esegui selezione corrente
|
||||
Save Actions… Salva azioni…
|
||||
Load Actions… Carica azioni…
|
||||
Reset Actions Ripristina azioni
|
||||
Replace the current actions with the default set? Sostituire le azioni correnti con il set predefinito?
|
||||
Append adds the default set after the current sets instead. Aggiungi aggiunge invece il set predefinito dopo i set correnti.
|
||||
Append Aggiungi
|
||||
Plug-in Info Informazioni plug-in
|
||||
Plug-ins Plug-in
|
||||
Plug-in… Plug-in…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2787,6 +2787,10 @@ diagnostics ui UI
|
||||
Play Current Selection 選択項目を再生
|
||||
Save Actions… アクションを保存…
|
||||
Load Actions… アクションを読み込み…
|
||||
Reset Actions アクションをリセット
|
||||
Replace the current actions with the default set? 現在のアクションを初期設定のセットで置き換えますか?
|
||||
Append adds the default set after the current sets instead. 「追加」を選ぶと、初期設定のセットを現在のセットの後に追加します。
|
||||
Append 追加
|
||||
Plug-in Info プラグイン情報
|
||||
Plug-in… プラグイン…
|
||||
Points ポイント
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3454,6 +3454,10 @@ lighting Light სინათლე
|
||||
Play Current Selection მიმდინარე მონიშნულის შესრულება
|
||||
Save Actions… მოქმედებების შენახვა…
|
||||
Load Actions… მოქმედებების ჩატვირთვა…
|
||||
Reset Actions მოქმედებების ჩამოყრა
|
||||
Replace the current actions with the default set? ჩანაცვლდეს მიმდინარე მოქმედებები ნაგულისხმევი ნაკრებით?
|
||||
Append adds the default set after the current sets instead. დამატება ამის ნაცვლად ნაგულისხმევ ნაკრებს მიმდინარე ნაკრებების შემდეგ ამატებს.
|
||||
Append დამატება
|
||||
Reflect Horizontal ჰორიზონტალურად არეკვლა
|
||||
Rotate 90° CW 90°-ით შემობრუნება საათის ისრის მიმართულებით
|
||||
Set 1 ნაკრები 1
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2777,6 +2777,10 @@ diagnostics ui UI
|
||||
Play Current Selection 현재 선택 항목 재생
|
||||
Save Actions… 액션 저장…
|
||||
Load Actions… 액션 불러오기…
|
||||
Reset Actions 액션 재설정
|
||||
Replace the current actions with the default set? 현재 액션을 기본 세트로 바꾸시겠습니까?
|
||||
Append adds the default set after the current sets instead. 추가를 누르면 대신 기본 세트를 현재 세트 뒤에 추가합니다.
|
||||
Append 추가
|
||||
Plug-in Info 플러그인 정보
|
||||
Plug-in… 플러그인…
|
||||
Points 포인트
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1998,6 +1998,10 @@ lighting Light Licht
|
||||
Play Current Selection Huidige selectie afspelen
|
||||
Save Actions… Acties opslaan…
|
||||
Load Actions… Acties laden…
|
||||
Reset Actions Acties opnieuw instellen
|
||||
Replace the current actions with the default set? De huidige acties vervangen door de standaardset?
|
||||
Append adds the default set after the current sets instead. Toevoegen voegt in plaats daarvan de standaardset toe na de huidige sets.
|
||||
Append Toevoegen
|
||||
Reflect Horizontal Horizontaal spiegelen
|
||||
Rotate 90° CW 90° met de klok mee draaien
|
||||
Set 1 Set 1
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1444,6 +1444,10 @@ lighting Light Światło
|
||||
Play Current Selection Odtwórz bieżące zaznaczenie
|
||||
Save Actions… Zapisz operacje…
|
||||
Load Actions… Wczytaj operacje…
|
||||
Reset Actions Resetuj operacje
|
||||
Replace the current actions with the default set? Zastąpić bieżące operacje zestawem domyślnym?
|
||||
Append adds the default set after the current sets instead. Dołącz dodaje zamiast tego zestaw domyślny po bieżących zestawach.
|
||||
Append Dołącz
|
||||
Reflect Horizontal Odbij w poziomie
|
||||
Rotate 90° CW Obróć o 90° w prawo
|
||||
Set 1 Zestaw 1
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2197,6 +2197,10 @@ antiAlias Sharp Nítido
|
||||
Play Current Selection Reproduzir Seleção Atual
|
||||
Save Actions… Salvar Ações…
|
||||
Load Actions… Carregar Ações…
|
||||
Reset Actions Redefinir Ações
|
||||
Replace the current actions with the default set? Substituir as ações atuais pelo conjunto padrão?
|
||||
Append adds the default set after the current sets instead. Anexar adiciona o conjunto padrão depois dos conjuntos atuais.
|
||||
Append Anexar
|
||||
Plug-in Info Informações do Plug-in
|
||||
Plug-ins Plug-ins
|
||||
Plug-in… Plug-in…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2689,6 +2689,10 @@ diagnostics ui интерфейс
|
||||
Play Current Selection Воспроизвести текущее выделение
|
||||
Save Actions… Сохранить действия…
|
||||
Load Actions… Загрузить действия…
|
||||
Reset Actions Сбросить действия
|
||||
Replace the current actions with the default set? Заменить текущие действия набором по умолчанию?
|
||||
Append adds the default set after the current sets instead. Кнопка «Добавить» вместо этого добавляет набор по умолчанию после текущих наборов.
|
||||
Append Добавить
|
||||
Plug-in Info Сведения о модуле
|
||||
Plug-ins Модули
|
||||
Plug-in… Модуль…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2593,6 +2593,10 @@ font-technology Variable Variabla
|
||||
Play Current Selection Spela upp aktuell markering
|
||||
Save Actions… Spara åtgärder…
|
||||
Load Actions… Läs in åtgärder…
|
||||
Reset Actions Återställ åtgärder
|
||||
Replace the current actions with the default set? Vill du ersätta de aktuella åtgärderna med standarduppsättningen?
|
||||
Append adds the default set after the current sets instead. Lägg till lägger i stället till standarduppsättningen efter de aktuella uppsättningarna.
|
||||
Append Lägg till
|
||||
Plug-in Info Information om plugin
|
||||
Plug-ins Plugins
|
||||
Plug-in… Plugin…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2434,6 +2434,10 @@ shape Open Açık
|
||||
Play Current Selection Geçerli Seçimi Oynat
|
||||
Save Actions… Eylemleri Kaydet…
|
||||
Load Actions… Eylemleri Yükle…
|
||||
Reset Actions Eylemleri Sıfırla
|
||||
Replace the current actions with the default set? Geçerli eylemler varsayılan setle değiştirilsin mi?
|
||||
Append adds the default set after the current sets instead. Ekle bunun yerine varsayılan seti geçerli setlerin sonuna ekler.
|
||||
Append Ekle
|
||||
Plug-in Info Eklenti Bilgisi
|
||||
Plug-ins Eklentiler
|
||||
Plug-in… Eklenti…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2692,6 +2692,10 @@ diagnostics ui інтерфейс
|
||||
Play Current Selection Відтворити поточне виділення
|
||||
Save Actions… Зберегти дії…
|
||||
Load Actions… Завантажити дії…
|
||||
Reset Actions Скинути дії
|
||||
Replace the current actions with the default set? Замінити поточні дії набором за умовчанням?
|
||||
Append adds the default set after the current sets instead. Кнопка «Додати» натомість додає набір за умовчанням після поточних наборів.
|
||||
Append Додати
|
||||
Plug-in Info Відомості про модуль
|
||||
Plug-ins Модулі
|
||||
Plug-in… Модуль…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3009,6 +3009,10 @@ diagnostics ui giao diện
|
||||
Play Current Selection Phát vùng chọn hiện tại
|
||||
Save Actions… Lưu hành động…
|
||||
Load Actions… Tải hành động…
|
||||
Reset Actions Đặt lại hành động
|
||||
Replace the current actions with the default set? Thay thế các hành động hiện tại bằng bộ mặc định?
|
||||
Append adds the default set after the current sets instead. Nối thêm sẽ thêm bộ mặc định vào sau các bộ hiện tại.
|
||||
Append Nối thêm
|
||||
Plug-in Info Thông tin plug-in
|
||||
Plug-ins Plug-in
|
||||
Plug-in… Phần bổ trợ…
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 205 and column 5.
|
@@ -2553,6 +2553,10 @@ diagnostics ui 界面
|
||||
Play Current Selection 播放当前选择项目
|
||||
Save Actions… 存储动作…
|
||||
Load Actions… 载入动作…
|
||||
Reset Actions 重置动作
|
||||
Replace the current actions with the default set? 要用默认动作组替换当前动作吗?
|
||||
Append adds the default set after the current sets instead. “追加”会改为将默认动作组添加到当前动作组之后。
|
||||
Append 追加
|
||||
Plug-in Info 插件信息
|
||||
Plug-ins 增效工具
|
||||
Plug-in… 增效工具…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3824,6 +3824,10 @@ diagnostics ui 介面
|
||||
Play Current Selection 播放目前選取項目
|
||||
Save Actions… 儲存動作…
|
||||
Load Actions… 載入動作…
|
||||
Reset Actions 重設動作
|
||||
Replace the current actions with the default set? 要用預設動作組取代目前的動作嗎?
|
||||
Append adds the default set after the current sets instead. 「附加」會改為將預設動作組加到目前動作組之後。
|
||||
Append 附加
|
||||
Plug-in Info 增效模組資訊
|
||||
Plug-ins 增效模組
|
||||
Plug-in… 增效模組…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1004,6 +1004,7 @@ fn run_ui_part11(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result
|
||||
crate::panels::actions::LOAD_SET => crate::panels::actions::load_set(app, p),
|
||||
crate::panels::actions::DELETE_SETS => crate::panels::actions::delete_sets(app, p),
|
||||
crate::panels::actions::DUPLICATE => crate::panels::actions::duplicate(app, p),
|
||||
crate::panels::actions::RESET => crate::panels::actions::reset(app, p),
|
||||
"ui.shortcutImportDialog" => crate::dialogs::shortcut_import::command(app, p),
|
||||
_ => return None,
|
||||
};
|
||||
|
||||
@@ -1648,6 +1648,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"",
|
||||
"{set?: index, action?: index} copy the Actions panel's action at action in set (0 is the top set) to right after it in the same set; without action, copy set with all its actions to right after it (default: the current set). The copy is named after the original with \" copy\" added, a copied set gets an id of its own, and the copy is selected. The panel menu's Duplicate runs this for the selected action, else the current set. An index past the last set or action, or a copy that would give its set more than 1,000 actions or an action set file larger than 8 MiB, is an error and copies nothing → {set, action?}",
|
||||
),
|
||||
(
|
||||
crate::panels::actions::RESET,
|
||||
"Reset Actions",
|
||||
"",
|
||||
"{mode?: \"replace\" | \"append\"} Reset Actions. replace (the default) replaces every set in the Actions panel with a new copy of the built-in Default Actions set, makes it current and selected, clears the panel's selected action and step and its expanded actions, and closes an open Set Options, New Action, Batch or step dialog that names a set; when the panel already shows only the built-in set as it comes in that state, nothing changes, the sets keep their ids and changed is false. append adds a new copy of the built-in set after the sets there are, with the next free number when its name is in use (Default Actions 2), and keeps the current set and the selection. Omitted params count as {}. Params of another type, another key, another mode, or a reset while an action records or plays (also while it waits at a stop) is an error and changes nothing. No undo step is recorded. The panel menu's Reset Actions asks first (dialog `resetActions`): OK runs this with replace, Append with append → {changed, mode, set: the first built-in set's index}",
|
||||
),
|
||||
("file.showPackage", "Show Package", "", "{folder} show a package folder (file.package's folder) in the file manager → {folder}"),
|
||||
(
|
||||
"docInfo.save",
|
||||
|
||||
@@ -2145,6 +2145,81 @@ pub fn duplicate(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> {
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
/// The command that puts the built-in action set back ([`reset`]).
|
||||
pub const RESET: &str = "ui.actionSet.reset";
|
||||
|
||||
/// `ui.actionSet.reset {mode?: "replace" | "append"}`: Reset Actions. `replace` (the default)
|
||||
/// replaces every set in the panel with a new copy of the built-in sets ([`default_sets`]), makes
|
||||
/// the first one current and selected, clears the panel's selected action and step, its expanded
|
||||
/// actions and a step being dragged, and closes an open Set Options, New Action, Batch or step
|
||||
/// dialog that names a set. When the panel already shows the built-in sets that way, nothing
|
||||
/// changes and the sets keep their ids. `append` adds a new copy of the built-in sets after the
|
||||
/// sets there are, a name already in use getting the next free number (`Default Actions 2`), and
|
||||
/// keeps the current set and the selection. Omitted params (`null`) count as `{}`. Params of another
|
||||
/// type, another key, or another `mode` is an error, and so is a reset while an action records or
|
||||
/// plays (also while it waits at a stop); then nothing changes. No undo step is recorded.
|
||||
/// → {changed, mode, set: the index of the first built-in set}
|
||||
pub fn reset(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> {
|
||||
const SELECTED: &str = "actions-selected";
|
||||
const EXPANDED: &str = "actions-expanded";
|
||||
let append = match p {
|
||||
Value::Null => false,
|
||||
Value::Object(m) => {
|
||||
if let Some(key) = m.keys().find(|k| *k != "mode") {
|
||||
let keys = "mode";
|
||||
return Err(format!("unknown parameter `{key}`; the command takes: {keys}"));
|
||||
}
|
||||
match m.get("mode").map(Value::as_str) {
|
||||
None | Some(Some("replace")) => false,
|
||||
Some(Some("append")) => true,
|
||||
Some(_) => return Err("mode must be replace or append".into()),
|
||||
}
|
||||
}
|
||||
got => return Err(format!("the params must be an object, not {got}")),
|
||||
};
|
||||
if app.ui.recording.is_some() {
|
||||
return Err("an action is already recording".into());
|
||||
}
|
||||
if app.ui.action_playing.is_some() {
|
||||
return Err("an action is already playing".into());
|
||||
}
|
||||
let sets = default_sets();
|
||||
if append {
|
||||
let first = app.ui.action_sets.len();
|
||||
for mut set in sets {
|
||||
set.name = files::free_set_name(&app.ui.action_sets, &set.name);
|
||||
app.ui.action_sets.push(set);
|
||||
}
|
||||
return Ok(json!({ "changed": true, "mode": "append", "set": first }));
|
||||
}
|
||||
let ctx = app.ui_ctx.clone();
|
||||
let panel_clear = ctx.as_ref().is_none_or(|ctx| {
|
||||
pstate::<Option<(usize, usize)>>(ctx, SELECTED).is_none()
|
||||
&& pstate::<Option<(u64, usize)>>(ctx, SELECTED_STEP).is_none()
|
||||
&& pstate::<Option<DraggedStep>>(ctx, DRAGGED_STEP).is_none()
|
||||
&& pstate::<BTreeSet<u64>>(ctx, EXPANDED).is_empty()
|
||||
});
|
||||
// The ids are not saved, so two lists that save alike hold the same sets.
|
||||
let built_in = serde_json::to_value(&app.ui.action_sets).is_ok_and(|now| serde_json::to_value(&sets).is_ok_and(|new| new == now));
|
||||
let shown_as_reset = app.ui.action_set == Some(0) && app.ui.action_sets_selected == [0] && !app.ui.dialog.as_ref().is_some_and(holds_set);
|
||||
if built_in && shown_as_reset && panel_clear {
|
||||
return Ok(json!({ "changed": false, "mode": "replace", "set": 0 }));
|
||||
}
|
||||
app.ui.action_sets = sets;
|
||||
app.ui.action_set = Some(0);
|
||||
app.ui.action_sets_selected = vec![0];
|
||||
if app.ui.dialog.as_ref().is_some_and(holds_set) {
|
||||
app.ui.dialog = None;
|
||||
}
|
||||
if let Some(ctx) = ctx {
|
||||
set_pstate::<Option<(usize, usize)>>(&ctx, SELECTED, None);
|
||||
set_pstate::<Option<(u64, usize)>>(&ctx, SELECTED_STEP, None);
|
||||
set_pstate::<Option<DraggedStep>>(&ctx, DRAGGED_STEP, None);
|
||||
set_pstate(&ctx, EXPANDED, BTreeSet::<u64>::new());
|
||||
}
|
||||
Ok(json!({ "changed": true, "mode": "replace", "set": 0 }))
|
||||
}
|
||||
|
||||
/// The panel's (≡) menu.
|
||||
pub fn menu(app: &mut VectorcraftApp, ui: &mut egui::Ui) {
|
||||
// Button Mode is off while an action records, so the Stop button the list shows stays in reach.
|
||||
@@ -2239,6 +2314,10 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut egui::Ui) {
|
||||
app.status(e);
|
||||
}
|
||||
}
|
||||
// Asks first: OK replaces the sets with the built-in set, Append adds it after them.
|
||||
if widgets::menu_item(ui, tl!("Reset Actions"), !recording && app.ui.action_playing.is_none(), false) {
|
||||
crate::dialogs::confirm::ask_reset_actions(app);
|
||||
}
|
||||
}
|
||||
|
||||
fn inclusion_box(
|
||||
@@ -3744,6 +3823,170 @@ mod tests {
|
||||
assert_eq!(app.ui.dialog.as_ref().map(|d| d.fields["set"].clone()), Some(json!(3)), "Set Options still on Other");
|
||||
}
|
||||
|
||||
/// The sets as Save Actions… writes them, without the ids.
|
||||
fn saved_sets(sets: &[ActionSet]) -> Value {
|
||||
serde_json::to_value(sets).unwrap()
|
||||
}
|
||||
|
||||
/// A click on the panel menu's Reset Actions.
|
||||
fn menu_reset(ctx: &egui::Context, app: &mut VectorcraftApp) {
|
||||
use super::super::tests_appearance::{click, frame_events};
|
||||
let texts = frame_events(ctx, app, vec![], menu);
|
||||
let item = texts.iter().find(|(s, _)| s.trim() == "Reset Actions").map(|(_, r)| *r).expect("Reset Actions in the menu");
|
||||
click(ctx, app, item.center(), menu);
|
||||
}
|
||||
|
||||
/// The panel menu's Reset Actions asks before it changes anything, also with no current set,
|
||||
/// and does nothing while an action records or plays, waiting at a stop included.
|
||||
#[test]
|
||||
fn the_panel_menus_reset_actions_asks_first_and_is_off_while_an_action_runs() {
|
||||
let mut app = app_with_sets();
|
||||
let ctx = egui::Context::default();
|
||||
let before = saved_sets(&app.ui.action_sets);
|
||||
menu_reset(&ctx, &mut app);
|
||||
let d = app.ui.dialog.as_ref().expect("Reset Actions asks first, with no current set too");
|
||||
assert_eq!((d.kind.as_str(), d.bool("append")), (crate::dialogs::confirm::RESET_ACTIONS, false));
|
||||
assert_eq!(saved_sets(&app.ui.action_sets), before, "asking changes no set");
|
||||
app.ui.dialog = None;
|
||||
|
||||
app.run("file.new", json!({"width": 200, "height": 100})).unwrap();
|
||||
app.run(START_RECORDING, json!({})).unwrap();
|
||||
menu_reset(&ctx, &mut app);
|
||||
assert!(app.ui.dialog.is_none(), "off while an action records");
|
||||
app.run(STOP_RECORDING, json!({})).unwrap();
|
||||
|
||||
let (mut app, _) = app_with_a_stop(true);
|
||||
play(&mut app, 0, 0).unwrap();
|
||||
assert!(waiting_at_stop(&app));
|
||||
app.ui.dialog = None;
|
||||
menu_reset(&ctx, &mut app);
|
||||
assert!(app.ui.dialog.is_none(), "off while playback waits at a stop");
|
||||
}
|
||||
|
||||
/// `ui.actionSet.reset` replaces every set, edited ones included, with the built-in set, makes it
|
||||
/// current and selected, clears the panel's selected action and step, expanded actions and a
|
||||
/// dragged step, closes a dialog that holds a set index, and records no undo step.
|
||||
#[test]
|
||||
fn reset_replaces_every_set_with_the_built_in_set_and_clears_what_named_the_old_ones() {
|
||||
let mut app = app_with_sets();
|
||||
app.run("file.new", json!({"width": 200, "height": 100})).unwrap();
|
||||
app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 20, "height": 20})).unwrap();
|
||||
let undo = undo_steps(&app);
|
||||
app.ui.action_sets[0].name = "Renamed".into();
|
||||
app.ui.action_sets[0].actions.pop();
|
||||
app.ui.action_set = Some(2);
|
||||
app.ui.action_sets_selected = vec![1, 2];
|
||||
let ctx = egui::Context::default();
|
||||
app.ui_ctx = Some(ctx.clone());
|
||||
let nudge = app.ui.action_sets[1].actions[1].id;
|
||||
set_pstate::<Option<(usize, usize)>>(&ctx, "actions-selected", Some((1, 1)));
|
||||
set_pstate::<Option<(u64, usize)>>(&ctx, SELECTED_STEP, Some((nudge, 0)));
|
||||
set_pstate(&ctx, "actions-expanded", BTreeSet::from([nudge]));
|
||||
let dragged: DraggedStep = (nudge, 0, std::sync::Arc::new((vec![], BTreeSet::new())));
|
||||
set_pstate::<Option<DraggedStep>>(&ctx, DRAGGED_STEP, Some(dragged));
|
||||
crate::dialogs::action_batch::open(&mut app, 1, 1).unwrap();
|
||||
|
||||
assert_eq!(app.run(RESET, json!({})).unwrap(), json!({"changed": true, "mode": "replace", "set": 0}));
|
||||
assert_eq!(saved_sets(&app.ui.action_sets), saved_sets(&default_sets()), "only the built-in set, as it comes");
|
||||
assert_eq!((app.ui.action_set, app.ui.action_sets_selected.clone()), (Some(0), vec![0]), "it is current and selected");
|
||||
assert_eq!(pstate::<Option<(usize, usize)>>(&ctx, "actions-selected"), None);
|
||||
assert_eq!(pstate::<Option<(u64, usize)>>(&ctx, SELECTED_STEP), None);
|
||||
assert!(pstate::<BTreeSet<u64>>(&ctx, "actions-expanded").is_empty());
|
||||
assert!(pstate::<Option<DraggedStep>>(&ctx, DRAGGED_STEP).is_none());
|
||||
assert!(app.ui.dialog.is_none(), "the Batch dialog of a replaced set closes");
|
||||
assert_eq!(undo_steps(&app), undo, "no undo step");
|
||||
|
||||
app.ui.action_sets.clear();
|
||||
app.ui.action_set = None;
|
||||
assert_eq!(app.run(RESET, Value::Null).unwrap(), json!({"changed": true, "mode": "replace", "set": 0}), "from no sets");
|
||||
assert_eq!(saved_sets(&app.ui.action_sets), saved_sets(&default_sets()));
|
||||
assert_eq!(app.ui.action_set, Some(0));
|
||||
}
|
||||
|
||||
/// Reset Actions on the built-in set as it comes still makes it current when no set is, and
|
||||
/// changes nothing, ids included, once the panel shows it as a reset leaves it.
|
||||
#[test]
|
||||
fn reset_on_the_built_in_set_makes_it_current_then_changes_nothing() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
assert_eq!(app.ui.action_set, None, "a new app has no current set");
|
||||
let ctx = egui::Context::default();
|
||||
app.ui_ctx = Some(ctx.clone());
|
||||
assert_eq!(app.run(RESET, json!({"mode": "replace"})).unwrap()["changed"], true, "the set becomes current");
|
||||
assert_eq!((app.ui.action_set, app.ui.action_sets_selected.clone()), (Some(0), vec![0]));
|
||||
let ids = (app.ui.action_sets[0].id, app.ui.action_sets[0].actions.iter().map(|a| a.id).collect::<Vec<_>>());
|
||||
assert_eq!(app.run(RESET, json!({})).unwrap(), json!({"changed": false, "mode": "replace", "set": 0}));
|
||||
assert_eq!((app.ui.action_sets[0].id, app.ui.action_sets[0].actions.iter().map(|a| a.id).collect()), ids, "the ids stay");
|
||||
set_pstate(&ctx, "actions-expanded", BTreeSet::from([ids.1[0]]));
|
||||
assert_eq!(app.run(RESET, json!({})).unwrap()["changed"], true, "an expanded action is collapsed");
|
||||
crate::dialogs::action_set_options::open(&mut app, 0);
|
||||
assert_eq!(app.run(RESET, json!({})).unwrap()["changed"], true, "Set Options for the set closes");
|
||||
assert!(app.ui.dialog.is_none());
|
||||
}
|
||||
|
||||
/// Append adds a copy of the built-in set after the sets there are, with the first free number,
|
||||
/// and keeps every set, the current set, the selection and an open dialog as they are.
|
||||
#[test]
|
||||
fn reset_append_adds_the_built_in_set_with_a_free_number_and_keeps_the_rest() {
|
||||
let mut app = app_with_sets();
|
||||
app.ui.action_sets[0].actions.pop();
|
||||
app.ui.action_sets[2].name = "Default Actions 3".into();
|
||||
let ctx = egui::Context::default();
|
||||
app.ui_ctx = Some(ctx.clone());
|
||||
set_pstate::<Option<(usize, usize)>>(&ctx, "actions-selected", Some((1, 1)));
|
||||
let before = saved_sets(&app.ui.action_sets);
|
||||
assert_eq!(app.run(RESET, json!({"mode": "append"})).unwrap(), json!({"changed": true, "mode": "append", "set": 3}));
|
||||
assert_eq!(set_names(&app), ["Default Actions", "Mine", "Default Actions 3", "Default Actions 2"]);
|
||||
assert_eq!(saved_sets(&app.ui.action_sets[..3]), before, "the sets there were stay as they were");
|
||||
assert_eq!(saved_sets(&app.ui.action_sets[3..])[0]["actions"], saved_sets(&default_sets())[0]["actions"], "the built-in actions");
|
||||
assert_eq!(app.ui.action_set, None, "still no current set");
|
||||
assert_eq!(pstate::<Option<(usize, usize)>>(&ctx, "actions-selected"), Some((1, 1)), "the selection stays");
|
||||
app.ui.action_set = Some(1);
|
||||
app.ui.action_sets_selected = vec![1];
|
||||
crate::dialogs::action_batch::open(&mut app, 1, 0).unwrap();
|
||||
assert_eq!(app.run(RESET, json!({"mode": "append"})).unwrap()["set"], 4);
|
||||
assert_eq!(set_names(&app)[4], "Default Actions 4");
|
||||
assert_eq!((app.ui.action_set, app.ui.action_sets_selected.clone()), (Some(1), vec![1]), "the current set stays");
|
||||
assert!(app.ui.dialog.as_ref().is_some_and(|d| d.kind == crate::dialogs::action_batch::KIND), "the Batch dialog stays open");
|
||||
}
|
||||
|
||||
/// `ui.actionSet.reset` refuses params that are not an object, another key or mode, and a reset
|
||||
/// while an action records or plays, waiting at a stop included, and then changes nothing.
|
||||
#[test]
|
||||
fn reset_refuses_bad_params_and_a_running_action_and_changes_nothing() {
|
||||
let mut app = app_with_sets();
|
||||
let before = saved_sets(&app.ui.action_sets);
|
||||
for (p, error) in [
|
||||
(json!(1), "the params must be an object, not 1"),
|
||||
(json!("append"), "the params must be an object, not \"append\""),
|
||||
(json!([]), "the params must be an object, not []"),
|
||||
(json!({"mode": null}), "mode must be replace or append"),
|
||||
(json!({"mode": 1}), "mode must be replace or append"),
|
||||
(json!({"mode": "clear"}), "mode must be replace or append"),
|
||||
(json!({"mode": "append", "set": 0}), "unknown parameter `set`; the command takes: mode"),
|
||||
] {
|
||||
assert_eq!(app.run(RESET, p.clone()).unwrap_err(), error, "{p}");
|
||||
assert_eq!(saved_sets(&app.ui.action_sets), before, "{p} changes nothing");
|
||||
assert_eq!(app.ui.action_set, None);
|
||||
}
|
||||
|
||||
app.run("file.new", json!({"width": 200, "height": 100})).unwrap();
|
||||
app.run(START_RECORDING, json!({})).unwrap();
|
||||
for mode in ["replace", "append"] {
|
||||
assert_eq!(app.run(RESET, json!({ "mode": mode })).unwrap_err(), "an action is already recording");
|
||||
}
|
||||
assert_eq!(saved_sets(&app.ui.action_sets), before, "a recording keeps its set");
|
||||
app.run(STOP_RECORDING, json!({})).unwrap();
|
||||
|
||||
let (mut app, _) = app_with_a_stop(true);
|
||||
let before = saved_sets(&app.ui.action_sets);
|
||||
play(&mut app, 0, 0).unwrap();
|
||||
assert!(waiting_at_stop(&app));
|
||||
for mode in ["replace", "append"] {
|
||||
assert_eq!(app.run(RESET, json!({ "mode": mode })).unwrap_err(), "an action is already playing");
|
||||
}
|
||||
assert_eq!(saved_sets(&app.ui.action_sets), before, "the playing set stays");
|
||||
}
|
||||
|
||||
/// A recording keeps its steps when a canceled undo group drops journal entries made before the
|
||||
/// recording began.
|
||||
#[test]
|
||||
|
||||
@@ -275,7 +275,7 @@ pub fn read_set(text: &str, name: &str) -> Result<ActionSet, String> {
|
||||
}
|
||||
|
||||
/// `name`, else `name 2`, `name 3` … : the first that no set in `sets` has.
|
||||
fn free_set_name(sets: &[ActionSet], name: &str) -> String {
|
||||
pub(super) fn free_set_name(sets: &[ActionSet], name: &str) -> String {
|
||||
let taken = |n: &str| sets.iter().any(|s| s.name == n);
|
||||
if !taken(name) {
|
||||
return name.to_string();
|
||||
|
||||
+11
@@ -3967,6 +3967,17 @@ already walks Image Trace. Short agent entry points:
|
||||
" copy" added, a copied set gets an id of its own, and the copy is selected. An index past the last set or action is an error,
|
||||
and so is a copy that would give its set more than 1,000 actions or a file larger than 8 MiB; then nothing is copied. The
|
||||
panel menu's Duplicate runs this for the selected action, else the current set.
|
||||
`ui.actionSet.reset {mode?: "replace" | "append"}` is Reset Actions, and returns `{changed, mode, set}` (`set` is
|
||||
the index of the first built-in set). `replace`, the default, replaces every set in the panel with a new copy of
|
||||
VectorCraft's built-in Default Actions set, makes it current and selected, clears the panel's selected action and
|
||||
step and its expanded actions, and closes an open Set Options, New Action, Batch or step dialog that names a set;
|
||||
when the panel already shows only the built-in set as it comes in that state, nothing changes, the sets keep their
|
||||
ids and `changed` is false. `append` adds a new copy of the built-in set after the sets there are, with the
|
||||
next free number when its name is in use (`Default Actions 2`), and keeps the current set and the selection.
|
||||
Omitted params count as `{}`. Params of another type, another key, another `mode`, or a reset while an action
|
||||
records or plays (also while it waits at a stop) is an error and changes nothing. Reset records no undo step. The panel menu's Reset
|
||||
Actions is disabled while an action records or plays; it opens a `resetActions` question (fields `message`,
|
||||
`detail`, `append`): OK runs this with `replace`, Append with `append`, and `ui.dialog.cancel` changes nothing.
|
||||
- Image Trace: `imageTrace.presets`, `imageTrace.make {id?, preset?, params?, view?}` (or `imageTrace.makeAndExpand`),
|
||||
`imageTrace.setView`, `imageTrace.expand`, `imageTrace.release`. A key inside `params` that is not one of the trace
|
||||
settings, such as `colours`, is an error that names it and the nearest setting (`colors`), as for a command's own keys.
|
||||
|
||||
@@ -850,6 +850,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- Actions panel: the panel menu's Select Object… opens Set Selection, where the note typed names the objects to select, and adds a step to the recording in progress, after the selected step, or at the end of the selected action; playback selects the objects whose Attributes note matches it, and the steps after it act on them ([Insert non-recordable tasks into actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/insert-non-recordable-tasks-into-actions.html); `ui.action.insertSelectObject`, `select.byNote`). VectorCraft's own rules, which the page does not cover: the note matches anywhere and in any letter case unless Case Sensitive or Whole Word is checked, hidden and locked objects are left out, the objects found replace the selection, a step that finds none stops the playback with an error, and the note is at most 1,024 bytes. Action sets with the step save as version 4.
|
||||
- Actions panel: Delete Selection deletes the selected action set with its actions and keeps the other sets ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.delete`). VectorCraft's own rules, which the overview does not cover: deleting a set asks first, Shift-click on a set's name selects a range of sets to delete together, the panel menu's Delete does the same, and Default Actions and the last set can be deleted. Undo does not bring a deleted set back.
|
||||
- Actions panel: the panel menu's Duplicate copies the selected action, else the current action set with all its actions ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.duplicate`). VectorCraft's own rules, which the overview does not cover: the copy goes right after the original, is named after it with " copy" added and is selected.
|
||||
- Actions panel: the panel menu's Reset Actions asks first; OK replaces the sets in the panel with the default set, and Append adds the default set after them ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html); `ui.actionSet.reset`). VectorCraft's own rules, which the page does not cover: the default set is VectorCraft's own Default Actions set; after OK it is current and selected, and no action or step is selected; Append names its copy with the next free number (`Default Actions 2`) and keeps the current set; Cancel changes nothing; the item is off while an action records or plays, waiting at a stop included; Undo does not bring the old sets back. Tests `panels::actions::tests::{the_panel_menus_reset_actions_asks_first_and_is_off_while_an_action_runs, reset_replaces_every_set_with_the_built_in_set_and_clears_what_named_the_old_ones, reset_on_the_built_in_set_makes_it_current_then_changes_nothing, reset_append_adds_the_built_in_set_with_a_free_number_and_keeps_the_rest, reset_refuses_bad_params_and_a_running_action_and_changes_nothing}`, `dialogs::tests::reset_actions_ok_replaces_append_adds_and_cancel_keeps_the_sets`.
|
||||
- Batch… over data sets names each file after the document and the data set (`action.batch`). It writes `/`, `\`, `:`, `<`, `>`, `"`, `|`, `?`, `*` and control characters in the data set's name as `-`, and adds `-2`, `-3`… to a name an earlier data set used.
|
||||
- Batch… offers File + Number, File + Data Set Name, and Data Set Name for a Data Sets source. The dialog defaults to File + Number; `action.batch` without `datasetFileNaming` keeps File + Data Set Name. An output already in a destination folder the batch may read and write gets the next free `-2`, `-3` suffix. [Batch options](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/batch-options.html).
|
||||
- The Batch dialog shows its data set File Name row only when Destination is Folder, and keeps the choice while another destination is picked. With None or Save and Close it does not send `datasetFileNaming`.
|
||||
|
||||
+2
-1
@@ -419,7 +419,8 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po
|
||||
| Live trace result bounds and selection highlights exclude the retained bitmap; source-image views retain it | done | All TraceView modes and rotated result bounds regression-covered; ordinary hidden group behavior retained |
|
||||
| Image Trace panel: the Preview checkbox before Trace chooses whether a setting change traces the selected Image Trace object again at once | done | Per the public documentation, Preview shows the result of the current settings and Trace traces with them (<https://web.archive.org/web/20250831090623/https://helpx.adobe.com/illustrator/using/image-trace.html>). Preview is on by default and kept with the UI preferences; Reset to Default leaves it. Off, changes wait in the panel until Trace applies them as one undo step, or until Preview is turned on again. Changes stay with the object they were made for while another object is selected, and come back when it is selected again. `imageTrace.preview {on?}`, `ui.set {imageTracePreview}`; `panels/image_trace.rs` headless tests (`with_preview_off_a_slider_change_waits_for_trace`, `turning_preview_on_traces_the_changes_that_waited`, `preview_turned_on_with_nothing_selected_traces_when_the_object_is_selected_again`, `settings_that_wait_stay_with_their_object`, `settings_that_wait_come_back_when_their_object_is_selected_again`, `settings_that_wait_are_dropped_when_their_object_changed_since`, `preview_is_kept_with_the_preferences_and_reset_to_default_leaves_it`) |
|
||||
| Toolbar without group labels by default, one or two columns; All Tools drawer by flyout group with shortcuts, its menu (Reset, Basic, Advanced) and Show section | done | #1751; a preference brings the labels back; `toolbar.show` sets the Fill/Stroke, Coloring, Draw Mode and Screen Mode controls |
|
||||
| Actions panel: ≡ › Save Actions… saves the current set with all its actions to a file and ≡ › Load Actions… adds a saved set ([Manage a set of actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html)) | partial | `ui.actionSet.save`, `ui.actionSet.load`; `panels/actions.rs` tests. The file is VectorCraft's own `.vcactions` JSON; Reset, Clear and Replace Actions remain |
|
||||
| Actions panel: ≡ › Save Actions… saves the current set with all its actions to a file and ≡ › Load Actions… adds a saved set ([Manage a set of actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html)) | partial | `ui.actionSet.save`, `ui.actionSet.load`; `panels/actions.rs` tests. The file is VectorCraft's own `.vcactions` JSON; Clear and Replace Actions remain |
|
||||
| Actions panel: ≡ › Reset Actions asks first; OK replaces the sets in the panel with the default set and Append adds the default set after them ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html)) | done | `ui.actionSet.reset`; `panels/actions.rs` and `dialogs/tests.rs` tests. The default set is VectorCraft's own Default Actions set |
|
||||
| Actions panel: ≡ › Load Actions… also reads action sets saved as `.aia` files ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `actionSet.read`, `ui.actionSet.load`; `tests/actionset.rs`, `panels/actions.rs` tests, `import_fuzz`. Steps with a label and no recorded values come in as menu commands that run with no values and open no dialog, matched by label, and Set Selection steps come in as Select Object steps; the other steps, recorded menu items included, are left out and counted |
|
||||
| Actions panel: ≡ › Action Options… renames the selected action and sets its function key and color ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `ui.action.options`; `panels/actions.rs` tests (part of #1629). Button Mode shows the color |
|
||||
| Actions panel: ≡ › Button Mode shows each action by name as a button in its Action Options color, without sets or steps; a click on a button plays the action, and choosing Button Mode again shows the list ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | done | `ui.action.buttonMode`, `ui.action.playAt`; `panels/actions.rs` tests. VectorCraft's own rules: every set's actions show in set order, an action without a color is an ordinary button, the mode is kept with the UI preferences, and it cannot be turned on while an action records |
|
||||
|
||||
Reference in New Issue
Block a user