feat(qsl): copy a card design from another profile

A second profile is usually the same operator with a different rig or a
different locator — same callsign, same cards. Having to redraw a design
because the antenna changed is work nobody should do.

The designer now lists the designs the active profile cannot see and copies a
chosen one into it. Designs it already sees — its own, and the shared ones —
are left out: they are not something to copy.

A COPY, not a move or a share. The original profile keeps its design untouched
and the duplicate is free to diverge, which it usually will: a second profile
exists because something differs, and that something often ends up on the card.

The PICTURES are copied too, and that is the part worth getting right. Stored
documents reference photos by name relative to the template's own asset folder,
so duplicating the JSON alone would point the new design at files that are not
in its folder. It is validated against its own folder afterwards, and a failure
rolls the row back rather than leaving a design whose pictures are missing.
Sharing the source's folder was the other option and a worse one: deleting
either design would then have emptied the other.
This commit is contained in:
2026-08-13 18:08:14 +02:00
parent 4e2a5877d6
commit 380472bda8
6 changed files with 166 additions and 4 deletions
+4
View File
@@ -770,6 +770,8 @@ export function PopulateBuiltinReferences(arg1:string):Promise<number>;
export function PublishLogNow():Promise<string>;
export function QSLCopyTemplateToActiveProfile(arg1:number):Promise<number>;
export function QSLDefaultTemplateID():Promise<number>;
export function QSLDeleteTemplate(arg1:number):Promise<void>;
@@ -784,6 +786,8 @@ export function QSLGetEmailTemplates():Promise<main.QSLEmailTemplates>;
export function QSLGetTemplate(arg1:number):Promise<string>;
export function QSLListOtherProfileTemplates():Promise<Array<main.QSLForeignTemplate>>;
export function QSLListTemplates():Promise<Array<main.QSLTemplateInfo>>;
export function QSLPhotoDataURL(arg1:number,arg2:string):Promise<string>;
+8
View File
@@ -1482,6 +1482,10 @@ export function PublishLogNow() {
return window['go']['main']['App']['PublishLogNow']();
}
export function QSLCopyTemplateToActiveProfile(arg1) {
return window['go']['main']['App']['QSLCopyTemplateToActiveProfile'](arg1);
}
export function QSLDefaultTemplateID() {
return window['go']['main']['App']['QSLDefaultTemplateID']();
}
@@ -1510,6 +1514,10 @@ export function QSLGetTemplate(arg1) {
return window['go']['main']['App']['QSLGetTemplate'](arg1);
}
export function QSLListOtherProfileTemplates() {
return window['go']['main']['App']['QSLListOtherProfileTemplates']();
}
export function QSLListTemplates() {
return window['go']['main']['App']['QSLListTemplates']();
}