mirror of
https://github.com/nimbold/Firelink.git
synced 2026-07-26 12:08:27 +00:00
2b820ec802
- Split monolithic SettingsView.swift into modular Settings panes - Add SOCKS5 proxy support to proxy configuration - Fix ListRowDensity application in DownloadTable - Improve discoverability of global speed limit by adding it to Downloads pane
47 lines
1.5 KiB
Swift
47 lines
1.5 KiB
Swift
import SwiftUI
|
|
import AppKit
|
|
|
|
struct EngineSettingsPane: View {
|
|
@State private var version = "Checking..."
|
|
|
|
private var executableURL: URL? {
|
|
Aria2DownloadEngine.findExecutable()
|
|
}
|
|
|
|
var body: some View {
|
|
Form {
|
|
Section {
|
|
LabeledContent("Status") {
|
|
Label(
|
|
executableURL == nil ? "Missing" : "Ready",
|
|
systemImage: executableURL == nil ? "exclamationmark.triangle.fill" : "checkmark.seal.fill"
|
|
)
|
|
.foregroundStyle(executableURL == nil ? .orange : .green)
|
|
}
|
|
|
|
LabeledContent("Binary") {
|
|
Text(executableURL?.path ?? "Not found")
|
|
.font(.system(.body, design: .monospaced))
|
|
.textSelection(.enabled)
|
|
}
|
|
|
|
LabeledContent("Version") {
|
|
Text(version)
|
|
.font(.system(.body, design: .monospaced))
|
|
.textSelection(.enabled)
|
|
}
|
|
|
|
if executableURL == nil {
|
|
Text("Install aria2 with Homebrew or bundle aria2c inside the app resources.")
|
|
.font(.caption)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
}
|
|
}
|
|
.formStyle(.grouped)
|
|
.task {
|
|
version = await Aria2DownloadEngine.versionString() ?? "Unavailable"
|
|
}
|
|
}
|
|
}
|