feat(export): right-click export can keep the OpsLog fields
The right-click export always called ExportADIFSelected with includeAppFields=false, so it wrote strictly standard ADIF. That is the right default when the file is going to another logger, but it silently drops every APP_ tag -- and an award reference such as RDA@KR-04 lives in APP_OPSLOG_AWARDREFS and nowhere else. Backing up a selection, or moving it to another OpsLog, lost the awards. Adds a second entry rather than a flag on the first: the two exports answer different questions, and a checkbox in a context menu would have to be read before every export.
This commit is contained in:
+14
-5
@@ -4229,11 +4229,20 @@ export default function App() {
|
||||
}
|
||||
// Right-click "Export selected to ADIF": only the highlighted rows.
|
||||
async function exportSelectedADIF(ids: number[], fields: string[] = []) {
|
||||
return exportSelectedADIFAs(ids, false, fields);
|
||||
}
|
||||
// The same export, keeping the APP_OPSLOG_* tags. Award references are the
|
||||
// reason it exists: RDA@KR-04 lives in APP_OPSLOG_AWARDREFS, and a standard
|
||||
// export — rightly — leaves every APP_ tag behind.
|
||||
async function exportSelectedADIFFull(ids: number[]) {
|
||||
return exportSelectedADIFAs(ids, true, []);
|
||||
}
|
||||
async function exportSelectedADIFAs(ids: number[], includeApp: boolean, fields: string[]) {
|
||||
if (ids.length === 0) return;
|
||||
try {
|
||||
const path = await SaveADIFFile();
|
||||
if (!path) return;
|
||||
const r = await ExportADIFSelected(path, false, ids as any, fields);
|
||||
const r = await ExportADIFSelected(path, includeApp, ids as any, fields);
|
||||
showToast(`Exported ${r.count} selected QSO${r.count > 1 ? 's' : ''} → ${r.path}`);
|
||||
} catch (e: any) { setError(String(e?.message ?? e)); }
|
||||
}
|
||||
@@ -5997,7 +6006,7 @@ export default function App() {
|
||||
<WorkedBeforeGrid key={`wbg-${activeProfileId ?? 'x'}`} wb={wbWithAwards as any} myGrid={station.my_grid} awardCols={awardCols} busy={wbBusy} currentCall={callsign} onRowDoubleClicked={(q) => openEdit(q.id as number)}
|
||||
onUpdateFromCty={bulkUpdateFromCty} onUpdateFromQRZ={bulkUpdateFromQRZ} onUpdateFromClublog={bulkUpdateFromClublog} onUpdateCountyFromULS={ulsReady ? bulkUpdateCountyFromULS : undefined}
|
||||
onSendTo={bulkSendTo} onSendRecording={bulkSendRecording} onSendEQSL={(ids) => setEqslQsoId(ids[0] ?? null)}
|
||||
onBulkEdit={openBulkEdit} onExportSelected={exportSelectedADIF} onExportSelectedFields={exportSelectedFields}
|
||||
onBulkEdit={openBulkEdit} onExportSelected={exportSelectedADIF} onExportSelectedFull={exportSelectedADIFFull} onExportSelectedFields={exportSelectedFields}
|
||||
onExportCabrilloSelected={exportSelectedCabrillo} onDelete={(ids) => setDeletingIds(ids)} />
|
||||
</div>
|
||||
);
|
||||
@@ -6054,7 +6063,7 @@ export default function App() {
|
||||
onSendRecording={bulkSendRecording}
|
||||
onSendEQSL={(ids) => setEqslQsoId(ids[0] ?? null)}
|
||||
onBulkEdit={openBulkEdit}
|
||||
onExportSelected={exportSelectedADIF}
|
||||
onExportSelected={exportSelectedADIF} onExportSelectedFull={exportSelectedADIFFull}
|
||||
onExportSelectedFields={exportSelectedFields}
|
||||
onExportFiltered={exportFilteredADIF}
|
||||
onDelete={(ids) => setDeletingIds(ids)}
|
||||
@@ -7453,7 +7462,7 @@ export default function App() {
|
||||
onSendRecording={bulkSendRecording}
|
||||
onSendEQSL={(ids) => setEqslQsoId(ids[0] ?? null)}
|
||||
onBulkEdit={openBulkEdit}
|
||||
onExportSelected={exportSelectedADIF}
|
||||
onExportSelected={exportSelectedADIF} onExportSelectedFull={exportSelectedADIFFull}
|
||||
onExportSelectedFields={exportSelectedFields}
|
||||
onExportFiltered={exportFilteredADIF}
|
||||
onExportCabrilloSelected={exportSelectedCabrillo}
|
||||
@@ -7786,7 +7795,7 @@ export default function App() {
|
||||
<WorkedBeforeGrid key={`wbg-${activeProfileId ?? 'x'}`} wb={wbWithAwards as any} myGrid={station.my_grid} awardCols={awardCols} busy={wbBusy} currentCall={callsign} onRowDoubleClicked={(q) => openEdit(q.id as number)}
|
||||
onUpdateFromCty={bulkUpdateFromCty} onUpdateFromQRZ={bulkUpdateFromQRZ} onUpdateFromClublog={bulkUpdateFromClublog} onUpdateCountyFromULS={ulsReady ? bulkUpdateCountyFromULS : undefined} onSendTo={bulkSendTo} onSendRecording={bulkSendRecording}
|
||||
onSendEQSL={(ids) => setEqslQsoId(ids[0] ?? null)}
|
||||
onBulkEdit={openBulkEdit} onExportSelected={exportSelectedADIF} onExportSelectedFields={exportSelectedFields}
|
||||
onBulkEdit={openBulkEdit} onExportSelected={exportSelectedADIF} onExportSelectedFull={exportSelectedADIFFull} onExportSelectedFields={exportSelectedFields}
|
||||
onExportCabrilloSelected={exportSelectedCabrillo} onDelete={(ids) => setDeletingIds(ids)} />
|
||||
</TabsContent>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user