Merge pull request #7126 from dotCooCoo/fix/status-notes-copy-cut-trace

Status bar: Copy, Cut and Image Trace count their notes and list them on hover
This commit is contained in:
BFlat
2026-11-18 10:22:01 +07:00
committed by GitHub
43 changed files with 416 additions and 43 deletions
+38 -10
View File
@@ -252,9 +252,7 @@ impl VectorcraftApp {
{
self.last_pathfinder = Some(op.to_string());
}
if r.is_ok() && matches!(id, "edit.copy" | "edit.cut" | "artboard.copy" | "artboard.cut") {
self.publish_clipboard();
}
let copied = r.is_ok() && self.publish_copy(id);
self.sync_views();
self.refresh_replace_font_warning(false);
// File › Revert replaces the document in its tab, keeps the tab's view and starts the tool afresh.
@@ -262,16 +260,13 @@ impl VectorcraftApp {
match &r {
Err(e) => self.ui.status = e.clone(),
Ok(v) => {
// Image Trace's notes (a large image traces more slowly, or was scaled down).
if id.starts_with("imageTrace.make")
&& let Some(w) = v["warnings"].as_array().and_then(|w| w.first()).and_then(Value::as_str)
{
self.ui.status = w.to_string();
if matches!(id, "imageTrace.make" | "imageTrace.makeAndExpand") {
self.show_trace_notes(v);
}
// A renamed spot color swatch stays the Color Guide's base; a deleted one ends the link.
panels::color_guide::after_command(self, id, &params, v, spot_base);
if id == "file.new" {
self.ui.status.clear();
self.status("");
// New Document's Pixel preview mode (Overprint Preview is the engine's).
if v["previewMode"] == "pixel" {
self.ui.view.pixel_preview = true;
@@ -280,7 +275,7 @@ impl VectorcraftApp {
// Choosing a data set, or stepping to one, clears the status bar. The reply's `warning`
// below then shows when no object is bound to a variable the data set has a value for.
if matches!(id, "dataset.select" | "dataset.next" | "dataset.prev") {
self.ui.status.clear();
self.status("");
}
// A font applied with Character's font menu or Find Font's Change becomes the newest recent font.
// Find Font's Change records the family the text now carries (any name of it is stored as its
@@ -312,9 +307,42 @@ impl VectorcraftApp {
}
}
}
// The message the Copy or Cut leaves is the one its clipboard formats' notes may replace.
if copied {
self.clipboard_publishing.ran_with_status(&self.ui);
}
r
}
/// After a Copy or Cut `id` that ran: offer what it copied to other apps
/// ([`Self::publish_clipboard`]) → whether `id` is one.
fn publish_copy(&mut self, id: &str) -> bool {
let copy = matches!(id, "edit.copy" | "edit.cut" | "artboard.copy" | "artboard.cut");
if copy {
self.publish_clipboard(matches!(id, "edit.cut" | "artboard.cut"));
}
copy
}
/// Image Trace's notes in `reply` (a large image traces more slowly, or was scaled down): the
/// first of them and how many there are, with the rest for the message's hover. A trace that
/// made no paths shows its first note as it is. Without notes, the message an earlier trace's
/// notes left is cleared while nothing has set the status since, and any other message stays.
fn show_trace_notes(&mut self, reply: &Value) {
let notes = io::notes_of(reply);
let left = self.trace_runs.notes_status.take();
let Some(first) = notes.first() else {
io::clear_notes_left(self, left);
return;
};
let status = match reply["paths"].as_u64() {
Some(0) => first.clone(),
_ => crate::trace_runs::traced_with_notes(notes.len(), first),
};
io::show_with_notes(self, status, notes);
self.trace_runs.notes_status = Some((self.ui.status.clone(), self.ui.status_sets));
}
fn set_command_warning(&mut self, id: &str, warning: &str) {
self.ui.status = warning.to_string();
if id != "text.replaceFont" {
+1 -1
View File
@@ -2106,7 +2106,7 @@ fn set_ui(app: &mut VectorcraftApp, req: &ControlRequest) -> Outcome {
r = app.run("window.panel", json!({"panel": pn}));
}
if let Some(st) = s("status") {
app.ui.status = st.to_string();
app.status(st);
}
for (k, flag) in [
("rulers", "view.rulers"),
+3
View File
@@ -5059,6 +5059,9 @@ axis Both И двете
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Изхвърлен е {n} възстановен документ|Изхвърлени са {n} възстановени документа
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Възстановен е {n} документ: запазете го, за да го съхраните|Възстановени са {n} документа: запазете ги, за да ги съхраните
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Отворено с {n} бележка: {first}|Отворено с {n} бележки: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Копирано с {n} бележка: {first}|Копирано с {n} бележки: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Изрязано с {n} бележка: {first}|Изрязано с {n} бележки: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Трасирано с {n} бележка: {first}|Трасирано с {n} бележки: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Отворено с {n} бележка: {first}|{notice}. Отворено с {n} бележки: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} е запазен с {n} бележка: {first}|{path} е запазен с {n} бележки: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Вградено е {n} изображение; {missing} липсват: първо ги свържете наново|Вградени са {n} изображения; {missing} липсват: първо ги свържете наново
Can't render this file because it is too large.
+3
View File
@@ -5483,6 +5483,9 @@ imageTrace Outline Obris
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Odbačen {n} oporavljeni dokument|Odbačena {n} oporavljena dokumenta|Odbačeno {n} oporavljenih dokumenata
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Vraćen {n} oporavljeni dokument; sačuvajte ga da ga zadržite|Vraćena {n} oporavljena dokumenta; sačuvajte ih da ih zadržite|Vraćeno {n} oporavljenih dokumenata; sačuvajte ih da ih zadržite
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Otvoreno s {n} bilješkom: {first}|Otvoreno s {n} bilješke: {first}|Otvoreno s {n} bilješki: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Kopirano s {n} bilješkom: {first}|Kopirano s {n} bilješke: {first}|Kopirano s {n} bilješki: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Izrezano s {n} bilješkom: {first}|Izrezano s {n} bilješke: {first}|Izrezano s {n} bilješki: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Slika praćena s {n} bilješkom: {first}|Slika praćena s {n} bilješke: {first}|Slika praćena s {n} bilješki: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Otvoreno s {n} bilješkom: {first}|{notice}. Otvoreno s {n} bilješke: {first}|{notice}. Otvoreno s {n} bilješki: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Sačuvano {path} s {n} bilješkom: {first}|Sačuvano {path} s {n} bilješke: {first}|Sačuvano {path} s {n} bilješki: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Ugrađena je {n} slika; nedostaje {missing}: prvo ih ponovo povežite|Ugrađene su {n} slike; nedostaje {missing}: prvo ih ponovo povežite|Ugrađeno je {n} slika; nedostaje {missing}: prvo ih ponovo povežite
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -6502,6 +6502,9 @@ liquify-list-end {0}, {1} {0} i {1}
@msg Saved to User Defined: {_1} Desat a User Defined: {_1}
@msg Saved {n} files beside {path} S’han desat {n} fitxers al costat de {path}
@msg Saved {path} Desat {path}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} S’ha copiat amb {n} nota: {first}|S’ha copiat amb {n} notes: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} S’ha retallat amb {n} nota: {first}|S’ha retallat amb {n} notes: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} S’ha traçat la imatge amb {n} nota: {first}|S’ha traçat la imatge amb {n} notes: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} S’ha desat {path} amb {n} nota: {first}|S’ha desat {path} amb {n} notes: {first}
@msg Saving S’està desant
@msg Saving recovery data for {_1} S’estan desant les dades de recuperació de {_1}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -5795,6 +5795,9 @@ variable-list-end {0}, {1} {0} a {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Zahozen {n} obnovený dokument|Zahozeny {n} obnovené dokumenty|Zahozeno {n} obnovených dokumentů
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Obnoven {n} dokument; pokud ho chcete zachovat, uložte ho|Obnoveny {n} dokumenty; pokud je chcete zachovat, uložte je|Obnoveno {n} dokumentů; pokud je chcete zachovat, uložte je
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Otevřeno, {n} poznámka: {first}|Otevřeno, {n} poznámky: {first}|Otevřeno, {n} poznámek: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Zkopírováno, {n} poznámka: {first}|Zkopírováno, {n} poznámky: {first}|Zkopírováno, {n} poznámek: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Vyjmuto, {n} poznámka: {first}|Vyjmuto, {n} poznámky: {first}|Vyjmuto, {n} poznámek: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Obraz vektorizován, {n} poznámka: {first}|Obraz vektorizován, {n} poznámky: {first}|Obraz vektorizován, {n} poznámek: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Otevřeno, {n} poznámka: {first}|{notice}. Otevřeno, {n} poznámky: {first}|{notice}. Otevřeno, {n} poznámek: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Uloženo: {path}, {n} poznámka: {first}|Uloženo: {path}, {n} poznámky: {first}|Uloženo: {path}, {n} poznámek: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Vložen {n} obrázek; chybí {missing}: nejprve je znovu propojte|Vloženy {n} obrázky; chybí {missing}: nejprve je znovu propojte|Vloženo {n} obrázků; chybí {missing}: nejprve je znovu propojte
Can't render this file because it is too large.
+3
View File
@@ -7911,6 +7911,9 @@ imageTrace Outline Kontur
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Kasserede {n} gendannet dokument|Kasserede {n} gendannede dokumenter
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Gendannede {n} dokument: gem det for at beholde det|Gendannede {n} dokumenter: gem dem for at beholde dem
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Åbnede med {n} note: {first}|Åbnede med {n} noter: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Kopierede med {n} note: {first}|Kopierede med {n} noter: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Klippede med {n} note: {first}|Klippede med {n} noter: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Sporede billedet med {n} note: {first}|Sporede billedet med {n} noter: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Åbnede med {n} note: {first}|{notice}. Åbnede med {n} noter: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Gemte {path} med {n} note: {first}|Gemte {path} med {n} noter: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Indlejrede {n} billede; {missing} mangler: link dem igen først|Indlejrede {n} billeder; {missing} mangler: link dem igen først
Can't render this file because it is too large.
+3
View File
@@ -5399,6 +5399,9 @@ variable-list-end {0}, {1} {0} und {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents {n} wiederhergestelltes Dokument verworfen|{n} wiederhergestellte Dokumente verworfen
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them {n} wiederhergestelltes Dokument geöffnet: Speichern Sie es, um es zu behalten|{n} wiederhergestellte Dokumente geöffnet: Speichern Sie sie, um sie zu behalten
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Mit {n} Hinweis geöffnet: {first}|Mit {n} Hinweisen geöffnet: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Mit {n} Hinweis kopiert: {first}|Mit {n} Hinweisen kopiert: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Mit {n} Hinweis ausgeschnitten: {first}|Mit {n} Hinweisen ausgeschnitten: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Mit {n} Hinweis nachgezeichnet: {first}|Mit {n} Hinweisen nachgezeichnet: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Mit {n} Hinweis geöffnet: {first}|{notice}. Mit {n} Hinweisen geöffnet: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} mit {n} Hinweis gespeichert: {first}|{path} mit {n} Hinweisen gespeichert: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first {n} Bild eingebettet; {missing} fehlen: Verknüpfen Sie sie zuerst neu|{n} Bilder eingebettet; {missing} fehlen: Verknüpfen Sie sie zuerst neu
Can't render this file because it is too large.
+3
View File
@@ -5450,6 +5450,9 @@ variable-list-end {0}, {1} {0} και {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Απορρίφθηκε {n} ανακτημένο έγγραφο|Απορρίφθηκαν {n} ανακτημένα έγγραφα
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Επαναφέρθηκε {n} ανακτημένο έγγραφο: αποθηκεύστε το για να διατηρηθεί|Επαναφέρθηκαν {n} ανακτημένα έγγραφα: αποθηκεύστε τα για να διατηρηθούν
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Άνοιξε με {n} σημείωση: {first}|Άνοιξε με {n} σημειώσεις: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Αντιγράφηκε με {n} σημείωση: {first}|Αντιγράφηκε με {n} σημειώσεις: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Αποκόπηκε με {n} σημείωση: {first}|Αποκόπηκε με {n} σημειώσεις: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Η εικόνα ανιχνεύτηκε με {n} σημείωση: {first}|Η εικόνα ανιχνεύτηκε με {n} σημειώσεις: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Άνοιξε με {n} σημείωση: {first}|{notice}. Άνοιξε με {n} σημειώσεις: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Αποθηκεύτηκε το {path} με {n} σημείωση: {first}|Αποθηκεύτηκε το {path} με {n} σημειώσεις: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Ενσωματώθηκε {n} εικόνα· λείπουν {missing}: επανασυνδέστε τις πρώτα|Ενσωματώθηκαν {n} εικόνες· λείπουν {missing}: επανασυνδέστε τις πρώτα
Can't render this file because it is too large.
+3
View File
@@ -5507,6 +5507,9 @@ variable-list-end {0}, {1} {0} y {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Se descartó {n} documento recuperado|Se descartaron {n} documentos recuperados
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Se restauró {n} documento recuperado: guárdalo para conservarlo|Se restauraron {n} documentos recuperados: guárdalos para conservarlos
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Se abrió con {n} nota: {first}|Se abrió con {n} notas: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Se copió con {n} nota: {first}|Se copió con {n} notas: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Se cortó con {n} nota: {first}|Se cortó con {n} notas: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Se calcó la imagen con {n} nota: {first}|Se calcó la imagen con {n} notas: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Se abrió con {n} nota: {first}|{notice}. Se abrió con {n} notas: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Se guardó {path} con {n} nota: {first}|Se guardó {path} con {n} notas: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Se incrustó {n} imagen; faltan {missing}: vuelve a vincularlas primero|Se incrustaron {n} imágenes; faltan {missing}: vuelve a vincularlas primero
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -5715,6 +5715,9 @@ variable-list-end {0}, {1} {0} ja {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Hylättiin {n} palautettu asiakirja|Hylättiin {n} palautettua asiakirjaa
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Palautettiin {n} asiakirja: tallenna se säilyttääksesi sen|Palautettiin {n} asiakirjaa: tallenna ne säilyttääksesi ne
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Avattiin, {n} huomautus: {first}|Avattiin, {n} huomautusta: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Kopioitiin, {n} huomautus: {first}|Kopioitiin, {n} huomautusta: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Leikattiin, {n} huomautus: {first}|Leikattiin, {n} huomautusta: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Kuva jäljitettiin, {n} huomautus: {first}|Kuva jäljitettiin, {n} huomautusta: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Avattiin, {n} huomautus: {first}|{notice}. Avattiin, {n} huomautusta: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Tallennettiin {path}, {n} huomautus: {first}|Tallennettiin {path}, {n} huomautusta: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Upotettiin {n} kuva; {missing} puuttuu: linkitä ne ensin uudelleen|Upotettiin {n} kuvaa; {missing} puuttuu: linkitä ne ensin uudelleen
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -5460,6 +5460,9 @@ variable-list-end {0}, {1} {0} et {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents {n} document récupéré supprimé|{n} documents récupérés supprimés
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them {n} document récupéré restauré : enregistrez-le pour le conserver|{n} documents récupérés restaurés : enregistrez-les pour les conserver
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Ouvert avec {n} remarque : {first}|Ouvert avec {n} remarques : {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Copié avec {n} remarque : {first}|Copié avec {n} remarques : {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Coupé avec {n} remarque : {first}|Coupé avec {n} remarques : {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Image vectorisée avec {n} remarque : {first}|Image vectorisée avec {n} remarques : {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Ouvert avec {n} remarque : {first}|{notice}. Ouvert avec {n} remarques : {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} enregistré avec {n} remarque : {first}|{path} enregistré avec {n} remarques : {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first {n} image incorporée ; il en manque {missing} : rétablissez d’abord leurs liens|{n} images incorporées ; il en manque {missing} : rétablissez d’abord leurs liens
Can't render this file because it is too large.
+3
View File
@@ -9152,6 +9152,9 @@ variable-list-end {0}, {1} {0} और {1}
@msgplural Relinked {n} image|Relinked {n} images {n} इमेज दोबारा लिंक हुई|{n} इमेज दोबारा लिंक हुईं
@msgplural Replaced {n} image|Replaced {n} images {n} इमेज बदली गई|{n} इमेज बदली गईं
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them {n} रिकवर किया डॉक्यूमेंट बहाल हुआ: रखने के लिए उसे सेव करें|{n} रिकवर किए डॉक्यूमेंट बहाल हुए: रखने के लिए उन्हें सेव करें
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} कॉपी किया गया, {n} नोट के साथ: {first}|कॉपी किया गया, {n} नोट्स के साथ: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} काटा गया, {n} नोट के साथ: {first}|काटा गया, {n} नोट्स के साथ: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} इमेज ट्रेस किया गया, {n} नोट के साथ: {first}|इमेज ट्रेस किया गया, {n} नोट्स के साथ: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} सेव किया गया, {n} नोट के साथ: {first}|{path} सेव किया गया, {n} नोट्स के साथ: {first}
@msgplural Selected {n} embedded image|Selected {n} embedded images {n} एम्बेड की गई इमेज सिलेक्टेड|{n} एम्बेड की गई इमेज सिलेक्टेड
@msgplural Selected {n} image|Selected {n} images {n} इमेज सिलेक्टेड|{n} इमेज सिलेक्टेड
Can't render this file because it is too large.
+3
View File
@@ -6004,6 +6004,9 @@ liquify-list-end {0}, {1} {0} és {1}
@msg Saved to User Defined: {_1} Mentve a felhasználóiak közé: {_1}
@msg Saved {n} files beside {path} Mentett fájlok: {n}, a következő mellett: {path}
@msg Saved {path} Mentve: {path}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Másolva; megjegyzések: {n}, az első: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Kivágva; megjegyzések: {n}, az első: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Kép vektorizálva; megjegyzések: {n}, az első: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Mentve: {path}; megjegyzések: {n}, az első: {first}
@msg Saving Mentés
@msg Saving recovery data for {_1} Helyreállítási adatok mentése: {_1}
Can't render this file because it is too large.
+3
View File
@@ -5147,6 +5147,9 @@ imageTrace Outline Kontur
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents {n} dokumen hasil pemulihan dibuang
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them {n} dokumen hasil pemulihan dipulihkan: simpan agar tidak hilang
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Dibuka dengan {n} catatan: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Disalin dengan {n} catatan: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Dipotong dengan {n} catatan: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Gambar dilacak dengan {n} catatan: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Dibuka dengan {n} catatan: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} disimpan dengan {n} catatan: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first {n} gambar tersemat; {missing} hilang: tautkan ulang dulu
Can't render this file because it contains an unexpected character in line 2521 and column 5.
+3
View File
@@ -5532,6 +5532,9 @@ variable-list-end {0}, {1} {0} e {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Scartato {n} documento recuperato|Scartati {n} documenti recuperati
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Ripristinato {n} documento recuperato. Salvalo per conservarlo|Ripristinati {n} documenti recuperati. Salvali per conservarli
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Aperto con {n} nota: {first}|Aperto con {n} note: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Copiato con {n} nota: {first}|Copiato con {n} note: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Tagliato con {n} nota: {first}|Tagliato con {n} note: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Immagine ricalcata con {n} nota: {first}|Immagine ricalcata con {n} note: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Aperto con {n} nota: {first}|{notice}. Aperto con {n} note: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Salvato {path} con {n} nota: {first}|Salvato {path} con {n} note: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Incorporata {n} immagine; mancanti: {missing} (ricollegale prima)|Incorporate {n} immagini; mancanti: {missing} (ricollegale prima)
Can't render this file because it is too large.
+3
View File
@@ -5654,6 +5654,9 @@ liquify-list-end {0}, {1} {0}、{1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents 復帰用データのドキュメントを {n} 件破棄しました
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them 復帰用データからドキュメントを {n} 件復元しました: 残すには保存してください
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} ドキュメントを開きました (注意 {n} 件): {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} コピーしましたが、注意事項が {n} 件あります: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} 切り取りましたが、注意事項が {n} 件あります: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} 画像をトレースしましたが、注意事項が {n} 件あります: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}。ドキュメントを開きました (注意 {n} 件): {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} を保存しましたが、注意事項が {n} 件あります: {first}
@msg Saving recovery data for {_1} {_1} の復帰用データを保存中
Can't render this file because it is too large.
+3
View File
@@ -7259,6 +7259,9 @@ font-technology Variable ცვლადი
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents უარყოფილია აღდგენილი დოკუმენტები: {n}
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them აღდგენილია დოკუმენტები: {n}: შესანარჩუნებლად შეინახეთ ისინი
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} გაიხსნა, შენიშვნები: {n}: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} კოპირებულია, შენიშვნები: {n}: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} ამოჭრილია, შენიშვნები: {n}: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} გამოსახულება ვექტორიზებულია, შენიშვნები: {n}: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. გაიხსნა, შენიშვნები: {n}: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} შენახულია {path}, შენიშვნები: {n}: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first ჩაშენებულია გამოსახულებები: {n}; აკლია {missing}: ჯერ ხელახლა დააკავშირეთ
Can't render this file because it is too large.
+3
View File
@@ -5581,6 +5581,9 @@ liquify-list-end {0}, {1} {0} 및 {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents 복구된 문서 {n}개를 삭제했습니다
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them 복구된 문서 {n}개를 복원했습니다: 보관하려면 저장하세요
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} 참고 {n}건과 함께 열었습니다: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} 참고 {n}건과 함께 복사했습니다: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} 참고 {n}건과 함께 잘라냈습니다: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} 참고 {n}건과 함께 이미지를 추적했습니다: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. 참고 {n}건과 함께 열었습니다: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} 참고 {n}건과 함께 {path}을(를) 저장했습니다: {first}
@msg Saving recovery data for {_1} {_1}의 복구 데이터를 저장하는 중
Can't render this file because it is too large.
+3
View File
@@ -5784,6 +5784,9 @@ imageTrace Outline Contour
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents {n} hersteld document verworpen|{n} herstelde documenten verworpen
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them {n} hersteld document teruggezet: sla het op om het te behouden|{n} herstelde documenten teruggezet: sla ze op om ze te behouden
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Geopend met {n} opmerking: {first}|Geopend met {n} opmerkingen: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Gekopieerd met {n} opmerking: {first}|Gekopieerd met {n} opmerkingen: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Geknipt met {n} opmerking: {first}|Geknipt met {n} opmerkingen: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Afbeelding getraceerd met {n} opmerking: {first}|Afbeelding getraceerd met {n} opmerkingen: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Geopend met {n} opmerking: {first}|{notice}. Geopend met {n} opmerkingen: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} opgeslagen met {n} opmerking: {first}|{path} opgeslagen met {n} opmerkingen: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first {n} afbeelding ingesloten; {missing} ontbreken: koppel ze eerst opnieuw|{n} afbeeldingen ingesloten; {missing} ontbreken: koppel ze eerst opnieuw
Can't render this file because it is too large.
+3
View File
@@ -5623,6 +5623,9 @@ variable-list-end {0}, {1} {0} i {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Odrzucono {n} odzyskany dokument|Odrzucono {n} odzyskane dokumenty|Odrzucono {n} odzyskanych dokumentów
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Przywrócono {n} odzyskany dokument: zapisz go, aby go zachować|Przywrócono {n} odzyskane dokumenty: zapisz je, aby je zachować|Przywrócono {n} odzyskanych dokumentów: zapisz je, aby je zachować
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Otwarto z {n} uwagą: {first}|Otwarto z {n} uwagami: {first}|Otwarto z {n} uwagami: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Skopiowano z {n} uwagą: {first}|Skopiowano z {n} uwagami: {first}|Skopiowano z {n} uwagami: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Wycięto z {n} uwagą: {first}|Wycięto z {n} uwagami: {first}|Wycięto z {n} uwagami: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Obrysowano obraz z {n} uwagą: {first}|Obrysowano obraz z {n} uwagami: {first}|Obrysowano obraz z {n} uwagami: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Otwarto z {n} uwagą: {first}|{notice}. Otwarto z {n} uwagami: {first}|{notice}. Otwarto z {n} uwagami: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Zapisano {path} z {n} uwagą: {first}|Zapisano {path} z {n} uwagami: {first}|Zapisano {path} z {n} uwagami: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Osadzono {n} obraz; brakuje {missing}: najpierw połącz je ponownie|Osadzono {n} obrazy; brakuje {missing}: najpierw połącz je ponownie|Osadzono {n} obrazów; brakuje {missing}: najpierw połącz je ponownie
Can't render this file because it is too large.
+3
View File
@@ -4792,6 +4792,9 @@ variable-list-end {0}, {1} {0} e {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents {n} documento recuperado descartado|{n} documentos recuperados descartados
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them {n} documento recuperado restaurado: salve-o para mantê-lo|{n} documentos recuperados restaurados: salve-os para mantê-los
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Aberto com {n} observação: {first}|Aberto com {n} observações: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Copiado com {n} observação: {first}|Copiado com {n} observações: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Recortado com {n} observação: {first}|Recortado com {n} observações: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Imagem rastreada com {n} observação: {first}|Imagem rastreada com {n} observações: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Aberto com {n} observação: {first}|{notice}. Aberto com {n} observações: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} salvo com {n} observação: {first}|{path} salvo com {n} observações: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first {n} imagem incorporada; faltam {missing}: revincule-as primeiro|{n} imagens incorporadas; faltam {missing}: revincule-as primeiro
Can't render this file because it is too large.
+3
View File
@@ -5526,6 +5526,9 @@ variable-list-end {0}, {1} {0} и {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Отменён {n} восстановленный документ|Отменено {n} восстановленных документа|Отменено {n} восстановленных документов
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Восстановлен {n} документ: сохраните его, чтобы оставить|Восстановлено {n} документа: сохраните их, чтобы оставить|Восстановлено {n} документов: сохраните их, чтобы оставить
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Открыто с {n} примечанием: {first}|Открыто с {n} примечаниями: {first}|Открыто с {n} примечаниями: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Скопировано с {n} примечанием: {first}|Скопировано с {n} примечаниями: {first}|Скопировано с {n} примечаниями: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Вырезано с {n} примечанием: {first}|Вырезано с {n} примечаниями: {first}|Вырезано с {n} примечаниями: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Изображение трассировано с {n} примечанием: {first}|Изображение трассировано с {n} примечаниями: {first}|Изображение трассировано с {n} примечаниями: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Открыто с {n} примечанием: {first}|{notice}. Открыто с {n} примечаниями: {first}|{notice}. Открыто с {n} примечаниями: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Сохранено: {path} с {n} примечанием: {first}|Сохранено: {path} с {n} примечаниями: {first}|Сохранено: {path} с {n} примечаниями: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Внедрено {n} изображение; отсутствует {missing}: сначала восстановите связи|Внедрено {n} изображения; отсутствует {missing}: сначала восстановите связи|Внедрено {n} изображений; отсутствует {missing}: сначала восстановите связи
Can't render this file because it is too large.
+3
View File
@@ -5387,6 +5387,9 @@ variable-list-end {0}, {1} {0} och {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Kastade {n} återställt dokument|Kastade {n} återställda dokument
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Återställde {n} återskapat dokument: spara det för att behålla det|Återställde {n} återskapade dokument: spara dem för att behålla dem
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Öppnad med {n} anteckning: {first}|Öppnad med {n} anteckningar: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Kopierade med {n} anteckning: {first}|Kopierade med {n} anteckningar: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Klippte ut med {n} anteckning: {first}|Klippte ut med {n} anteckningar: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Kalkerade bilden med {n} anteckning: {first}|Kalkerade bilden med {n} anteckningar: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Öppnad med {n} anteckning: {first}|{notice}. Öppnad med {n} anteckningar: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Sparade {path} med {n} anteckning: {first}|Sparade {path} med {n} anteckningar: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Bäddade in {n} bild; {missing} saknas: länka om dem först|Bäddade in {n} bilder; {missing} saknas: länka om dem först
Can't render this file because it is too large.
+21 -2
View File
@@ -3644,23 +3644,42 @@ const COUNTED_STATUS_MESSAGES: &[(&str, &str)] = &[
("Downloaded 1 file", "Downloaded 2 files"),
("Exported 1 file to /out", "Exported 2 files to /out"),
("Loaded “Tidy”: 1 step was left out", "Loaded “Tidy”: 2 steps were left out"),
("Copied with 1 note: a note", "Copied with 2 notes: a note"),
("Cut with 1 note: a note", "Cut with 2 notes: a note"),
("Traced with 1 note: a note", "Traced with 2 notes: a note"),
(
"Loaded “Tidy”: 1 step has an unknown command and was kept: “Export”, step 4, `example.finish`",
"Loaded “Tidy”: 2 steps have unknown commands and were kept; the first: “Export”, step 4.2, `example.finish`",
),
];
/// The link, font, export and action set status messages name a count of 1 in the singular and other counts in
/// the plural, and every complete catalog translates both, in the form its plural rule picks.
/// The link, font, export, action set, clipboard and Image Trace status messages name a count of 1 in the singular
/// and other counts in the plural, and every complete catalog translates both, in the form its plural rule picks.
#[test]
fn counted_status_messages_take_the_plural_form() {
use crate::panels::links::{relinked_status, updated_status};
use crate::sysclip::copied_with_notes;
use crate::trace_runs::traced_with_notes;
assert_eq!((relinked_status(1), relinked_status(2)), ("Relinked 1 image".to_string(), "Relinked 2 images".to_string()));
assert_eq!((updated_status(1), updated_status(2)), ("Updated 1 image".to_string(), "Updated 2 images".to_string()));
assert_eq!(crate::dialogs::missing_links::changed_on_disk_status(1), COUNTED_STATUS_MESSAGES[2].0);
assert_eq!(crate::dialogs::missing_links::changed_on_disk_status(2), COUNTED_STATUS_MESSAGES[2].1);
assert_eq!(crate::io::exported_with_notes("/out/a.svg", 1, "a note"), COUNTED_STATUS_MESSAGES[4].0);
assert_eq!(crate::io::exported_with_notes("/out/a.svg", 2, "a note"), COUNTED_STATUS_MESSAGES[4].1);
// Each pair is found in the list by its text.
let listed = |got: (String, String), want: (&str, &str)| {
assert_eq!((got.0.as_str(), got.1.as_str()), want);
assert!(COUNTED_STATUS_MESSAGES.contains(&want), "{want:?} is not in COUNTED_STATUS_MESSAGES");
};
let copied = (copied_with_notes(false, 1, "a note"), copied_with_notes(false, 2, "a note"));
listed(copied, ("Copied with 1 note: a note", "Copied with 2 notes: a note"));
let cut = (copied_with_notes(true, 1, "a note"), copied_with_notes(true, 2, "a note"));
listed(cut, ("Cut with 1 note: a note", "Cut with 2 notes: a note"));
let traced = (traced_with_notes(1, "a note"), traced_with_notes(2, "a note"));
listed(traced, ("Traced with 1 note: a note", "Traced with 2 notes: a note"));
// A note that holds placeholder text is not filled in again.
assert_eq!(copied_with_notes(true, 3, "{n} {first}"), "Cut with 3 notes: {n} {first}");
assert_eq!(message(de(), &traced_with_notes(2, "{n}")), "Mit 2 Hinweisen nachgezeichnet: {n}");
// A value that holds placeholder text is not filled in again.
assert_eq!(crate::io::exported_with_notes("/out/{first}.svg", 1, "{n}"), "Exported /out/{first}.svg with 1 note: {n}");
for code in COMPLETE_MESSAGES {
+3
View File
@@ -5212,6 +5212,9 @@ liquify-list-end {0}, {1} {0} ve {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Kurtarılan {n} belge atıldı
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Kurtarılan {n} belge geri yüklendi: saklamak için kaydedin
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} {n} notla açıldı: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} {n} notla kopyalandı: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} {n} notla kesildi: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Görüntü {n} notla izlendi: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. {n} notla açıldı: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path}, {n} notla kaydedildi: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first {n} görsel gömüldü; {missing} eksik: önce onları yeniden bağlayın
Can't render this file because it is too large.
+3
View File
@@ -5516,6 +5516,9 @@ variable-list-end {0}, {1} {0} і {1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents Скасовано {n} відновлений документ|Скасовано {n} відновлені документи|Скасовано {n} відновлених документів
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them Відновлено {n} документ: збережіть його, щоб залишити|Відновлено {n} документи: збережіть їх, щоб залишити|Відновлено {n} документів: збережіть їх, щоб залишити
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} Відкрито з {n} приміткою: {first}|Відкрито з {n} примітками: {first}|Відкрито з {n} примітками: {first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Скопійовано з {n} приміткою: {first}|Скопійовано з {n} примітками: {first}|Скопійовано з {n} примітками: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Вирізано з {n} приміткою: {first}|Вирізано з {n} примітками: {first}|Вирізано з {n} примітками: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Зображення трасовано з {n} приміткою: {first}|Зображення трасовано з {n} примітками: {first}|Зображення трасовано з {n} примітками: {first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}. Відкрито з {n} приміткою: {first}|{notice}. Відкрито з {n} примітками: {first}|{notice}. Відкрито з {n} примітками: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Збережено: {path} з {n} приміткою: {first}|Збережено: {path} з {n} примітками: {first}|Збережено: {path} з {n} примітками: {first}
@msgplural Embedded {n} image; {missing} missing: relink them first|Embedded {n} images; {missing} missing: relink them first Вбудовано {n} зображення; відсутніх: {missing}. Спочатку відновіть їхні зв’язки|Вбудовано {n} зображення; відсутніх: {missing}. Спочатку відновіть їхні зв’язки|Вбудовано {n} зображень; відсутніх: {missing}. Спочатку відновіть їхні зв’язки
Can't render this file because it is too large.
+3
View File
@@ -5701,6 +5701,9 @@ liquify-list-end {0}, {1} {0} và {1}
@msg Saved to User Defined: {_1} Đã lưu vào Người dùng tùy chỉnh: {_1}
@msg Saved {n} files beside {path} Đã lưu {n} tệp bên cạnh {path}
@msg Saved {path} Đã lưu {path}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} Đã sao chép với {n} ghi chú: {first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} Đã cắt với {n} ghi chú: {first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} Đã vector hóa ảnh với {n} ghi chú: {first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} Đã lưu {path} với {n} ghi chú: {first}
@msg Saving Đang lưu
@msg Saving recovery data for {_1} Đang lưu dữ liệu phục hồi cho {_1}
Can't render this file because it contains an unexpected character in line 206 and column 5.
+3
View File
@@ -5329,6 +5329,9 @@ liquify-list-end {0}, {1} {0}和{1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents 已丢弃 {n} 个恢复的文档
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them 已还原 {n} 个恢复的文档:请保存以保留它们
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} 已打开,有 {n} 条注释:{first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} 已复制,有 {n} 条注释:{first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} 已剪切,有 {n} 条注释:{first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} 已描摹图像,有 {n} 条注释:{first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}。已打开,有 {n} 条注释:{first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} 已保存 {path},有 {n} 条注释:{first}
@msg Saving recovery data for {_1} 正在保存 {_1} 的恢复数据
Can't render this file because it is too large.
+3
View File
@@ -2823,6 +2823,9 @@ liquify-list-end {0}, {1} {0}和{1}
@msgplural Discarded {n} recovered document|Discarded {n} recovered documents 已捨棄 {n} 份復原的文件
@msgplural Restored {n} recovered document: save it to keep it|Restored {n} recovered documents: save them to keep them 已還原 {n} 份復原的文件:請儲存以保留
@msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} 已開啟,附有 {n} 則註解:{first}
@msgplural Copied with {n} note: {first}|Copied with {n} notes: {first} 已複製,附有 {n} 則註解:{first}
@msgplural Cut with {n} note: {first}|Cut with {n} notes: {first} 已剪下,附有 {n} 則註解:{first}
@msgplural Traced with {n} note: {first}|Traced with {n} notes: {first} 已描圖影像,附有 {n} 則註解:{first}
@msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}。已開啟,附有 {n} 則註解:{first}
@msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} 已儲存 {path},附有 {n} 則註解:{first}
@msg Saving recovery data for {_1} 正在儲存 {_1} 的復原資料
Can't render this file because it is too large.
+3 -1
View File
@@ -36,7 +36,9 @@ pub use open::{
pub(crate) use open::{open_file, opened_with_notes};
pub(crate) use save::save_current;
pub use save::{ask_format_options, ask_pdf_options, remember_active_artboard, remember_view, save, save_pdf};
pub(crate) use save::{export_path, is_web, notes_of, report_saved, show_with_notes, target_path, write_named, write_reporting, write_to};
pub(crate) use save::{
clear_notes_left, export_path, is_web, notes_of, report_saved, show_with_notes, target_path, write_named, write_reporting, write_to,
};
#[cfg(test)]
pub(crate) use save::{report_write_error, saved_status};
+10
View File
@@ -501,6 +501,16 @@ pub(crate) fn show_with_notes(app: &mut VectorcraftApp, status: String, notes: V
app.ui.status_notes = (!notes.is_empty()).then(|| (app.ui.status.clone(), notes));
}
/// Clear the status bar's message and its hover notes when `left` is still what the status bar
/// shows: a message with notes, and [`crate::state::UiState::status_sets`] when it was shown.
/// A message set since stays, one with the same text included.
pub(crate) fn clear_notes_left(app: &mut VectorcraftApp, left: Option<(String, u64)>) {
if left.is_some_and(|(status, sets)| status == app.ui.status && sets == app.ui.status_sets) {
app.status("");
app.ui.status_notes = None;
}
}
/// [`report_saved`]'s message.
pub(crate) fn saved_status(path: &str, r: &Value) -> String {
let warnings = notes_of(r);
+7 -6
View File
@@ -740,7 +740,8 @@ static CTX: OnceLock<egui::Context> = OnceLock::new();
static CLIP: Mutex<String> = Mutex::new(String::new());
static CLIP_RUNS: Mutex<Option<Value>> = Mutex::new(None);
fn text_copy(app: &mut VectorcraftApp) -> bool {
/// Copy the Type tool's selected text (with `cut`, for a Cut, whose caller then deletes it).
fn text_copy(app: &mut VectorcraftApp, cut: bool) -> bool {
let Some((id, a, b)) = text_editing(app) else { return false };
let story = text_story(app);
// An empty selection has nothing to copy, unless the story's text is in the other frames.
@@ -768,7 +769,7 @@ fn text_copy(app: &mut VectorcraftApp) -> bool {
// plain-text copy would replace its formats, so let the publisher provide both text and
// rich art. Paste on the canvas can then keep the runs after Type editing ends.
if app.services.system_clipboard.is_some() {
app.publish_clipboard();
app.publish_clipboard(cut);
return true;
}
}
@@ -839,10 +840,10 @@ pub(crate) fn intercept_text_command(app: &mut VectorcraftApp, id: &str) -> Opti
}
match id {
"edit.copy" => {
text_copy(app);
text_copy(app, false);
}
"edit.cut" => {
if text_copy(app) {
if text_copy(app, true) {
text_key(app, ToolKey::Delete, Mods::default());
}
}
@@ -933,10 +934,10 @@ pub(crate) fn apply_type_input(app: &mut VectorcraftApp, t: TextInput) {
match t {
TextInput::Key(k, m) => text_key(app, k, m),
TextInput::Copy => {
text_copy(app);
text_copy(app, false);
}
TextInput::Cut => {
if text_copy(app) {
if text_copy(app, true) {
text_key(app, ToolKey::Delete, Mods::default());
}
}
+1 -1
View File
@@ -1736,7 +1736,7 @@ fn copy_and_cut_take_a_story_that_left_the_edited_frame() {
// A story that holds no text has nothing to copy, so Cut does not run its delete.
app.run("select.all", json!({})).unwrap();
assert_eq!(text_story(&app).map(|frames| frames.len()), Some(3));
assert!(!text_copy(&mut app));
assert!(!text_copy(&mut app, false));
}
}
}
@@ -209,7 +209,10 @@ fn a_large_image_traced_as_a_flat_logo_shows_the_size_it_was_traced_at() {
app.run("file.place", json!({"name": "logo.png", "dataBase64": data, "link": false})).unwrap();
trace_with(&mut app, "Flat Logo");
assert!(target(&app).2.is_some(), "the image is traced: {}", app.ui.status);
assert_eq!(app.ui.status, "Flat Logo traced the image at 801 × 801 pixels, averaged down from 1602 × 1602.");
let note = "Flat Logo traced the image at 801 × 801 pixels, averaged down from 1602 × 1602.";
let status = format!("Traced with 1 note: {note}");
assert_eq!(app.ui.status, status);
assert_eq!(app.ui.status_notes, Some((status, vec![note.to_string()])));
}
#[test]
+58 -7
View File
@@ -103,6 +103,13 @@ pub(crate) struct Publishing {
/// The latest one's formats could not be written: what the system clipboard held when the
/// write failed, and the text of those formats.
unwritten: Option<(Held, String)>,
/// The status bar's message when the latest one ran, with [`crate::state::UiState::status_sets`]
/// then. Its formats' notes replace the message only while the status bar still shows it and
/// nothing has set the status since.
status: (String, u64),
/// The status bar's message the latest Copy or Cut with notes left, with
/// [`crate::state::UiState::status_sets`] then.
notes_status: Option<(String, u64)>,
}
impl Publishing {
@@ -116,6 +123,45 @@ impl Publishing {
pub(crate) fn latest(&self) -> u64 {
self.latest.load(Ordering::SeqCst)
}
/// `ui`'s status bar message is the one the latest Copy or Cut left, which its formats' notes
/// may replace.
pub(crate) fn ran_with_status(&mut self, ui: &crate::state::UiState) {
ui.status.clone_into(&mut self.status.0);
self.status.1 = ui.status_sets;
}
/// Does `ui`'s status bar still show the message the latest Copy or Cut left, with nothing
/// setting the status since?
fn shows_status(&self, ui: &crate::state::UiState) -> bool {
ui.status == self.status.0 && ui.status_sets == self.status.1
}
}
/// The status bar's line after a Copy (or with `cut`, a Cut) whose formats have `n` notes, the
/// first of them `first`.
pub(crate) fn copied_with_notes(cut: bool, n: usize, first: &str) -> String {
let (one, other) = if cut {
("Cut with {n} note: {first}", "Cut with {n} notes: {first}")
} else {
("Copied with {n} note: {first}", "Copied with {n} notes: {first}")
};
crate::i18n::msg_n(n as u64, one, other, &[("first", first)])
}
/// Show a Copy's (or with `cut`, a Cut's) formats' `notes` in the status bar: the first of them
/// and how many there are, with the rest for the message's hover. Without notes, the message an
/// earlier Copy's or Cut's notes left is cleared while nothing has set the status since, and any
/// other message stays.
pub(crate) fn show_copy_notes(app: &mut VectorcraftApp, cut: bool, notes: Vec<String>) {
let left = app.clipboard_publishing.notes_status.take();
let Some(first) = notes.first() else {
crate::io::clear_notes_left(app, left);
return;
};
let status = copied_with_notes(cut, notes.len(), first);
crate::io::show_with_notes(app, status, notes);
app.clipboard_publishing.notes_status = Some((app.ui.status.clone(), app.ui.status_sets));
}
/// Does a flavour of type `mime` load with `clipboard.importImage` ([`import_command`])?
@@ -172,14 +218,18 @@ impl VectorcraftApp {
/// ([`Self::drop_formats_after_egui_copy`]), drops the formats not written yet. While the
/// latest Copy or Cut's formats wait to be written, Paste takes the internal clipboard, and
/// while a text field or type has the keyboard the app waits for them
/// ([`Self::write_formats_before_text_input`]). Once they are written, the status bar shows
/// the first of the PNG's and PDF's warnings.
pub(crate) fn publish_clipboard(&mut self) {
/// ([`Self::write_formats_before_text_input`]). Once they are written, while the status bar
/// still shows the message the Copy or Cut (`cut`) left ([`Publishing::ran_with_status`]), it
/// shows the first of the PNG's and PDF's notes and how many there are; hovering the message
/// lists them ([`crate::io::show_with_notes`]).
pub(crate) fn publish_clipboard(&mut self, cut: bool) {
// Ruler guides copied alone stay in VectorCraft, but the Copy still replaces what the
// system clipboard held: it is emptied, so the next Paste takes the guides rather than
// what another app copied before, and what another app copies after still wins (#3226).
if !self.session.clipboard.has_art() {
self.clear_system_clipboard();
// Guides have no formats, so this Copy or Cut has no notes.
show_copy_notes(self, cut, vec![]);
return;
}
if self.services.system_clipboard.is_none() {
@@ -197,6 +247,7 @@ impl VectorcraftApp {
let n = latest.fetch_add(1, Ordering::SeqCst).wrapping_add(1);
self.clipboard_publishing.pending = true;
self.clipboard_publishing.unwritten = None;
self.clipboard_publishing.ran_with_status(&self.ui);
// What the clipboard holds at the Copy or Cut: a copy made elsewhere before the write is newer.
let before = self.services.system_clipboard.as_deref_mut().map(Held::now);
let (tx, made) = channel();
@@ -245,11 +296,11 @@ impl VectorcraftApp {
});
match written {
Err(e) => app.ui.status = format!("Couldn't copy to the system clipboard: {e}"),
// Show the first of the PNG's and PDF's warnings (an image that couldn't be decoded,
// type in the fallback font).
// The PNG's and PDF's notes (an image that couldn't be decoded, type in the
// fallback font), unless another message has replaced the Copy or Cut's since.
Ok(warnings) => {
if let Some(first) = warnings.into_iter().next() {
app.ui.status = first;
if app.clipboard_publishing.shows_status(&app.ui) {
show_copy_notes(app, cut, warnings);
}
}
}
+102 -11
View File
@@ -412,12 +412,8 @@ fn a_copy_while_the_worker_saves_writes_the_formats_at_once() {
assert_eq!(board.borrow().writes, 1);
}
/// Copy of an image the renderer can't decode: the PNG leaves it out, and once the formats are
/// written the status bar shows the PNG's note, made at once or on the worker.
#[test]
fn copy_says_in_the_status_bar_when_an_image_could_not_be_decoded() {
const WARNING: &str = "an image couldn't be decoded and is missing from the picture";
// A PNG whose header reads but whose pixel data is cut short.
/// A PNG whose header reads but whose pixel data is cut short, which the renderer can't decode.
pub(super) fn cut_short_png() -> Vec<u8> {
let mut png = Vec::new();
{
let __dyn: image::DynamicImage = (image::RgbaImage::from_pixel(64, 32, image::Rgba([200, 30, 30, 255]))).into();
@@ -454,18 +450,113 @@ fn copy_says_in_the_status_bar_when_an_image_could_not_be_decoded() {
.map(|__b| png.extend_from_slice(&__b))
}
.unwrap();
png
}
/// The PNG's note on an image the renderer can't decode.
pub(super) const UNDECODED: &str = "an image couldn't be decoded and is missing from the picture";
/// Copy of an image the renderer can't decode: the PNG leaves it out, and once the formats are
/// written the status bar says the Copy (or Cut) has 1 note and shows it, made at once or on the
/// worker. The note is kept for the message's hover, and a Copy without notes leaves the message.
#[test]
fn copy_says_in_the_status_bar_when_an_image_could_not_be_decoded() {
let png = cut_short_png();
for worker in [false, true] {
let (mut app, board) = if worker { app_with_worker() } else { app() };
app.status("Ready");
copy_rect(&mut app);
background::wait_all(&mut app);
assert_eq!(app.ui.status, "Ready", "worker {worker}: no note");
vectorcraft_testkit::fixtures::place_cut_png(&mut app.session, &png, json!({}));
app.status("Ready");
assert_eq!((app.ui.status.as_str(), &app.ui.status_notes), ("Ready", &None), "worker {worker}: no note");
for (id, said) in [("edit.copy", "Copied"), ("artboard.copy", "Copied"), ("edit.cut", "Cut")] {
vectorcraft_testkit::fixtures::place_cut_png(&mut app.session, &png, json!({}));
app.status("Ready");
let p = if id == "artboard.copy" { json!({"index": 0}) } else { json!({}) };
run(&mut app, id, p);
background::wait_all(&mut app);
assert_eq!(written(&board), [TEXT, SVG, PNG], "worker {worker}: {id}");
let status = format!("{said} with 1 note: {UNDECODED}");
assert_eq!(app.ui.status, status, "worker {worker}: {id}");
assert_eq!(app.ui.status_notes, Some((status, vec![UNDECODED.to_string()])), "worker {worker}: {id}");
}
}
}
/// The status bar names how many notes a Copy's or Cut's formats have and the first of them, and
/// keeps them all, in order, for the message's hover. Without notes it keeps its message.
#[test]
fn copy_notes_are_counted_and_kept_in_order() {
let (mut app, _) = app();
let notes: Vec<String> = ["first", "second", "third"].map(String::from).to_vec();
for (cut, said) in [(false, "Copied"), (true, "Cut")] {
crate::sysclip::show_copy_notes(&mut app, cut, notes.clone());
let status = format!("{said} with 3 notes: first");
assert_eq!(app.ui.status, status);
assert_eq!(app.ui.status_notes, Some((status, notes.clone())));
}
app.status("Ready");
app.ui.status_notes = None;
crate::sysclip::show_copy_notes(&mut app, false, vec![]);
assert_eq!((app.ui.status.as_str(), &app.ui.status_notes), ("Ready", &None));
}
/// A message shown while a Copy's formats are made on the worker stays: the formats are written
/// once they are ready, and their note does not replace the newer message.
#[test]
fn a_copy_note_does_not_replace_a_newer_message() {
let (mut app, board, hold) = app_with_busy_worker("");
vectorcraft_testkit::fixtures::place_cut_png(&mut app.session, &cut_short_png(), json!({}));
app.status("Ready");
run(&mut app, "edit.copy", json!({}));
app.status("Saved /out/a.vectorcraft");
drop(hold);
background::wait_all(&mut app);
assert_eq!(written(&board), [TEXT, SVG, PNG]);
assert_eq!((app.ui.status.as_str(), &app.ui.status_notes), ("Saved /out/a.vectorcraft", &None));
}
/// A message set while a Copy's formats are made on the worker stays even when its text is the
/// Copy's: an empty status bar set again, or File › New clearing it.
#[test]
fn a_copy_note_does_not_replace_a_message_with_the_same_text() {
for then in ["status", "file.new"] {
let (mut app, board, hold) = app_with_busy_worker("");
vectorcraft_testkit::fixtures::place_cut_png(&mut app.session, &cut_short_png(), json!({}));
app.status("");
run(&mut app, "edit.copy", json!({}));
if then == "status" {
app.status("");
} else {
run(&mut app, "file.new", json!({}));
}
drop(hold);
background::wait_all(&mut app);
assert_eq!(written(&board), [TEXT, SVG, PNG], "worker {worker}");
assert_eq!(app.ui.status, WARNING, "worker {worker}");
assert_eq!(written(&board), [TEXT, SVG, PNG], "{then}");
assert_eq!((app.ui.status.as_str(), &app.ui.status_notes), ("", &None), "{then}");
}
}
/// A Copy without notes clears the message an earlier Copy's notes left, with its hover notes,
/// made at once or on the worker. It leaves any other message, one with the same text set since
/// included.
#[test]
fn a_copy_without_notes_clears_an_earlier_copys_notes() {
let earlier = format!("Copied with 1 note: {UNDECODED}");
for worker in [false, true] {
for (then, kept) in [(None, ""), (Some("Ready"), "Ready"), (Some(earlier.as_str()), earlier.as_str())] {
let (mut app, _) = if worker { app_with_worker() } else { app() };
vectorcraft_testkit::fixtures::place_cut_png(&mut app.session, &cut_short_png(), json!({}));
run(&mut app, "edit.copy", json!({}));
background::wait_all(&mut app);
assert_eq!(app.ui.status, earlier, "worker {worker}, {then:?}");
if let Some(then) = then {
app.status(then);
app.ui.status_notes = None;
}
copy_rect(&mut app);
background::wait_all(&mut app);
assert_eq!((app.ui.status.as_str(), &app.ui.status_notes), (kept, &None), "worker {worker}, {then:?}");
}
}
}
+13 -1
View File
@@ -10,7 +10,7 @@ use vectorcraft_doc::NodeKind;
use vectorcraft_engine::Session;
use vectorcraft_engine::cmd::clipboard::{PNG, TEXT};
use crate::tests_sysclip::{app, app_with_busy_worker, copy_elsewhere, copy_rect, count, frame, pasted, run, written};
use crate::tests_sysclip::{UNDECODED, app, app_with_busy_worker, copy_elsewhere, copy_rect, count, cut_short_png, frame, pasted, run, written};
use crate::{Services, VectorcraftApp, background};
fn guides(app: &VectorcraftApp) -> usize {
@@ -42,6 +42,18 @@ fn a_guides_only_copy_pastes_the_guides_not_what_another_app_copied_before() {
assert_eq!((guides(&app), count(&app)), (3, 0));
}
/// A guides-only Copy has no notes: it clears the message an earlier Copy's notes left.
#[test]
fn a_guides_only_copy_clears_an_earlier_copys_notes() {
let (mut app, _) = app();
vectorcraft_testkit::fixtures::place_cut_png(&mut app.session, &cut_short_png(), json!({}));
run(&mut app, "edit.copy", json!({}));
background::wait_all(&mut app);
assert_eq!(app.ui.status, format!("Copied with 1 note: {UNDECODED}"));
copy_guide(&mut app, 120.0);
assert_eq!((app.ui.status.as_str(), &app.ui.status_notes), ("", &None));
}
#[test]
fn what_another_app_copies_after_a_guides_only_copy_is_pasted() {
let (mut app, board) = app();
+63
View File
@@ -142,6 +142,69 @@ fn without_threads_make_traces_at_once() {
assert_eq!(undos(&app), before + 1);
}
/// A trace's notes: the status bar names how many there are and the first of them, and keeps them
/// all, in the reply's order, for the message's hover. Make and Make and Expand, at once, off the
/// UI thread and from the Image Trace panel; a trace without notes leaves the status bar empty.
/// A trace that made no paths shows its first note as it is, and keeps them all for the hover.
#[test]
fn a_trace_shows_how_many_notes_it_has() {
let mut app = app();
let img = image::RgbaImage::from_fn(1501, 20, |x, _| image::Rgba(if x < 700 { [0, 0, 0, 255] } else { [255, 255, 255, 255] }));
let mut png = vec![];
img.write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png).unwrap();
let data = vectorcraft_format::base64_encode(&png);
let slow = "The image is 1501 × 20 pixels, more than 1500 on a side: it is traced, but more slowly. A lower-fidelity preset or a smaller copy of the image traces faster.";
let some = ("#000000", "keepColors: none of the colors the trace found matches #00ffff, so nothing of it is traced.");
let none = ("#ff00ff", "Nothing was traced: none of the colors the trace found matches keepColors (#ff00ff, #00ffff).");
for (command, threaded, from_panel) in
[("imageTrace.make", false, false), ("imageTrace.make", true, false), ("imageTrace.makeAndExpand", true, true)]
{
for (keep, first) in [some, none] {
app.run("file.place", json!({"name": "wide.png", "dataBase64": data, "link": false})).unwrap();
app.trace_runs.off_the_ui_thread = threaded;
app.ui.status.clear();
let p = json!({"params": {"mode": "color", "palette": "limited", "colors": 2, "keepColors": [keep, "#00ffff"]}});
trace_runs::start(&mut app, command, p, from_panel).unwrap();
wait(&mut app);
let notes = [first, slow].map(String::from).to_vec();
let status = if keep == some.0 { format!("Traced with 2 notes: {first}") } else { first.to_string() };
assert_eq!(app.ui.status, status, "{command}, threaded {threaded}");
assert_eq!(app.ui.status_notes, Some((status, notes)), "{command}, threaded {threaded}");
}
}
// The 40 × 40 px image of [`app`] traces without notes: the status bar stays empty.
let mut app = self::app();
for command in ["imageTrace.make", "imageTrace.makeAndExpand"] {
app.ui.status.clear();
let v = app.run(command, json!({"preset": "Default"})).unwrap();
assert_eq!(v["warnings"], json!([]), "{command}");
assert_eq!((app.ui.status.as_str(), &app.ui.status_notes), ("", &None), "{command}");
app.run("edit.undo", json!({})).unwrap();
}
}
/// A trace without notes clears the message an earlier trace's notes left, with its hover notes,
/// and leaves any other message, one with the same text set since included.
#[test]
fn a_trace_without_notes_clears_an_earlier_traces_notes() {
let mut app = app();
let earlier = "Traced with 2 notes: a note";
for (then, kept) in [(None, ""), (Some("Ready"), "Ready"), (Some(earlier), earlier)] {
app.status(earlier);
app.trace_runs.notes_status = Some((earlier.to_string(), app.ui.status_sets));
if let Some(then) = then {
app.status(then);
}
app.ui.status_notes = Some((app.ui.status.clone(), vec!["a note".to_string(), "another".to_string()]));
let v = app.run("imageTrace.make", json!({"preset": "Default"})).unwrap();
assert_eq!(v["warnings"], json!([]), "{then:?}");
assert_eq!(app.ui.status, kept, "{then:?}");
assert_eq!(app.ui.status_notes.is_none(), kept.is_empty(), "{then:?}");
assert_eq!(app.trace_runs.notes_status, None, "{then:?}");
app.run("edit.undo", json!({})).unwrap();
}
}
/// Nothing to trace fails at once, before anything runs.
#[test]
fn nothing_to_trace_fails_at_once() {
+8
View File
@@ -76,6 +76,14 @@ pub struct TraceRuns {
next_id: u64,
/// Set by unit tests whose app traces off the UI thread.
pub(crate) off_the_ui_thread: bool,
/// The status bar's message the latest Image Trace with notes left, with
/// [`crate::state::UiState::status_sets`] then.
pub(crate) notes_status: Option<(String, u64)>,
}
/// The status bar's line after an Image Trace with `n` notes, the first of them `first`.
pub(crate) fn traced_with_notes(n: usize, first: &str) -> String {
crate::i18n::msg_n(n as u64, "Traced with {n} note: {first}", "Traced with {n} notes: {first}", &[("first", first)])
}
/// Does `app` trace off the UI thread? Where documents open off it ([`crate::opening::available`]),
+2 -1
View File
@@ -744,7 +744,8 @@ type with those options (`file.place {text: {…}}`).
System clipboard formats: through the desktop app, `edit.copy`, `edit.cut`, `artboard.copy` and `artboard.cut` publish what `clipboard.flavours`
lists to the system clipboard (once they are written, the status bar shows the first of the PNG's and PDF's
`warnings`, such as an image that couldn't be decoded), and every Paste command first loads what another app copied (`clipboard.importSvg`,
`warnings`, such as an image that couldn't be decoded, and how many there are, and hovering the message lists them, unless
another message has replaced the Copy or Cut's meanwhile), and every Paste command first loads what another app copied (`clipboard.importSvg`,
`importPdf`, `importEps`, `importText` or `importImage`, centred in the view; the desktop app reads PDF and EPS from
the Windows clipboard and, with SVG, from the macOS pasteboard, and an `.eps` file, or a `.ai` or `.ait` file that holds a PDF or PostScript, copied in a file manager anywhere; a copied `.ai` or `.ait` file that holds a PDF loads with `importPdf {editingData: true}`, which reads its editing data); an import error answers the Paste with that error
and pastes nothing. Cmd+V also pastes a bitmap or PDF with no text beside it (on the key's release, as egui sends no
+3 -1
View File
@@ -8466,7 +8466,9 @@ area). For a caller with read roots, the list leaves out `image/svg+xml`, and th
(a one-page PDF, the page the objects' visual bounds) and `clipboard.exportPng {scale?}` (cropped to the objects,
transparent around them). As in `document.export`, the PDF's and the PNG's replies list their notes in `warnings`
(type written in the fallback font…; the PNG's also say when an image couldn't be decoded). After Copy or Cut the app
shows the first note of the PDF and PNG it offers in the status bar.
shows the first note of the PDF and PNG it offers in the status bar and how many there are, and hovering the message lists
them all, unless another message has replaced the Copy or Cut's while the formats were made. A Copy or Cut without
notes clears the notes message that an earlier Copy or Cut left. The `clipboard.export*` replies still list every note.
What other apps copied goes into the clipboard with `clipboard.importSvg`, `clipboard.importPdf {dataBase64, page?,
password?, editingData?}` (the page's objects; with `editingData: true` the data is a `.ai` or `.ait` file, and every
+1
View File
@@ -641,6 +641,7 @@ since 2026-10-01.
- **Clipped bottom-bar text (#6622):** A Help Bar hint wider than the window, such as the Dimension tool's hint in an 800-point window, ends in an ellipsis, as the status message does. In a narrow status bar the tool name ends in an ellipsis and leaves the status message its room. Resting the pointer on a clipped hint, tool name or message shows the full text in a tooltip that wraps within the window. Text that fits shows no tooltip, and screen readers receive the full text. Scores and estimates are unchanged.
- **Notes of an open in the status bar:** After File › Open the status message names the first note that says reading the file left something out (the notes that make Save ask before writing over the file), else the first note, and counts them all. With several notes, resting the pointer on the message lists them in that order, as many as fit in the window and at most 30, then how many more. Screen readers receive the list after the message. Scores and estimates are unchanged.
- **Notes of a save or an export in the status bar:** After Save, Save As, Save a Copy, Save as Template, Save a Timestamped Copy, Save as PDF, Export As, Export Selection, Export for Screens, Asset Export, Save for Web, Preview in Browser, Save for Office Documents, Text Export Options, a print to a file or the CSS Properties panel's export, the status message names the first note and counts them all. With several notes, resting the pointer on the message lists them in the order the reply gives them (a save's notes start with what the format loses), as it lists an open's notes. Scores and estimates are unchanged.
- **Notes of a Copy, a Cut or an Image Trace in the status bar:** After Copy or Cut (also of artboards and of text in the Type tool) writes its formats to the system clipboard, and after Image Trace's Make or Make and Expand, the status message names the first note and counts them all. With several notes, resting the pointer on the message lists them in the order they were made, as it lists a save's notes. A message shown while the clipboard formats were being made stays in place of the Copy's or Cut's notes. A Copy, Cut or trace without notes clears the notes message that an earlier one left, and leaves any other message. A trace that makes no paths shows its first note without the count. Scores and estimates are unchanged.
- **What a save or an export loses, named first:** Each writer marks its notes as a loss (something of the document the file leaves out or writes differently) or a note on the options (an option it didn't apply or applied another way while the art reaches the file as it looks, or something an option turns off). The replies of the save and export commands list the losses first, each kind in the order given, across every file an export writes. The status message after a save or an export then names a loss when there is one: a WebP export of type in a font that isn't installed, given an option WebP doesn't read (`interlaced`), names the fallback-font note instead of the note on that option. A print to a file and the print preview list theirs the same way: art outside the imageable area, type in a fallback font and transparency flattened for PostScript come before notes such as a fixed flatness that isn't written or copies per sheet that don't fit. Scores and estimates are unchanged.
- **Canvas review follow-up:** Cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission. Controlled-worker regression checks oversized width and height, high DPI and the render transform without allocating oversized images. Scores and estimates are unchanged.