diff --git a/Tildone.xcodeproj/project.pbxproj b/Tildone.xcodeproj/project.pbxproj index c27be90..35f74fa 100644 --- a/Tildone.xcodeproj/project.pbxproj +++ b/Tildone.xcodeproj/project.pbxproj @@ -30,7 +30,6 @@ F1D17AA92B47741900C7A500 /* FocusFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1D17AA82B47741900C7A500 /* FocusFilter.swift */; }; F1D3001B2B51F2FB00654241 /* Launcher+Toggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1D3001A2B51F2FB00654241 /* Launcher+Toggle.swift */; }; F1D3001D2B51F3E100654241 /* UpdateChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1D3001C2B51F3E100654241 /* UpdateChecker.swift */; }; - F1D3001F2B51FE0E00654241 /* Updates.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1D3001E2B51FE0E00654241 /* Updates.swift */; }; F1D300212B52061400654241 /* About.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1D300202B52061400654241 /* About.swift */; }; F1EA81F82AFEA80C00E58A73 /* WindowAccessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1EA81F72AFEA80C00E58A73 /* WindowAccessor.swift */; }; /* End PBXBuildFile section */ @@ -80,7 +79,6 @@ F1D17AA82B47741900C7A500 /* FocusFilter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FocusFilter.swift; sourceTree = ""; }; F1D3001A2B51F2FB00654241 /* Launcher+Toggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Launcher+Toggle.swift"; sourceTree = ""; }; F1D3001C2B51F3E100654241 /* UpdateChecker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateChecker.swift; sourceTree = ""; }; - F1D3001E2B51FE0E00654241 /* Updates.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Updates.swift; sourceTree = ""; }; F1D300202B52061400654241 /* About.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = About.swift; sourceTree = ""; }; F1EA81F72AFEA80C00E58A73 /* WindowAccessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowAccessor.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -189,7 +187,6 @@ F16670482AF711EC000B76A5 /* Note.swift */, F180D8DB2AF854D7002ED6BF /* Desktop.swift */, F17F46952B4A0FE000127AD9 /* Settings.swift */, - F1D3001E2B51FE0E00654241 /* Updates.swift */, F1D300202B52061400654241 /* About.swift */, ); path = Views; @@ -367,7 +364,6 @@ F17F469A2B4A1C0B00127AD9 /* View+Util.swift in Sources */, F16670472AF711EC000B76A5 /* TildoneApp.swift in Sources */, F19B3BF32B155711003C094A /* LicenseType.swift in Sources */, - F1D3001F2B51FE0E00654241 /* Updates.swift in Sources */, F17086B82B48D5BF00D2C7DD /* Launcher.swift in Sources */, F1D300212B52061400654241 /* About.swift in Sources */, F166707A2AF7167D000B76A5 /* Constants.swift in Sources */, @@ -535,7 +531,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 13; + CURRENT_PROJECT_VERSION = 14; DEVELOPMENT_ASSET_PATHS = "\"Tildone/Preview Content\""; DEVELOPMENT_TEAM = F6HFAVTS49; ENABLE_HARDENED_RUNTIME = YES; @@ -567,7 +563,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 13; + CURRENT_PROJECT_VERSION = 14; DEVELOPMENT_ASSET_PATHS = "\"Tildone/Preview Content\""; DEVELOPMENT_TEAM = F6HFAVTS49; ENABLE_HARDENED_RUNTIME = YES; diff --git a/Tildone/Localizable.xcstrings b/Tildone/Localizable.xcstrings index e507a51..7e634c9 100644 --- a/Tildone/Localizable.xcstrings +++ b/Tildone/Localizable.xcstrings @@ -1,28 +1,6 @@ { "sourceLanguage" : "en", "strings" : { - "(yours is %@)" : { - "localizations" : { - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "(actual %@)" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "(le vôtre est %@)" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "(你的是 %@)" - } - } - } - }, "© 2023 Diego Rivera" : { "localizations" : { "es" : { @@ -205,78 +183,6 @@ } } }, - "Check for Updates..." : { - "localizations" : { - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Comprobar actualizaciones..." - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Vérifier les mises à jour..." - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "检查更新..." - } - } - } - }, - "Check for Updates.window" : { - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Check for Updates" - } - }, - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Comprobar actualizaciones" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Vérifier les mises à jour" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "检查更新" - } - } - } - }, - "Check it on the App Store" : { - "localizations" : { - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Actualizar en App Store" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Vérifiez sur l'App Store" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "在App Store中查看" - } - } - } - }, "Check release notes" : { "extractionState" : "manual", "localizations" : { @@ -1010,28 +916,6 @@ } } }, - "There is an update available!" : { - "localizations" : { - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "¡Hay una actualización disponible!" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Une mise à jour est disponible !" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "有可用更新!" - } - } - } - }, "Tildone" : { "localizations" : { "es" : { @@ -1187,34 +1071,6 @@ } } }, - "Version.uptodate %@" : { - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Version %@" - } - }, - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Versión %@" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Version %@" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "版本 %@" - } - } - } - }, "Vertical" : { "localizations" : { "es" : { @@ -1258,28 +1114,6 @@ } } } - }, - "Your app is up to date" : { - "localizations" : { - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Aplicación actualizada a su última versión" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Votre application est à jour" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "您的应用已更新" - } - } - } } }, "version" : "1.0" diff --git a/Tildone/Services/UpdateChecker.swift b/Tildone/Services/UpdateChecker.swift index 375de4f..cb4516b 100644 --- a/Tildone/Services/UpdateChecker.swift +++ b/Tildone/Services/UpdateChecker.swift @@ -10,23 +10,6 @@ import StoreKit struct UpdateChecker { - static func getAppVersion(completion: @escaping (String?) -> Void) { - Task { - do { - let app = try await AppTransaction.shared - switch app { - case .verified(let installed): - completion(installed.appVersion) - default: - completion(nil) - } - } catch { - debugPrint(error.localizedDescription) - completion(nil) - } - } - } - static func getNewReleaseCheckList() async -> TodoList? { do { let app = try await AppTransaction.shared @@ -69,7 +52,6 @@ extension UpdateChecker { static let knownVersionFlag: String = "knownAppVersion" } enum Remote { - static let appStoreAppUrl: String = "https://apps.apple.com/app/tildone/id6473126292" static let releaseNotesUrl: String = "http://cuatro.studio/tildone/release" } } diff --git a/Tildone/Tildone.entitlements b/Tildone/Tildone.entitlements index 3220eb4..9557a8e 100644 --- a/Tildone/Tildone.entitlements +++ b/Tildone/Tildone.entitlements @@ -14,7 +14,5 @@ com.apple.security.network.client - com.apple.security.network.server - diff --git a/Tildone/TildoneApp.swift b/Tildone/TildoneApp.swift index d5635a8..1ac1b9a 100644 --- a/Tildone/TildoneApp.swift +++ b/Tildone/TildoneApp.swift @@ -46,15 +46,10 @@ struct TildoneApp: App { Button("About Tildone") { openWindow(id: Id.aboutWindow) } - Button("Check for Updates...") { - openWindow(id: Id.updateWindow) - } - Divider() SettingsLink { Text("Settings...") } .keyboardShortcut(",") - Divider() Button("Quit Tildone") { NSApplication.shared.terminate(self) } @@ -99,11 +94,6 @@ struct TildoneApp: App { } .windowResizability(.contentSize) .commandsRemoved() - Window("Check for Updates.window", id: Id.updateWindow) { - Updates() - } - .windowResizability(.contentSize) - .commandsRemoved() Settings { SettingsForm() } diff --git a/Tildone/Views/Updates.swift b/Tildone/Views/Updates.swift deleted file mode 100644 index cc261ba..0000000 --- a/Tildone/Views/Updates.swift +++ /dev/null @@ -1,85 +0,0 @@ -// -// Updates.swift -// Tildone -// -// Created by Diego Rivera on 13/1/24. -// - -import SwiftUI - -struct Updates: View { - @State private var latestVersion: String? - @State private var isChecking: Bool = true - @State private var isVisitingApp: Bool = false - - private var currentVersion: String? { - Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String - } - - private var appIconImage: Image? = { - guard let image = NSImage(named: Id.appIcon) else { - return nil - } - return Image(nsImage: image) - }() - - var body: some View { - HStack { - if appIconImage != nil { - appIconImage! - .resizable() - .frame(maxWidth: Frame.aboutIconSize, maxHeight: Frame.aboutIconSize) - .padding(.leading, 12) - } - VStack { - if isChecking { - ProgressView() - } else { - Text("Tildone") - .font(.title) - .bold() - .padding(.bottom, 10) - if let latest = latestVersion, - let current = currentVersion, - latest.compare(current, options: .numeric) == .orderedDescending - { - Text("There is an update available!") - HStack(spacing: 2) { - Text("Version \(latest)") - .font(.subheadline) - if currentVersion != nil { - Text("(yours is \(currentVersion!))") - .font(.subheadline) - } - } - if let appStoreLink = URL(string: UpdateChecker.Remote.appStoreAppUrl) { - Button("Check it on the App Store") { - NSWorkspace.shared.open(appStoreLink) - } - .buttonStyle(.borderedProminent) - .tint(Color.accentColor) - .padding(.top, 12) - } else { - Text("Check it on the App Store") - } - } else { - Text("Your app is up to date") - .multilineTextAlignment(.center) - if let current = currentVersion { - Text("Version.uptodate \(current)") - .font(.subheadline) - } - } - } - } - .padding(.horizontal, 20) - .onAppear { - UpdateChecker.getAppVersion { version in - self.latestVersion = version - self.isChecking = false - } - } - } - .frame(width: 360, height: 180) - } -}