From 7293cdf1fefb56692fd8bdfdd9e0f8c09cfcdc00 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 13:51:22 -0800 Subject: [PATCH] Links: the panel menu's Copy Info copies the selected links' file names The Links panel menu gets Copy Info, which runs the new UI command links.copyInfo {ids?}: the file names of the selected rows (or of ids), one per line in the order the panel shows them, go to the clipboard. The item is off with no row selected. An id that is not an image or a placed document, or a malformed ids, is an error and leaves the clipboard as it was. --- crates/mcp/src/ui_catalog.rs | 6 +++ crates/ui-egui/src/i18n/bg.tsv | 2 + crates/ui-egui/src/i18n/bs.tsv | 2 + crates/ui-egui/src/i18n/ca.tsv | 2 + crates/ui-egui/src/i18n/cs.tsv | 2 + crates/ui-egui/src/i18n/da.tsv | 2 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 2 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fi.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 2 + crates/ui-egui/src/i18n/id.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 2 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ka.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 2 + crates/ui-egui/src/i18n/pl.tsv | 2 + crates/ui-egui/src/i18n/pt-br.tsv | 2 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sv.tsv | 2 + crates/ui-egui/src/i18n/tr.tsv | 2 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + crates/ui-egui/src/menus/run.rs | 1 + crates/ui-egui/src/menus/state.rs | 1 + crates/ui-egui/src/menus/ui_commands.rs | 6 +++ crates/ui-egui/src/panels/links.rs | 62 ++++++++++++++++++++++-- crates/ui-egui/src/panels/tests_links.rs | 41 ++++++++++++++++ docs/mcp.md | 6 +++ docs/target-app-parity.md | 1 + 36 files changed, 176 insertions(+), 3 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 1bc2d14442..21d163ef25 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1455,6 +1455,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{id?} show the file of linked image `id` (default: the selected linked image) in the system's file manager → {path}", ), + ( + "links.copyInfo", + "Copy Info", + "", + "{ids?} copy the file names of images and placed documents `ids` (default: the selected ones and the rows picked in the Links panel, in links.list order) to the clipboard, one per line in that order; an embedded image gives the name its Links panel row shows (Links panel menu) → {text, names}", + ), ( "ui.placementOptionsDialog", "Placement Options…", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 1e801cff32..38eefa275b 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -630,6 +630,7 @@ font-technology Variable Променливи Copy All Styles Копиране на всички стилове Copy Color Value (Hex) Копиране на цветова стойност (Hex) Copy Fonts Used in the Document Копиране на шрифтовете, използвани в документа + Copy Info Копиране на информация Copy Links Копиране на връзките Copy Selected Style Копиране на избрания стил Copy to User Defined Копиране в потребителски @@ -4166,6 +4167,7 @@ axis Both И двете Stop the script and undo what it did? Then quit again. Да се спре ли скриптът и да се отменят ли промените му? След това излезте отново. This script has added a great many objects. Continue, or stop it and undo what it did? Този скрипт добави изключително много обекти. Да продължи ли, или да се спре и да се отменят промените му? @msg Copied the script report Копиран е отчетът за скрипта +@msg Copied the link info Информацията за връзката е копирана @msg Corners edits the corners of a path Ъглите редактират ъглите на пътя @msg Couldn't copy to the system clipboard: {e} Неуспешно копиране в системния клипборд: {e} @msg Couldn't open {name}: {e} Неуспешно отваряне на {name}: {e} diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index ec09c33484..4df553ab3b 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -2684,6 +2684,7 @@ digits Malayalam Malajalam Transparent Background Prozirna pozadina Choose… Odaberi… Copy Fonts Used in the Document Kopiraj fontove korištene u dokumentu + Copy Info Kopiraj informacije Copy Links Kopiraj veze Create Report Kreiraj izvještaj Fonts whose licence doesn't allow embedding are not copied. Fontovi čija licenca ne dozvoljava ugrađivanje ne kopiraju se. @@ -4531,6 +4532,7 @@ imageTrace Outline Obris Stop the script and undo what it did? Then quit again. Zaustaviti skriptu i poništiti ono što je uradila? Zatim ponovo izađite. This script has added a great many objects. Continue, or stop it and undo what it did? Ova skripta je dodala veoma mnogo objekata. Nastaviti, ili je zaustaviti i poništiti ono što je uradila? @msg Copied the script report Izvještaj skripte kopiran +@msg Copied the link info Informacije o vezi kopirane @msg Corners edits the corners of a path Uglovi uređuje uglove putanje @msg Couldn't copy to the system clipboard: {e} Nije moguće kopirati u sistemski međuspremnik: {e} @msg Couldn't open {name}: {e} Nije moguće otvoriti {name}: {e} diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 583ea386c8..fa953f33f9 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -930,6 +930,7 @@ antiAlias Sharp Nítid Copy Guide Copia la guia Copy in Perspective Copia en perspectiva Copy into the document's folder Copia a la carpeta del document + Copy Info Copia la informació Copy Links Copia els enllaços Copy only fonts you own or are licensed to install. Copia només els tipus de lletra que tinguis o que tinguis llicència per instal·lar. Copy Report Copia l’informe @@ -5582,6 +5583,7 @@ digits Malayalam Malaiàlam @msg there is no script engine named {name} no hi ha cap motor d'scripts anomenat {name} @msg Running a script S'està executant un script @msg Copied the script report S’ha copiat l’informe de l’script +@msg Copied the link info S’ha copiat la informació de l’enllaç @msg Corners edits the corners of a path Cantonades edita les cantonades d’un traçat @msg could not decode image: {0} no s’ha pogut descodificar la imatge: {0} @msg Couldn't copy to the system clipboard: {e} No s’ha pogut copiar al porta-retalls del sistema: {e} diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 54082ffcfd..0c56dbe330 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -2719,6 +2719,7 @@ digits Malayalam Malajálamské Transparent Background Průhledné pozadí Choose… Vybrat… Copy Fonts Used in the Document Kopírovat písma použitá v dokumentu + Copy Info Kopírovat informace Copy Links Kopírovat propojené soubory Create Report Vytvořit zprávu Fonts whose licence doesn't allow embedding are not copied. Písma, jejichž licence nepovoluje vkládání, se nekopírují. @@ -4688,6 +4689,7 @@ imageTrace Outline Obrys @msg there is no script engine named {name} skriptovací jádro s názvem {name} neexistuje @msg Running a script Běží skript @msg Copied the script report Zpráva o skriptu zkopírována +@msg Copied the link info Informace o propojení zkopírovány @msg Corners edits the corners of a path Rohy upravuje rohy cesty @msg Couldn't copy to the system clipboard: {e} Nelze kopírovat do systémové schránky: {e} @msg Couldn't open {name}: {e} {name} nelze otevřít: {e} diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index dd5aba4de6..e7c955f40f 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -2501,6 +2501,7 @@ digits Malayalam Malayalam Transparent Background Gennemsigtig baggrund Choose… Vælg… Copy Fonts Used in the Document Kopiér skrifttyper, der bruges i dokumentet + Copy Info Kopiér info Copy Links Kopiér links Create Report Opret rapport Fonts whose licence doesn't allow embedding are not copied. Skrifttyper, hvis licens ikke tillader indlejring, kopieres ikke. @@ -4283,6 +4284,7 @@ imageTrace Outline Kontur Stop the script and undo what it did? Then quit again. Stop scriptet og fortryd det, det har gjort? Afslut derefter igen. This script has added a great many objects. Continue, or stop it and undo what it did? Dette script har tilføjet rigtig mange objekter. Fortsæt, eller stop det og fortryd det, det har gjort? @msg Copied the script report Kopierede scriptrapporten +@msg Copied the link info Kopierede linkinfo @msg Corners edits the corners of a path Hjørner redigerer hjørnerne på en kurve @msg Couldn't copy to the system clipboard: {e} Kunne ikke kopiere til systemets udklipsholder: {e} @msg Couldn't open {name}: {e} Kunne ikke åbne {name}: {e} diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 698d16a546..63e2261767 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -623,6 +623,7 @@ font-technology Variable Variabel Copy All Styles Alle Stile kopieren Copy Color Value (Hex) Farbwert kopieren (Hex) Copy Fonts Used in the Document Im Dokument verwendete Schriften kopieren + Copy Info Informationen kopieren Copy Links Verknüpfungen kopieren Copy Selected Style Ausgewählten Stil kopieren Copy to User Defined In „Benutzerdefiniert“ kopieren @@ -4300,6 +4301,7 @@ theme Appearance Erscheinungsbild @msg there is no script engine named {name} es gibt keine Skript-Engine namens {name} @msg Running a script Skript wird ausgeführt @msg Copied the script report Skriptbericht kopiert +@msg Copied the link info Verknüpfungsinformationen kopiert @msg Corners edits the corners of a path „Ecken“ bearbeitet die Ecken eines Pfads @msg Couldn't copy to the system clipboard: {e} In die Systemzwischenablage konnte nicht kopiert werden: {e} @msg Couldn't open {name}: {e} {name} konnte nicht geöffnet werden: {e} diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index a838aaac80..41ade16df9 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -604,6 +604,7 @@ font-technology Variable Μεταβλητές Copy All Styles Αντιγραφή όλων των στυλ Copy Color Value (Hex) Αντιγραφή τιμής χρώματος (Hex) Copy Fonts Used in the Document Αντιγραφή γραμματοσειρών που χρησιμοποιούνται στο έγγραφο + Copy Info Αντιγραφή πληροφοριών Copy Links Αντιγραφή συνδέσεων Copy Selected Style Αντιγραφή επιλεγμένου στυλ Copy to User Defined Αντιγραφή σε ορισμένα από τον χρήστη @@ -2446,6 +2447,7 @@ axis Both Και τα δύο @msg there is no script engine named {name} δεν υπάρχει μηχανή σεναρίων με όνομα {name} @msg Running a script Εκτελείται σενάριο @msg Copied the script report Η αναφορά του σεναρίου αντιγράφηκε +@msg Copied the link info Οι πληροφορίες συνδέσμου αντιγράφηκαν @msg Corners edits the corners of a path Η εντολή Γωνίες επεξεργάζεται τις γωνίες μιας διαδρομής @msg Couldn't copy to the system clipboard: {e} Δεν ήταν δυνατή η αντιγραφή στο πρόχειρο συστήματος: {e} @msg Couldn't open {name}: {e} Δεν ήταν δυνατό το άνοιγμα του {name}: {e} diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 719b9dc668..9f92f40f9d 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -645,6 +645,7 @@ font-technology Variable Variables Copy All Styles Copiar todos los estilos Copy Color Value (Hex) Copiar valor de color (hex) Copy Fonts Used in the Document Copiar fuentes usadas en el documento + Copy Info Copiar información Copy Links Copiar vínculos Copy Selected Style Copiar estilo seleccionado Copy to User Defined Copiar en Definido por el usuario @@ -4377,6 +4378,7 @@ axis Both Ambos @msg there is no script engine named {name} no hay ningún motor de scripts llamado {name} @msg Running a script Ejecutando un script @msg Copied the script report Se copió el informe del script +@msg Copied the link info Se copió la información del vínculo @msg Corners edits the corners of a path Esquinas edita las esquinas de un trazado @msg Couldn't copy to the system clipboard: {e} No se pudo copiar al portapapeles del sistema: {e} @msg Couldn't open {name}: {e} No se pudo abrir {name}: {e} diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 5c04678407..a3a03ad999 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -2663,6 +2663,7 @@ digits Malayalam Malajalam Transparent Background Läpinäkyvä tausta Choose… Valitse… Copy Fonts Used in the Document Kopioi asiakirjassa käytetyt fontit + Copy Info Kopioi tiedot Copy Links Kopioi linkit Create Report Luo raportti Fonts whose licence doesn't allow embedding are not copied. Fontteja, joiden lisenssi ei salli upottamista, ei kopioida. @@ -4602,6 +4603,7 @@ imageTrace Outline Ääriviiva @msg there is no script engine named {name} skriptimoottoria nimeltä {name} ei ole @msg Running a script Suoritetaan komentosarjaa @msg Copied the script report Komentosarjan raportti kopioitiin +@msg Copied the link info Linkin tiedot kopioitiin @msg Corners edits the corners of a path Kulmat-toiminto muokkaa polun kulmia @msg Couldn't copy to the system clipboard: {e} Järjestelmän leikepöydälle ei voitu kopioida: {e} @msg Couldn't open {name}: {e} Tiedostoa {name} ei voitu avata: {e} diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index d25cc7069c..aa3dfb9643 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -646,6 +646,7 @@ font-technology Variable Variables Copy All Styles Copier tous les styles Copy Color Value (Hex) Copier la valeur de couleur (hex) Copy Fonts Used in the Document Copier les polices utilisées dans le document + Copy Info Copier les informations Copy Links Copier les liens Copy Selected Style Copier le style sélectionné Copy to User Defined Copier dans Défini par l’utilisateur @@ -4366,6 +4367,7 @@ axis Both Les deux @msg there is no script engine named {name} il n'y a aucun moteur de script nommé {name} @msg Running a script Exécution d’un script @msg Copied the script report Rapport du script copié +@msg Copied the link info Informations sur le lien copiées @msg Corners edits the corners of a path Angles modifie les angles d’un tracé @msg Couldn't copy to the system clipboard: {e} Impossible de copier dans le presse-papiers du système : {e} @msg Couldn't open {name}: {e} Impossible d’ouvrir {name} : {e} diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index a36ac35c7a..539ff8707e 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -743,6 +743,7 @@ Copy Artboard આર્ટબોર્ડ નકલ કરો Copy Color Value (Hex) રંગ મૂલ્યની નકલ કરો (Hex) Copy Guide ગાઇડ નકલ કરો + Copy Info માહિતી નકલ કરો Copy Report રિપોર્ટ નકલ કરો Copy Script Console સ્ક્રિપ્ટ કન્સોલ નકલ કરો Copy Selected પસંદ કરેલું નકલ કરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index f4a3a04807..c52fd71df0 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1061,6 +1061,7 @@ antiAlias Sharp शार्प Copy Guide कॉपी गाइड Copy in Perspective पर्सपेक्टिव में प्रतिलिपि Copy into the document's folder डॉक्यूमेंट के फ़ोल्डर में कॉपी करें + Copy Info जानकारी कॉपी करें Copy Links कॉपी लिंक Copy only fonts you own or are licensed to install. केवल उन फ़ॉन्टों को कॉपी करें जिन्हें आप स्वयं करते हैं या इंस्टॉल करने के लिए लाइसेंस प्राप्त हैं। Copy Report रिपोर्ट कॉपी करें @@ -6694,6 +6695,7 @@ antiAlias Sharp शार्प @msg there is no script engine named {name} {name} नाम का कोई स्क्रिप्ट इंजन नहीं है @msg Running a script स्क्रिप्ट चल रही है @msg Copied the script report Copied स्क्रिप्ट रिपोर्ट +@msg Copied the link info लिंक जानकारी कॉपी की गई @msg copy needs path: the file to copy into the document's folder copy के लिए path चाहिए: डॉक्यूमेंट के फ़ोल्डर में कॉपी करने वाली फ़ाइल @msg copy takes images only: relink placed documents where their files are copy केवल इमेज लेता है: प्लेस किए गए डॉक्यूमेंट्स को वहीं फिर से लिंक करें जहाँ उनकी फ़ाइलें हैं @msg copying a file isn't available on the web एक फ़ाइल की प्रतिलिपि वेब पर उपलब्ध नहीं है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index bea893c5ff..0f21fb1402 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -838,6 +838,7 @@ font-technology Variable Változó Copy Artboard Rajztábla másolása Copy Color Value (Hex) Színérték másolása (hex) Copy Fonts Used in the Document A dokumentumban használt betűtípusok másolása + Copy Info Adatok másolása Copy Links Csatolások másolása Copy only fonts you own or are licensed to install. Csak olyan betűtípust másolj, amely a tiéd, vagy amelynek telepítésére licenced van. Copy Selected Style Kijelölt stílus másolása @@ -5189,6 +5190,7 @@ imageTrace Outline Körvonal @msg there is no script engine named {name} nincs {name} nevű parancsfájlmotor @msg Running a script Parancsfájl futtatása @msg Copied the script report Szkriptjelentés másolva +@msg Copied the link info Csatolás adatai másolva @msg Corners edits the corners of a path a Sarkok parancs egy útvonal sarkait szerkeszti @msg could not decode image: {0} a kép nem dekódolható: {0} @msg Couldn't copy to the system clipboard: {e} Nem sikerült a rendszer vágólapjára másolni: {e} diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 92d97e00d9..f6cf67d4b2 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -2501,6 +2501,7 @@ digits Malayalam Malayalam Transparent Background Latar belakang transparan Choose… Pilih… Copy Fonts Used in the Document Salin font yang digunakan dalam dokumen + Copy Info Salin info Copy Links Salin tautan Create Report Buat laporan Fonts whose licence doesn't allow embedding are not copied. Font yang lisensinya tidak mengizinkan penyematan tidak disalin. @@ -4283,6 +4284,7 @@ imageTrace Outline Kontur Stop the script and undo what it did? Then quit again. Hentikan skrip dan batalkan yang telah dilakukannya? Lalu keluar lagi. This script has added a great many objects. Continue, or stop it and undo what it did? Skrip ini telah menambahkan sangat banyak objek. Lanjutkan, atau hentikan dan batalkan yang telah dilakukannya? @msg Copied the script report Berhasil menyalin laporan skrip +@msg Copied the link info Berhasil menyalin info tautan @msg Corners edits the corners of a path Corners menyunting sudut jalur @msg Couldn't copy to the system clipboard: {e} Tidak dapat menyalin ke papan klip sistem: {e} @msg Couldn't open {name}: {e} Tidak dapat membuka {name}: {e} diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 6fb07b1a01..d41a7e0519 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -645,6 +645,7 @@ font-technology Variable Variabili Copy All Styles Copia tutti gli stili Copy Color Value (Hex) Copia valore colore (hex) Copy Fonts Used in the Document Copia i font usati nel documento + Copy Info Copia informazioni Copy Links Copia collegamenti Copy Selected Style Copia stile selezionato Copy to User Defined Copia in Definito dall'utente @@ -4429,6 +4430,7 @@ axis Both Entrambi @msg there is no script engine named {name} non esiste un motore di script chiamato {name} @msg Running a script Esecuzione di uno script @msg Copied the script report Rapporto dello script copiato +@msg Copied the link info Informazioni collegamento copiate @msg Corners edits the corners of a path Angoli modifica gli angoli di un tracciato @msg Couldn't copy to the system clipboard: {e} Impossibile copiare negli appunti di sistema: {e} @msg Couldn't open {name}: {e} Impossibile aprire {name}: {e} diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 6b59f5a370..179ae8a703 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3761,6 +3761,7 @@ gradient-kind Radial 円形 Convert To Outlines アウトラインに変換 Copy All Objects すべてのオブジェクトをコピー Copy Fonts Used in the Document ドキュメントで使用しているフォントをコピー + Copy Info 情報をコピー Copy Links リンクをコピー Couldn't copy to the system clipboard: {e} システムのクリップボードにコピーできませんでした:{e} Couldn't paste from the clipboard: {e} クリップボードからペーストできませんでした:{e} @@ -5194,6 +5195,7 @@ swatch Bright Violet ビビッドバイオレット @msg there is no script engine named {name} {name} という名前のスクリプトエンジンはありません @msg Running a script スクリプトを実行中 @msg Copied the script report スクリプトのレポートをコピーしました +@msg Copied the link info リンク情報をコピーしました @msg Exported {path} {path} を書き出しました @msg no CSS to copy: select objects with CSS of their own コピーする CSS がありません: 独自の CSS を持つオブジェクトを選択してください @msg unknown highlight `{h}` `{h}` は不明なハイライトの指定です diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 7c872ed9b8..d5ce3f7912 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -2423,6 +2423,7 @@ digits Malayalam მალაიალამური Transparent Background გამჭვირვალე ფონი Choose… არჩევა… Copy Fonts Used in the Document დოკუმენტში გამოყენებული შრიფტების კოპირება + Copy Info ინფორმაციის კოპირება Copy Links ბმულების კოპირება Create Report ანგარიშის შექმნა Fonts whose licence doesn't allow embedding are not copied. შრიფტები, რომელთა ლიცენზია ჩაშენების უფლებას არ იძლევა, არ კოპირდება. @@ -5601,6 +5602,7 @@ imageTrace Outline კონტური @msg there is no script engine named {name} სკრიპტის ძრავა სახელით {name} არ არსებობს @msg Running a script სკრიპტი მუშაობს @msg Copied the script report კოპირებულია სკრიპტის ანგარიში +@msg Copied the link info კოპირებულია ბმულის ინფორმაცია @msg Offset Path: the offset leaves nothing of the selected paths (an inset larger than the shapes) ტრაექტორიის წანაცვლება: წანაცვლების შემდეგ მონიშნული ტრაექტორიებიდან არაფერი რჩება (შიგნით წანაცვლება ფიგურებზე დიდია) @msg {path}: not a file {path}: ფაილი არ არის Load EPS into Clipboard EPS-ის ბუფერში ჩატვირთვა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 04a3234343..400024b0e7 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3749,6 +3749,7 @@ gradient-kind Radial 방사형 Convert To Outlines 윤곽선으로 변환 Copy All Objects 모든 개체 복사 Copy Fonts Used in the Document 문서에 사용된 글꼴 복사 + Copy Info 정보 복사 Copy Links 링크 복사 Couldn't copy to the system clipboard: {e} 시스템 클립보드로 복사할 수 없습니다: {e} Couldn't paste from the clipboard: {e} 클립보드에서 붙여넣을 수 없습니다: {e} @@ -5121,6 +5122,7 @@ theme Appearance 외관 @msg there is no script engine named {name} 이름이 {name}인 스크립트 엔진이 없습니다 @msg Running a script 스크립트 실행 중 @msg Copied the script report 스크립트 보고서를 복사했습니다 +@msg Copied the link info 링크 정보를 복사했습니다 @msg Exported {path} {path}을(를) 내보냈습니다 @msg no CSS to copy: select objects with CSS of their own 복사할 CSS가 없습니다: 자체 CSS가 있는 개체를 선택하세요 @msg unknown highlight `{h}` 알 수 없는 강조 `{h}` diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 09459378a0..ccfdfc07f6 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -3019,6 +3019,7 @@ digits Malayalam Malayalam Transparent Background Transparante achtergrond Choose… Kies… Copy Fonts Used in the Document In het document gebruikte lettertypen kopiëren + Copy Info Info kopiëren Copy Links Koppelingen kopiëren Create Report Rapport maken Fonts whose licence doesn't allow embedding are not copied. Lettertypen waarvan de licentie insluiten niet toestaat, worden niet gekopieerd. @@ -4801,6 +4802,7 @@ imageTrace Outline Contour Stop the script and undo what it did? Then quit again. Het script stoppen en de wijzigingen ervan ongedaan maken? Sluit daarna opnieuw af. This script has added a great many objects. Continue, or stop it and undo what it did? Dit script heeft heel veel objecten toegevoegd. Doorgaan, of het stoppen en de wijzigingen ervan ongedaan maken? @msg Copied the script report Scriptrapport gekopieerd +@msg Copied the link info Koppelingsinfo gekopieerd @msg Corners edits the corners of a path Hoeken bewerkt de hoeken van een pad @msg Couldn't copy to the system clipboard: {e} Kon niet naar het systeemklembord kopiëren: {e} @msg Couldn't open {name}: {e} Kon {name} niet openen: {e} diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 01c8429004..2ca391f132 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -2632,6 +2632,7 @@ digits Malayalam Malajalam Transparent Background Przezroczyste tło Choose… Wybierz… Copy Fonts Used in the Document Kopiuj czcionki użyte w dokumencie + Copy Info Kopiuj informacje Copy Links Kopiuj łącza Create Report Utwórz raport Fonts whose licence doesn't allow embedding are not copied. Czcionki, których licencja nie zezwala na osadzanie, nie są kopiowane. @@ -4512,6 +4513,7 @@ imageTrace Outline Kontur @msg there is no script engine named {name} nie ma silnika skryptów o nazwie {name} @msg Running a script Uruchamianie skryptu @msg Copied the script report Skopiowano raport skryptu +@msg Copied the link info Skopiowano informacje o łączu @msg Corners edits the corners of a path Narożniki edytuje narożniki ścieżki @msg Couldn't copy to the system clipboard: {e} Nie udało się skopiować do schowka systemowego: {e} @msg Couldn't open {name}: {e} Nie udało się otworzyć {name}: {e} diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 1255008e2b..918f0d0361 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4892,6 +4892,7 @@ axis Both Ambos Convert To Outlines Converter em Contornos Copy All Objects Copiar Todos os Objetos Copy Fonts Used in the Document Copiar Fontes Usadas no Documento + Copy Info Copiar Informações Copy Links Copiar Links Descender Descendente Flip Virar @@ -5410,6 +5411,7 @@ axis Both Ambos @msg there is no script engine named {name} não há nenhum mecanismo de script chamado {name} @msg Running a script Executando um script @msg Copied the script report Relatório do script copiado +@msg Copied the link info Informações do link copiadas @msg This shortcut file is in a form VectorCraft can't read. Este arquivo de atalhos está em um formato que o VectorCraft não consegue ler. @msg axis must be "vertical", "horizontal" or an angle in degrees, not `{v}` axis deve ser "vertical", "horizontal" ou um ângulo em graus, não `{v}` @msg give corners of the path: anchors where its sides meet at an angle informe os cantos do caminho: pontos de ancoragem onde os lados se encontram em ângulo diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 26e958353a..f8e0f819f5 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -643,6 +643,7 @@ font-technology Variable Вариативные Copy All Styles Копировать все стили Copy Color Value (Hex) Копировать значение цвета (hex) Copy Fonts Used in the Document Копировать шрифты, использованные в документе + Copy Info Копировать сведения Copy Links Копировать связи Copy Selected Style Копировать выбранный стиль Copy to User Defined Копировать в «Пользовательский» @@ -4414,6 +4415,7 @@ axis Both Оба @msg there is no script engine named {name} движка скриптов с именем {name} нет @msg Running a script Выполняется скрипт @msg Copied the script report Отчёт о сценарии скопирован +@msg Copied the link info Сведения о связи скопированы @msg Corners edits the corners of a path «Углы» редактирует углы контура @msg Couldn't copy to the system clipboard: {e} Не удалось скопировать в системный буфер обмена: {e} @msg Couldn't open {name}: {e} Не удалось открыть {name}: {e} diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index ae45dc0181..b232d407a6 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -632,6 +632,7 @@ font-technology Variable Variabla Copy All Styles Kopiera alla stilar Copy Color Value (Hex) Kopiera färgvärde (hex) Copy Fonts Used in the Document Kopiera typsnitt som används i dokumentet + Copy Info Kopiera info Copy Links Kopiera länkar Copy Selected Style Kopiera markerad stil Copy to User Defined Kopiera till användardefinierade @@ -4287,6 +4288,7 @@ axis Both Båda @msg there is no script engine named {name} det finns ingen skriptmotor med namnet {name} @msg Running a script Kör ett skript @msg Copied the script report Kopierade skriptrapporten +@msg Copied the link info Kopierade länkinfo @msg Corners edits the corners of a path Hörn redigerar hörnen på en bana @msg Couldn't copy to the system clipboard: {e} Kunde inte kopiera till systemets urklipp: {e} @msg Couldn't open {name}: {e} Kunde inte öppna {name}: {e} diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index a193574ca7..69854f3ef8 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -624,6 +624,7 @@ font-technology Variable Değişken Copy All Styles Tüm Stilleri Kopyala Copy Color Value (Hex) Renk Değerini Kopyala (Hex) Copy Fonts Used in the Document Belgede Kullanılan Yazı Tiplerini Kopyala + Copy Info Bilgiyi Kopyala Copy Links Bağlantıları Kopyala Copy Selected Style Seçilen Stili Kopyala Copy to User Defined Kullanıcı Tanımlıya Kopyala @@ -4150,6 +4151,7 @@ axis Both Her İkisi @msg there is no script engine named {name} {name} adlı bir betik motoru yok @msg Running a script Betik çalıştırılıyor @msg Copied the script report Komut dosyası raporu kopyalandı +@msg Copied the link info Bağlantı bilgisi kopyalandı @msg Corners edits the corners of a path Köşeler bir yolun köşelerini düzenler @msg Couldn't copy to the system clipboard: {e} Sistem panosuna kopyalanamadı: {e} @msg Couldn't open {name}: {e} {name} açılamadı: {e} diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 31c15f10b5..ce9f9a6d8f 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -639,6 +639,7 @@ font-technology Variable Варіативні Copy All Styles Копіювати всі стилі Copy Color Value (Hex) Копіювати значення кольору (hex) Copy Fonts Used in the Document Копіювати шрифти, використані у документі + Copy Info Копіювати відомості Copy Links Копіювати зв’язки Copy Selected Style Копіювати вибраний стиль Copy to User Defined Копіювати в «Користувацькі» @@ -4413,6 +4414,7 @@ axis Both Обидві @msg there is no script engine named {name} рушія скриптів з назвою {name} немає @msg Running a script Виконується скрипт @msg Copied the script report Звіт про сценарій скопійовано +@msg Copied the link info Відомості про зв’язок скопійовано @msg Corners edits the corners of a path «Кути» редагує кути контуру @msg Couldn't copy to the system clipboard: {e} Не вдалося скопіювати до системного буфера обміну: {e} @msg Couldn't open {name}: {e} Не вдалося відкрити {name}: {e} diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 30e42d6b53..677a71bd2e 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -739,6 +739,7 @@ font-technology Variable Biến thiên Copy Color Value (Hex) Sao chép giá trị màu (Hex) Copy Fonts Used in the Document Sao chép phông đã dùng trong tài liệu Copy into the document's folder Sao chép vào thư mục tài liệu + Copy Info Sao chép thông tin Copy Links Sao chép liên kết Copy only fonts you own or are licensed to install. Chỉ sao chép phông chữ bạn sở hữu hoặc có giấy phép cài đặt. Copy Selected Style Sao chép kiểu đã chọn @@ -4843,6 +4844,7 @@ theme Appearance Giao diện @msg there is no script engine named {name} không có bộ máy tập lệnh nào tên {name} @msg Running a script Đang chạy tập lệnh @msg Copied the script report Đã sao chép báo cáo script +@msg Copied the link info Đã sao chép thông tin liên kết @msg Corners edits the corners of a path Corners chỉnh sửa các góc của đường dẫn @msg could not decode image: {0} không thể giải mã ảnh: {0} @msg Couldn't copy to the system clipboard: {e} Không thể sao chép vào khay nhớ tạm hệ thống: {e} diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 9d5fe1c4b6..ddc57ccf70 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -591,6 +591,7 @@ antiAlias Sharp 锐利 Copy All Styles 复制所有样式 Copy Color Value (Hex) 复制颜色值 (十六进制) Copy Fonts Used in the Document 复制文档中使用的字体 + Copy Info 复制信息 Copy Links 复制链接 Copy Selected Style 复制所选样式 Copy to User Defined 复制到用户定义 @@ -4874,6 +4875,7 @@ imageTrace Outline 轮廓 @msg there is no script engine named {name} 没有名为 {name} 的脚本引擎 @msg Running a script 正在运行脚本 @msg Copied the script report 已复制脚本报告 +@msg Copied the link info 已复制链接信息 @msg Exported {path} 已导出 {path} @msg no CSS to copy: select objects with CSS of their own 没有可复制的 CSS:请选择带有自身 CSS 的对象 @msg unknown highlight `{h}` 未知的高亮显示 `{h}` diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 528e0a57ca..2cedf23acb 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -608,6 +608,7 @@ font-technology Variable 可變 Copy All Styles 複製所有樣式 Copy Color Value (Hex) 複製顏色值 (Hex) Copy Fonts Used in the Document 複製文件中使用的字體 + Copy Info 複製資訊 Copy Links 複製連結 Copy Selected Style 複製所選樣式 Copy to User Defined 複製到使用者定義 @@ -2588,6 +2589,7 @@ file-filter Templates 範本 @msg there is no script engine named {name} 沒有名為 {name} 的指令碼引擎 @msg Running a script 正在執行指令碼 @msg Copied the script report 已複製指令碼報告 +@msg Copied the link info 已複製連結資訊 @msg Exported {path} 已匯出 {path} @msg no CSS to copy: select objects with CSS of their own 沒有可複製的 CSS:請選取有自己 CSS 的物件 @msg unknown highlight `{h}` 未知的反白顯示 `{h}` diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 7b7f7a6b21..ff578d81e5 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -976,6 +976,7 @@ fn run_ui_part11(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option crate::panels::links::open_file(app, p, false), "links.reveal" => crate::panels::links::open_file(app, p, true), + "links.copyInfo" => crate::panels::links::copy_info(app, p), "ui.placementOptionsDialog" => crate::dialogs::placement_options::open(app, p), "ui.relinkDialog" => crate::dialogs::relink::open(app, p), "ui.findLinksInFolder" => { diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index 0d5775ffe9..98c13ec06e 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -310,6 +310,7 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool { "ui.dxfOptionsDialog" => app.session.active().is_some(), "links.editOriginal" | "links.reveal" => selected_image(app, |im| im.link.is_some()) || selected_placed(app), "ui.placementOptionsDialog" => selected_image(app, |_| true) || selected_placed(app), + "links.copyInfo" => !crate::panels::links::selected_rows_of_app(app).is_empty(), "ui.relinkDialog" => app.services.pick_open.is_some() && (selected_image(app, |_| true) || selected_placed(app)), "ui.findLinksInFolder" => crate::picks::can(app, &crate::picks::PickRequest::Folder) && app.session.active().is_some(), "ui.packageDialog" | "docInfo.save" => app.session.active().is_some(), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 21b8795662..2a607c4967 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1456,6 +1456,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{id?} show the file of linked image `id` (default: the selected linked image) in the system's file manager → {path}", ), + ( + "links.copyInfo", + "Copy Info", + "", + "{ids?} copy the file names of images and placed documents `ids` (default: the selected ones and the rows picked in the Links panel, in links.list order) to the clipboard, one per line in that order; an embedded image gives the name its Links panel row shows (Links panel menu) → {text, names}", + ), ( "ui.placementOptionsDialog", "Placement Options…", diff --git a/crates/ui-egui/src/panels/links.rs b/crates/ui-egui/src/panels/links.rs index f9d9b524c9..75e3f92b10 100644 --- a/crates/ui-egui/src/panels/links.rs +++ b/crates/ui-egui/src/panels/links.rs @@ -5,8 +5,8 @@ //! Go To, Update and Edit Original act on the selected rows (Relink through its dialog, with the //! Replace choice: `ui.relinkDialog`); Link Info shows the details of the first. The flyout adds Relink to Folder, Find in Folder (Find Linked Files: //! `ui.findLinksInFolder`), Embed / Unembed, Placement Options, Select Linked / Embedded / Missing / -//! Modified (`addon.select.byLinkStatus`, Shift adds), Show filters, Sort, thumbnail size, -//! Show in Folder and Show DCS Transparency Interactions (a warning on the rows of images placed +//! Modified (`addon.select.byLinkStatus`, Shift adds), Show filters, Sort, Copy Info (the selected +//! rows' file names to the clipboard: `links.copyInfo`), thumbnail size, Show in Folder and Show DCS Transparency Interactions (a warning on the rows of images placed //! from DCS files that are transparent or overlap transparent objects). //! //! Images and placed documents in opacity-mask art and in the art of symbols, graph designs and @@ -179,6 +179,15 @@ fn selected_links(app: &VectorcraftApp, ctx: &egui::Context) -> Vec { ids } +/// [`selected_links`] with the app's window context, for a command run outside the panel (the +/// selected images and placed documents alone when there is no window). +pub(crate) fn selected_rows_of_app(app: &VectorcraftApp) -> Vec { + match app.ui_ctx.clone() { + Some(ctx) => selected_links(app, &ctx), + None => selected_images(app), + } +} + /// The rows of `list` whose image is selected. fn selected_rows<'a>(list: &'a Value, selected: &[u64]) -> Vec<&'a Value> { list["links"].as_array().into_iter().flatten().filter(|r| r["id"].as_u64().is_some_and(|id| selected.contains(&id))).collect() @@ -318,6 +327,48 @@ pub(crate) fn open_file(app: &mut VectorcraftApp, p: &Value, reveal: bool) -> Re Ok(json!({ "path": path })) } +/// The UI command `links.copyInfo {ids?}` (the panel menu's Copy Info): copy the file names of +/// images and placed documents `ids` (default: the selected rows, [`selected_rows_of_app`], in the +/// order `links.list` gives them; `null` counts as left out) to the clipboard, one per line in that +/// order → `{text, names}`. An embedded image gives the name its row shows. +pub(crate) fn copy_info(app: &mut VectorcraftApp, p: &Value) -> Result { + let key = "ids"; + let given = match p.get(key) { + None | Some(Value::Null) => None, + Some(Value::Array(a)) => { + let mut out = Vec::with_capacity(a.len()); + for (index, value) in a.iter().enumerate() { + out.push(value.as_u64().ok_or_else(|| format!("`{key}` entry {index} is {value}, not a non-negative integer object id"))?); + } + Some(out) + } + Some(_) => return Err(format!("{key} must be an array of non-negative integer object ids")), + }; + let list = app.session.execute("links.list", &json!({})).map_err(|e| e.to_string())?; + let rows: Vec<&Value> = list["links"].as_array().into_iter().flatten().collect(); + let wanted = match given { + Some(wanted) => wanted, + None => { + let sel = selected_rows_of_app(app); + ids(&rows, |r| r["id"].as_u64().is_some_and(|id| sel.contains(&id))) + } + }; + let by_id: std::collections::HashMap = + rows.iter().filter_map(|r| Some((r["id"].as_u64()?, r["name"].as_str().unwrap_or_default()))).collect(); + let mut names = Vec::with_capacity(wanted.len()); + for id in &wanted { + let name = by_id.get(id).ok_or_else(|| format!("object {} is not an image or a linked file", *id))?; + names.push((*name).to_string()); + } + if names.is_empty() { + return Err("select the images, or pass ids".into()); + } + let text = names.join("\n"); + app.clipboard_out = Some(text.clone()); + app.status("Copied the link info"); + Ok(json!({ "text": text, "names": names })) +} + /// Whether Edit Original may hand `path` to the system's default app: a regular file (after /// following links) whose name, and the name it links to, have the extension of a format /// VectorCraft reads. Anything else (a folder or app bundle, a script, a shortcut) is refused. @@ -693,7 +744,8 @@ fn link_info(ui: &mut Ui, info: Option<&Value>, units: vectorcraft_doc::Unit) { } /// The panel's flyout menu: the link commands for the selected rows, Select Linked / Embedded / -/// Missing / Modified for the whole document, and the Show, Sort and thumbnail options. +/// Missing / Modified for the whole document, the Show and Sort options, Copy Info and the +/// thumbnail options. pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { let o = options(ui.ctx()); // The rows the panel shows (the menu opens from it). @@ -780,6 +832,10 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { } } ui.separator(); + if menu_item(ui, tl!("Copy Info"), any, false) { + crate::menus::invoke(app, "links.copyInfo", json!({ "ids": ids(&sel, |_| true) })); + } + ui.separator(); for (px, label) in THUMBS { if menu_item(ui, tl!(label), true, o.thumb == px) { set_options(ui.ctx(), |o| o.thumb = px); diff --git a/crates/ui-egui/src/panels/tests_links.rs b/crates/ui-egui/src/panels/tests_links.rs index 6b773e9d3b..fb31236931 100644 --- a/crates/ui-egui/src/panels/tests_links.rs +++ b/crates/ui-egui/src/panels/tests_links.rs @@ -96,6 +96,42 @@ fn the_panel_lists_the_images_with_link_info_for_the_selected_one() { } } +/// Copy Info copies the file names of the selected links, or of `ids` in the order given, one per +/// line; it is off with nothing selected, and a bad `ids` leaves the clipboard as it was. +#[test] +fn copy_info_copies_the_file_names_of_the_links() { + let dir = Folder::new("copy-info"); + let (mut app, linked, embedded) = app(&dir); + let menu = painted_text(&mut app, super::links::menu); + assert!(menu.contains("Copy Info"), "{menu}"); + // The selection is the embedded image: its row's name. + assert!(crate::menus::enabled(&app, "links.copyInfo")); + let r = app.run("links.copyInfo", json!({})).unwrap(); + assert_eq!(r["names"], json!(["embedded.png"])); + assert_eq!(app.clipboard_out.take().as_deref(), Some("embedded.png")); + // Both selected: in the order the list gives them (the top image first). + app.run("select.set", json!({"ids": [linked, embedded]})).unwrap(); + assert_eq!(app.run("links.copyInfo", json!({})).unwrap()["text"], "embedded.png\nlinked.png"); + assert_eq!(app.clipboard_out.take().as_deref(), Some("embedded.png\nlinked.png")); + // `ids` in the order given, whatever is selected. + app.run("select.none", json!({})).unwrap(); + let r = app.run("links.copyInfo", json!({"ids": [linked, embedded]})).unwrap(); + assert_eq!(r["names"], json!(["linked.png", "embedded.png"])); + assert_eq!(app.clipboard_out.take().as_deref(), Some("linked.png\nembedded.png")); + // Errors copy nothing. + let rect = app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 60, "height": 60})).unwrap()["id"].as_u64().unwrap(); + app.run("select.none", json!({})).unwrap(); + for bad in + [json!({"ids": [linked, rect]}), json!({"ids": [linked, 999_999]}), json!({"ids": "all"}), json!({"ids": [linked, -1]}), json!({"ids": []})] + { + assert!(app.run("links.copyInfo", bad.clone()).is_err(), "{bad}"); + assert!(app.clipboard_out.is_none(), "{bad}"); + } + assert!(!crate::menus::enabled(&app, "links.copyInfo")); + assert!(app.run("links.copyInfo", json!({})).is_err()); + assert!(app.clipboard_out.is_none()); +} + /// Shift-click selects the images of the rows from the last row clicked without Shift; Ctrl/Cmd-click /// adds or removes one image, and Ctrl/Cmd-Shift-click adds the rows' images to the selection. #[test] @@ -160,6 +196,11 @@ fn a_link_inside_a_symbol_is_listed_and_picked_in_the_panel() { click_row(&mut app, &ctx, "inside.png", egui::Modifiers::NONE, 1.0); assert!(selected(&app).is_empty(), "the canvas can't select it"); assert!(shown(&mut app, 1.5).iter().any(|t| t == "30 × 20 px"), "Link Info of the symbol's image"); + // Copy Info without ids copies the row picked in the panel. + app.ui_ctx = Some(ctx.clone()); + assert!(crate::menus::enabled(&app, "links.copyInfo")); + assert_eq!(app.run("links.copyInfo", json!({})).unwrap()["text"], "inside.png"); + assert_eq!(app.clipboard_out.take().as_deref(), Some("inside.png")); click_row(&mut app, &ctx, "layer.png", egui::Modifiers::COMMAND, 2.0); assert_eq!(selected(&app), [layer]); // Both rows are selected until the canvas selection changes: then the panel's pick goes too. diff --git a/docs/mcp.md b/docs/mcp.md index cf41f3aaab..bd3329fa2c 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7528,6 +7528,12 @@ bounds; `clip` puts it in a clip group of the old bounds when it is larger). The except for a placed document, which opens in a tab. With the preference `editOriginalSystemDefaults` (Preferences › File Handling › Use System Defaults for Edit Original, on by default) off, Edit Original opens a raster image in the app that made it, PhotoCraft, where it is installed, and anything else in the system's default app (#5236). +The UI command `links.copyInfo {ids?}` (the panel menu's Copy Info) copies the file names of images and placed +documents `ids` to the clipboard, one per line in the order given, and returns `{text, names}`. Without `ids` (or with +`ids: null`, as for the other `ids` commands) it copies the selected ones, and the rows outside the layer tree picked in +the panel, in the order `links.list` gives them; the panel menu passes the selected rows in the order the panel shows +them. An embedded image gives the name its row shows. An id that is not an image or a placed document, a +malformed `ids`, or nothing to copy is an error, and the clipboard is left as it was. ```json {"name":"run_command","arguments":{"command":"links.list","params":{"show":"missing"}}} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ddcbb79f72..15eb7cc80b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1856,6 +1856,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - With Enable Background Export on, an Export for Screens with no folder of its own also writes in the background into the folder its `exportPreset` keeps, with the same progress dialog and Cancel, and the status bar names that folder. When that folder is outside an MCP client's read roots, the reply, its errors and the status bar name it by its own name, as for an export made at once (`dialogs::tests_screens::an_export_into_a_presets_folder_writes_in_the_background`, `fileio::tests_screens::a_prepared_export_into_a_presets_folder_outside_the_read_root_leaves_it_out`). Behavior reference: the help page, https://helpx.adobe.com/illustrator/using/exporting-artwork.html (exports run in the background by default). - Missing linked files can be looked for in a folder and its subfolders: Find in Folder… in the Linked File Not Found dialog and in the Links panel menu lists the files with each one's name, those with the size and contents saved with the link first, and relinks the files chosen, copying an image's file into the document's folder when asked, without replacing a file there (`links.findFiles`, `links.relink {copy}`). In the Links panel it looks for the selected linked files when any are selected. - The Links panel's Relink… opens a Relink dialog whose Replace menu picks which links take the new file: Selected Instances (the selected images, as before), All Instances (every image linked to the same file), Missing Links from This Folder (then every other missing link whose file name is in the new file's folder) and Each Link Separately (a file for each selected link in turn). Each relinks as one undo step (`links.relink {scope}`, `ui.relinkDialog`). Relink to Folder… stays as it is. + - The Links panel menu's Copy Info ([Links panel](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-from-other-apps/links-panel-in-illustrator.html)) copies the selected link's file name to the clipboard (`links.copyInfo`). VectorCraft's own rules: with several rows selected it copies one name per line in the order the panel shows them, an embedded image gives the name its row shows, and the item is off with no row selected. - Linked files inside symbols, graph designs, patterns and opacity masks are saved with their paths relative to the document, as linked files in the layers are, so they are found after the document and its files move to another folder together; on open each of those links takes the path where its file was found. Update Links, and opening with Update Links: Automatically, read a modified file again for that art too, and saving a document refreshes its placed copies inside symbols and patterns of the other open documents. Evidence: `links_outside_the_layers_find_their_files_after_the_folder_moves`, `update_links_reads_files_again_inside_symbols_patterns_and_masks`, `saving_a_document_refreshes_its_placed_copies_inside_symbols_and_patterns`. - A linked file that is missing when a moved document is saved keeps the folder its relative path names, instead of a relative path worked out from the out-of-date absolute path, also for a `.ai` file another app wrote (such as `src/`), so the file is found once it is back in that folder. Evidence: `a_missing_link_keeps_its_relative_path_when_the_moved_document_is_saved`, `links_of_an_imported_file_are_found_by_their_relative_folder`, `a_missing_link_of_a_moved_document_keeps_its_relative_place`. - On Windows, a document opened from a mapped network drive finds its links stored with the share's own path (`\\server\share\…`), as the same document opened from the share does; links on other computers stay missing.