aboutsummaryrefslogtreecommitdiff
path: root/Map
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2024-09-16 12:10:02 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2024-09-16 12:10:02 +0200
commit4e7e11cfd56adfa14a557c76e192ff3148cd2842 (patch)
treef7e61dd1ec2ba76535b4650e6e5b960f337a88f0 /Map
parent9acbbf34f8183ead1f2a12e60ecb919d5b3fec07 (diff)
3.0.03.0.0
Diffstat (limited to 'Map')
-rw-r--r--Map/Info.plist8
-rw-r--r--Map/Map.entitlements15
-rw-r--r--Map/MapApp.swift5
-rw-r--r--Map/Presentation/Commands/UpdateCommands.swift39
-rw-r--r--Map/Presentation/MapEditor.swift1
5 files changed, 62 insertions, 6 deletions
diff --git a/Map/Info.plist b/Map/Info.plist
index 61150cf..e862423 100644
--- a/Map/Info.plist
+++ b/Map/Info.plist
@@ -2,6 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>SUEnableInstallerLauncherService</key>
+ <true/>
+ <key>SUPublicEDKey</key>
+ <string>lacD9VFVjJO55y+hEy+ReU4S0xbrnbdhncui1qLsmfI=</string>
+ <key>SUFeedURL</key>
+ <string>https://map.tranquil.systems/appcast.xml</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
@@ -25,7 +31,7 @@
<string>public.plain-text</string>
</array>
<key>UTTypeDescription</key>
- <string>Wardley Map written in Map's wmap syntax</string>
+ <string>Wardley Map written in Map&apos;s wmap syntax</string>
<key>UTTypeIcons</key>
<dict/>
<key>UTTypeIdentifier</key>
diff --git a/Map/Map.entitlements b/Map/Map.entitlements
index 6d968ed..d363e1c 100644
--- a/Map/Map.entitlements
+++ b/Map/Map.entitlements
@@ -2,9 +2,16 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
- <key>com.apple.security.app-sandbox</key>
- <true/>
- <key>com.apple.security.files.user-selected.read-write</key>
- <true/>
+ <key>com.apple.security.app-sandbox</key>
+ <true/>
+ <key>com.apple.security.files.user-selected.read-write</key>
+ <true/>
+ <key>com.apple.security.network.client</key>
+ <true/>
+ <key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
+ <array>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)-spks</string>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)-spki</string>
+ </array>
</dict>
</plist>
diff --git a/Map/MapApp.swift b/Map/MapApp.swift
index 9aff010..ef1b119 100644
--- a/Map/MapApp.swift
+++ b/Map/MapApp.swift
@@ -1,12 +1,17 @@
import SwiftUI
+import Sparkle
@main
struct MapApp: App {
+
+ private let updaterController: SPUStandardUpdaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)
+
var body: some Scene {
DocumentGroup(newDocument: MapDocument()) { file in
MapEditor(document: file.$document, url: file.fileURL)
}.commands {
MapCommands()
+ UpdateCommands(updaterController: updaterController)
}
}
}
diff --git a/Map/Presentation/Commands/UpdateCommands.swift b/Map/Presentation/Commands/UpdateCommands.swift
new file mode 100644
index 0000000..44a4610
--- /dev/null
+++ b/Map/Presentation/Commands/UpdateCommands.swift
@@ -0,0 +1,39 @@
+import SwiftUI
+import Sparkle
+
+struct UpdateCommands: Commands {
+ let updaterController: SPUStandardUpdaterController
+
+ var body: some Commands {
+ CommandGroup(after: .appInfo) {
+ CheckForUpdatesView(updater: updaterController.updater)
+ }
+ }
+}
+
+
+struct CheckForUpdatesView: View {
+ @ObservedObject private var checkForUpdatesViewModel: CheckForUpdatesViewModel
+ private let updater: SPUUpdater
+
+ init(updater: SPUUpdater) {
+ self.updater = updater
+
+ // Create our view model for our CheckForUpdatesView
+ self.checkForUpdatesViewModel = CheckForUpdatesViewModel(updater: updater)
+ }
+
+ var body: some View {
+ Button("Check for Updates…", action: updater.checkForUpdates)
+ .disabled(!checkForUpdatesViewModel.canCheckForUpdates)
+ }
+}
+
+final class CheckForUpdatesViewModel: ObservableObject {
+ @Published var canCheckForUpdates = false
+
+ init(updater: SPUUpdater) {
+ updater.publisher(for: \.canCheckForUpdates)
+ .assign(to: &$canCheckForUpdates)
+ }
+}
diff --git a/Map/Presentation/MapEditor.swift b/Map/Presentation/MapEditor.swift
index bf33f75..f9415d3 100644
--- a/Map/Presentation/MapEditor.swift
+++ b/Map/Presentation/MapEditor.swift
@@ -97,7 +97,6 @@ struct MapEditor: View {
}
private func onDragVertex(vertex: Vertex, x: CGFloat, y: CGFloat) {
- print("Dragging: \(vertex), \(x), \(y)")
}
private func saveImage() {