You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.6 KiB
49 lines
1.6 KiB
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@EnvironmentObject private var settings: AppSettings
|
|
@StateObject private var coordinator = ConversionCoordinator()
|
|
@State private var showSettings = false
|
|
|
|
var body: some View {
|
|
VStack(spacing: 16) {
|
|
DropZoneView()
|
|
|
|
if !coordinator.items.isEmpty {
|
|
FileListView()
|
|
|
|
if !coordinator.problemItems.isEmpty {
|
|
Text("\(coordinator.problemItems.count) Datei(en) brauchen Aufmerksamkeit.")
|
|
.font(.footnote)
|
|
.foregroundStyle(.orange)
|
|
}
|
|
|
|
HStack {
|
|
ProgressView(value: coordinator.overallProgress)
|
|
Button("Leeren") { coordinator.removeAll() }
|
|
.disabled(coordinator.isRunning)
|
|
}
|
|
}
|
|
|
|
Divider()
|
|
|
|
HStack {
|
|
Button("Einstellungen…") { showSettings = true }
|
|
Spacer()
|
|
Button("Start") {
|
|
guard let target = settings.targetFolder else { return }
|
|
coordinator.start(targetFolder: target)
|
|
}
|
|
.keyboardShortcut(.defaultAction)
|
|
.disabled(coordinator.items.isEmpty || coordinator.isRunning || settings.targetFolder == nil)
|
|
}
|
|
}
|
|
.padding(20)
|
|
.frame(minWidth: 520, minHeight: 460)
|
|
.environmentObject(coordinator)
|
|
.sheet(isPresented: $showSettings) {
|
|
SettingsView()
|
|
}
|
|
}
|
|
}
|