diff --git a/Catch.xcodeproj/project.pbxproj b/Catch.xcodeproj/project.pbxproj index 70d0dbe..4520d04 100644 --- a/Catch.xcodeproj/project.pbxproj +++ b/Catch.xcodeproj/project.pbxproj @@ -42,7 +42,6 @@ 44A6FA8D1DE1A5F1005303DF /* IntervalTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A6FA8C1DE1A5F1005303DF /* IntervalTimer.swift */; }; 44AB5B5E1DCE794A00AE6EB6 /* HistoryItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44AB5B5D1DCE794A00AE6EB6 /* HistoryItem.swift */; }; 44AB5B601DCE823A00AE6EB6 /* UserNotifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44AB5B5F1DCE823A00AE6EB6 /* UserNotifications.swift */; }; - 44AB5B801DD54D7300AE6EB6 /* LoginItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44AB5B7F1DD54D7300AE6EB6 /* LoginItem.swift */; }; 44AB5B821DD5532C00AE6EB6 /* BundleInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44AB5B811DD5532C00AE6EB6 /* BundleInfo.swift */; }; 44B363461DC99D1900128259 /* FeedChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44B363451DC99D1900128259 /* FeedChecker.swift */; }; 44B363481DC9B9FB00128259 /* WorkspaceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44B363471DC9B9FB00128259 /* WorkspaceExtensions.swift */; }; @@ -163,7 +162,6 @@ 44A6FA8C1DE1A5F1005303DF /* IntervalTimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IntervalTimer.swift; path = Sources/App/IntervalTimer.swift; sourceTree = ""; }; 44AB5B5D1DCE794A00AE6EB6 /* HistoryItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HistoryItem.swift; path = Sources/App/HistoryItem.swift; sourceTree = ""; }; 44AB5B5F1DCE823A00AE6EB6 /* UserNotifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UserNotifications.swift; path = Sources/App/UserNotifications.swift; sourceTree = ""; }; - 44AB5B7F1DD54D7300AE6EB6 /* LoginItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LoginItem.swift; path = Sources/App/LoginItem.swift; sourceTree = ""; }; 44AB5B811DD5532C00AE6EB6 /* BundleInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BundleInfo.swift; path = Sources/App/BundleInfo.swift; sourceTree = ""; }; 44B363451DC99D1900128259 /* FeedChecker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FeedChecker.swift; path = Sources/App/FeedChecker.swift; sourceTree = ""; }; 44B363471DC9B9FB00128259 /* WorkspaceExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WorkspaceExtensions.swift; path = Sources/App/WorkspaceExtensions.swift; sourceTree = ""; }; @@ -298,7 +296,6 @@ isa = PBXGroup; children = ( 44AB5B811DD5532C00AE6EB6 /* BundleInfo.swift */, - 44AB5B7F1DD54D7300AE6EB6 /* LoginItem.swift */, 4441F59524308C8D001AEC1E /* Scripts.swift */, 44B3634B1DCA6F7100128259 /* TimeOfDayMath.swift */, 44AB5B5F1DCE823A00AE6EB6 /* UserNotifications.swift */, @@ -613,7 +610,6 @@ 44E2CEA31DBC0B8F00ED7A8D /* PreferencesController.swift in Sources */, A74F608D25B57C6100BA52A0 /* FeedContentsController.swift in Sources */, 44A6FA8B1DE0B85C005303DF /* FeedHelperProxy.swift in Sources */, - 44AB5B801DD54D7300AE6EB6 /* LoginItem.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -689,6 +685,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "-"; + CURRENT_PROJECT_VERSION = 719; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Vendor", @@ -698,6 +695,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); + MARKETING_VERSION = 2.0.1; OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.giorgiocalderolla.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Catch; @@ -713,6 +711,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 719; DEVELOPMENT_TEAM = 4449XA862Y; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -724,6 +723,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); + MARKETING_VERSION = 2.0.1; OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.giorgiocalderolla.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Catch; diff --git a/Resources/App/Base.lproj/UI.xib b/Resources/App/Base.lproj/UI.xib index e9c388c..47a5fcd 100644 --- a/Resources/App/Base.lproj/UI.xib +++ b/Resources/App/Base.lproj/UI.xib @@ -148,7 +148,7 @@ - + @@ -525,45 +525,41 @@ - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + @@ -660,7 +656,7 @@ DQ - + @@ -783,7 +779,7 @@ DQ - + @@ -862,7 +858,7 @@ DQ - + diff --git a/Sources/App/Defaults.swift b/Sources/App/Defaults.swift index 988c713..2ff3fea 100644 --- a/Sources/App/Defaults.swift +++ b/Sources/App/Defaults.swift @@ -21,7 +21,6 @@ final class Defaults: NSObject { static let shouldOrganizeTorrents = "organizeTorrents" static let shouldOpenTorrentsAutomatically = "openAutomatically" static let history = "history" - static let openAtLogin = "openAtLogin" static let shouldRunHeadless = "headless" static let preventSystemSleep = "preventSystemSleep" static let downloadScriptPath = "downloadScriptPath" @@ -171,13 +170,6 @@ final class Defaults: NSObject { UserDefaults.standard.synchronize() } - private func refreshLoginItemStatus() { - #if !DEBUG - let shouldOpenAtLogin = UserDefaults.standard.bool(forKey: Keys.openAtLogin) - Bundle.main.isLoginItem = shouldOpenAtLogin - #endif - } - private override init() { super.init() @@ -199,7 +191,6 @@ final class Defaults: NSObject { Keys.shouldOrganizeTorrents: false, Keys.shouldOpenTorrentsAutomatically: true, Keys.history: [], - Keys.openAtLogin: true, Keys.shouldRunHeadless: false, Keys.preventSystemSleep: true, Keys.isDownloadScriptEnabled: false @@ -223,9 +214,6 @@ final class Defaults: NSObject { object: nil ) - // Register as a login item if needed - refreshLoginItemStatus() - // Load history from defaults at launch let rawHistory = UserDefaults.standard.array(forKey: Keys.history) as! [[AnyHashable:Any]] downloadHistory = rawHistory.compactMap(HistoryItem.init(defaultsDictionary:)) diff --git a/Sources/App/LoginItem.swift b/Sources/App/LoginItem.swift deleted file mode 100644 index 1f8a947..0000000 --- a/Sources/App/LoginItem.swift +++ /dev/null @@ -1,60 +0,0 @@ -import Foundation - - -extension Bundle { - private static var loginItemsList: LSSharedFileList? { - return LSSharedFileListCreate( - nil, - kLSSharedFileListSessionLoginItems.takeRetainedValue(), - nil - )?.takeRetainedValue() - } - - private var loginItem: LSSharedFileListItem? { - guard - let list = Bundle.loginItemsList, - let loginItems = LSSharedFileListCopySnapshot(list, nil).takeRetainedValue() as? [LSSharedFileListItem] - else { - return nil - } - - return loginItems.first { item in - guard let itemUrlRef = LSSharedFileListItemCopyResolvedURL(item, 0, nil) else { return false } - - let itemUrl = itemUrlRef.takeRetainedValue() as URL - return itemUrl == bundleURL - } - } - - var isLoginItem: Bool { - get { - return loginItem != nil - } - set { - let shouldRegister = newValue - - NSLog(shouldRegister ? "Adding app to login items" : "Removing app from login items") - - guard let loginItemsList = Bundle.loginItemsList else { - NSLog("Couldn't get login items list") - return - } - - if shouldRegister { - LSSharedFileListInsertItemURL( - loginItemsList, - nil, - nil, - nil, - bundleURL as CFURL, - nil, - nil - ) - } else { - if let loginItem = loginItem { - LSSharedFileListItemRemove(loginItemsList, loginItem) - } - } - } - } -}