PM-.snap-Import (FieldsToApply, Merge, Aufnahmedatum), Aufnahmeort/Copyright-Status/DataMining, FTP-Profile Beautiful Sports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012bGzgsxrmbBhDzeMV2L57D
This commit is contained in:
1 parent
0b41f09206
commit
42ab9c9361
13 files changed
+472
-39
No files matched your search
@@ -23,6 +23,8 @@ struct IPTCFieldsForm: View {
|
||||
var mixed: Set<String> = []
|
||||
var dirty: Set<String> = []
|
||||
var onEdit: (String) -> Void = { _ in }
|
||||
/// PM-style "apply" checkboxes (template editor only).
|
||||
var applied: Binding<Set<String>>? = nil
|
||||
@AppStorage("collapsedIPTCSections") private var collapsedRaw = ""
|
||||
|
||||
var body: some View {
|
||||
@@ -32,8 +34,21 @@ struct IPTCFieldsForm: View {
|
||||
DisclosureGroup(isExpanded: expandedBinding(section)) {
|
||||
VStack(alignment: .leading, spacing: 6) {
|
||||
ForEach(fields) { field in
|
||||
FieldRow(field: field, text: binding(field), isMixed: mixed.contains(field.id) && !dirty.contains(field.id),
|
||||
isDirty: dirty.contains(field.id))
|
||||
HStack(alignment: .top, spacing: 6) {
|
||||
if let applied {
|
||||
Toggle("", isOn: Binding(
|
||||
get: { applied.wrappedValue.contains(field.id) },
|
||||
set: { on in
|
||||
if on { applied.wrappedValue.insert(field.id) } else { applied.wrappedValue.remove(field.id) }
|
||||
}))
|
||||
.toggleStyle(.checkbox)
|
||||
.labelsHidden()
|
||||
.padding(.top, 16)
|
||||
.help("Feld beim Anwenden schreiben (wie das Häkchen in Photo Mechanic)")
|
||||
}
|
||||
FieldRow(field: field, text: binding(field), isMixed: mixed.contains(field.id) && !dirty.contains(field.id),
|
||||
isDirty: dirty.contains(field.id))
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.top, 4)
|
||||
|
||||
@@ -103,16 +103,34 @@ struct TemplateManagerView: View {
|
||||
ForEach(ListMergeMode.allCases, id: \.self) { Text($0.rawValue).tag($0) }
|
||||
}
|
||||
.fixedSize()
|
||||
Toggle("Leere Felder löschen beim Anwenden", isOn: $state.templates[i].clearEmptyFields)
|
||||
Toggle("Nur angehakte Felder (wie PM)", isOn: Binding(
|
||||
get: { state.templates[i].appliedFields != nil },
|
||||
set: { on in
|
||||
let t = state.templates[i]
|
||||
state.templates[i].appliedFields = on
|
||||
? Set(IPTCField.all.filter { !t.values.isEmpty($0) }.map(\.id)) : nil
|
||||
}))
|
||||
if state.templates[i].appliedFields == nil {
|
||||
Toggle("Leere Felder löschen", isOn: $state.templates[i].clearEmptyFields)
|
||||
}
|
||||
Toggle("Datum = Aufnahmezeit", isOn: $state.templates[i].dateFromCapture)
|
||||
.help("Erstellungsdatum/-zeit aus der EXIF-Aufnahmezeit jedes Bildes (PM: Apply Date → Capture Date)")
|
||||
}
|
||||
.font(.callout)
|
||||
if !state.templates[i].unmappedPMCodes.isEmpty {
|
||||
Text("Unbekannte PM-Feldcodes: \(state.templates[i].unmappedPMCodes.joined(separator: ", ")) – bitte Häkchen prüfen.")
|
||||
.font(.caption).foregroundStyle(.orange)
|
||||
}
|
||||
if !state.templates[i].extras.isEmpty {
|
||||
Text("\(state.templates[i].extras.count) zusätzliche XMP-Felder aus PM werden beim Export beibehalten.")
|
||||
.font(.caption).foregroundStyle(.secondary)
|
||||
}
|
||||
Divider()
|
||||
ScrollView {
|
||||
IPTCFieldsForm(texts: $texts) { _ in save() }
|
||||
IPTCFieldsForm(texts: $texts, onEdit: { _ in save() },
|
||||
applied: state.templates[i].appliedFields == nil ? nil : Binding(
|
||||
get: { state.templates[i].appliedFields ?? [] },
|
||||
set: { state.templates[i].appliedFields = $0 }))
|
||||
.padding(.trailing, 8)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user