From 9be247c36cb15153de2cbafe7e1c53209182f29e Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sat, 14 Sep 2024 19:09:30 +0200 Subject: Add about and sandbox sparkle --- Captura/Captura.entitlements | 5 ++++ Captura/Info.plist | 2 ++ .../Presentation/Screens/PreferencesScreen.swift | 3 +++ Captura/Presentation/Settings/AboutSettings.swift | 29 ++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 Captura/Presentation/Settings/AboutSettings.swift (limited to 'Captura') diff --git a/Captura/Captura.entitlements b/Captura/Captura.entitlements index f6cc65e..b7ad98c 100644 --- a/Captura/Captura.entitlements +++ b/Captura/Captura.entitlements @@ -2,6 +2,11 @@ + com.apple.security.temporary-exception.mach-lookup.global-name + + $(PRODUCT_BUNDLE_IDENTIFIER)-spks + $(PRODUCT_BUNDLE_IDENTIFIER)-spki + com.apple.developer.aps-environment development com.apple.developer.icloud-container-identifiers diff --git a/Captura/Info.plist b/Captura/Info.plist index e997f3d..4c54891 100644 --- a/Captura/Info.plist +++ b/Captura/Info.plist @@ -2,6 +2,8 @@ + SUEnableInstallerLauncherService + SUFeedURL https://captura.tranquil.systems/appcast.xml SUPublicEDKey diff --git a/Captura/Presentation/Screens/PreferencesScreen.swift b/Captura/Presentation/Screens/PreferencesScreen.swift index c9c0c07..17ec3d7 100644 --- a/Captura/Presentation/Screens/PreferencesScreen.swift +++ b/Captura/Presentation/Screens/PreferencesScreen.swift @@ -9,6 +9,9 @@ struct PreferencesScreen: View { AdvancedSettings().tabItem { Label("Advanced", systemImage: "gear") }.padding(8.0).frame(minWidth: 300, minHeight: 260) + AboutSettings().tabItem { + Label("About", systemImage: "questionmark.circle.fill") + }.padding(8.0).frame(minWidth: 300, minHeight: 260) }.padding(16.0) } } diff --git a/Captura/Presentation/Settings/AboutSettings.swift b/Captura/Presentation/Settings/AboutSettings.swift new file mode 100644 index 0000000..f5fe77c --- /dev/null +++ b/Captura/Presentation/Settings/AboutSettings.swift @@ -0,0 +1,29 @@ +import SwiftUI + +struct AboutSettings: View { + + var appVersion: String { + let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown" + let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown" + return "Version \(version) (\(build))" + } + + var imprint = (try? AttributedString(markdown: "Captura is open source. Help and more information available at [captura.tranquil.systems](https://captura.tranquil.systems)")) ?? "" + + var body: some View { + Form { + VStack (alignment: .center) { + Text("Captura").bold() + Text(appVersion).foregroundStyle(.secondary) + Spacer() + Text(imprint) + .multilineTextAlignment(.center) + } + Spacer() + } + } +} + +#Preview { + AboutSettings() +} -- cgit