Files
oai-swift/oAI/Views/Screens/AboutView.swift
T
runeandClaude Sonnet 5 cf3f4ebfe4 Relicense oAI from AGPL-3.0-or-later to PolyForm Noncommercial 1.0.0
Switches the project from AGPL to a source-available license that
restricts commercial use — selling oAI or any part of it, standalone
or bundled into another product/service, now requires a separate
commercial license from the copyright holder. Noncommercial use,
study, modification, and sharing remain fully permitted.

Updates: LICENSE (canonical PolyForm Noncommercial 1.0.0 text +
commercial licensing contact note), SPDX headers and file-header
boilerplate across all Swift source files, the in-app About dialog's
license link (+ its localization catalog entry), README.md and
DEVELOPMENT.md license sections.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 11:16:09 +02:00

93 lines
2.7 KiB
Swift

//
// AboutView.swift
// oAI
//
// About modal with app icon and version info
//
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
// Copyright (C) 2026 Rune Olsen
//
// This file is part of oAI.
//
// oAI is licensed under the PolyForm Noncommercial License 1.0.0.
// You may use, study, modify, and share it for any noncommercial
// purpose. Commercial use — including selling oAI or any part of
// it, standalone or bundled into another product or service —
// requires a separate commercial license from the copyright holder.
//
// See the LICENSE file or
// <https://polyformproject.org/licenses/noncommercial/1.0.0> for
// the full license text. For commercial licensing, contact Rune
// Olsen via <https://mac.oai.pm>.
import SwiftUI
struct AboutView: View {
@Environment(\.dismiss) var dismiss
private var appVersion: String {
Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0"
}
private var buildNumber: String {
Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "1"
}
var body: some View {
VStack(spacing: 16) {
Spacer().frame(height: 8)
Image("AppLogo")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 128, height: 128)
.clipShape(RoundedRectangle(cornerRadius: 24))
.shadow(color: .cyan.opacity(0.3), radius: 12)
Text("oAI")
.font(.system(size: 28, weight: .bold))
Text("Version \(appVersion) (\(buildNumber))")
.font(.callout)
.foregroundStyle(.secondary)
Text("Multi-provider AI chat client")
.font(.subheadline)
.foregroundStyle(.secondary)
Divider()
.padding(.horizontal, 40)
VStack(spacing: 4) {
Text("© 2026 [Rune Olsen](https://blog.rune.pm)")
.font(.caption)
.foregroundStyle(.secondary)
Text("[PolyForm Noncommercial License 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0)")
.font(.caption)
.foregroundStyle(.secondary)
Text("Built with SwiftUI")
.font(.caption)
.foregroundStyle(.tertiary)
}
Spacer().frame(height: 4)
Button("OK") { dismiss() }
.keyboardShortcut(.return, modifiers: [])
.keyboardShortcut(.escape, modifiers: [])
.buttonStyle(.borderedProminent)
.controlSize(.regular)
Spacer().frame(height: 20)
}
.frame(width: 320, height: 390)
}
}
#Preview {
AboutView()
}