diff --git a/Sparkle/updates/appcast.xml b/Sparkle/updates/appcast.xml index de4fdfa..45e200f 100644 --- a/Sparkle/updates/appcast.xml +++ b/Sparkle/updates/appcast.xml @@ -146,5 +146,21 @@ + + 2.1 + Mon, 05 Oct 2020 18:43:47 +0200 + + https://iglance.github.io/release-notes.html + + 10.12 + + + + + + + + + diff --git a/Sparkle/updates/iGlance2.1-2.0.5.delta b/Sparkle/updates/iGlance2.1-2.0.5.delta new file mode 100644 index 0000000..80cee7f Binary files /dev/null and b/Sparkle/updates/iGlance2.1-2.0.5.delta differ diff --git a/Sparkle/updates/iGlance2.1-2.0.6.delta b/Sparkle/updates/iGlance2.1-2.0.6.delta new file mode 100644 index 0000000..58e139b Binary files /dev/null and b/Sparkle/updates/iGlance2.1-2.0.6.delta differ diff --git a/Sparkle/updates/iGlance2.1-2.0.7.delta b/Sparkle/updates/iGlance2.1-2.0.7.delta new file mode 100644 index 0000000..6cf78d9 Binary files /dev/null and b/Sparkle/updates/iGlance2.1-2.0.7.delta differ diff --git a/Sparkle/updates/iGlance2.1-2.0.8.delta b/Sparkle/updates/iGlance2.1-2.0.8.delta new file mode 100644 index 0000000..880ddca Binary files /dev/null and b/Sparkle/updates/iGlance2.1-2.0.8.delta differ diff --git a/Sparkle/updates/iGlance2.1-2.0.9.delta b/Sparkle/updates/iGlance2.1-2.0.9.delta new file mode 100644 index 0000000..af7b610 Binary files /dev/null and b/Sparkle/updates/iGlance2.1-2.0.9.delta differ diff --git a/Version.txt b/Version.txt index ece91f7..1322af4 100644 --- a/Version.txt +++ b/Version.txt @@ -1 +1 @@ -[version]2.0[/version] +[version]2.1.0[/version] diff --git a/iGlance/Libraries/AppMover b/iGlance/Libraries/AppMover index 23284ce..caf5ef8 160000 --- a/iGlance/Libraries/AppMover +++ b/iGlance/Libraries/AppMover @@ -1 +1 @@ -Subproject commit 23284ce1d26f710aa774e0f08ebe9f3f47149c78 +Subproject commit caf5ef8cbdb11b4260be7fe47b9661bb8183d3f0 diff --git a/iGlance/Libraries/SMCKit b/iGlance/Libraries/SMCKit index 35b1038..f9a32f8 160000 --- a/iGlance/Libraries/SMCKit +++ b/iGlance/Libraries/SMCKit @@ -1 +1 @@ -Subproject commit 35b10381d045ad1fef2b49da01a2650e152f7a76 +Subproject commit f9a32f822f3b5e84eba6869a4833562ffe14facf diff --git a/iGlance/Libraries/SystemKit b/iGlance/Libraries/SystemKit index 9185513..2b86cc1 160000 --- a/iGlance/Libraries/SystemKit +++ b/iGlance/Libraries/SystemKit @@ -1 +1 @@ -Subproject commit 9185513ed8631a41a9a5fcaea3f76c904b30024a +Subproject commit 2b86cc1dedfa1ee93fd7800b2bf2f37d0b468e1d diff --git a/iGlance/iGlance/Cartfile.resolved b/iGlance/iGlance/Cartfile.resolved index 8241deb..0c1d8c9 100644 --- a/iGlance/iGlance/Cartfile.resolved +++ b/iGlance/iGlance/Cartfile.resolved @@ -1 +1 @@ -github "sindresorhus/LaunchAtLogin" "v3.0.1" +github "sindresorhus/LaunchAtLogin" "v4.0.0" diff --git a/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/project.pbxproj b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/project.pbxproj index 78c4459..46748bd 100644 --- a/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/project.pbxproj +++ b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/project.pbxproj @@ -3,10 +3,12 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ + D92CFD2224C5D909005B91BE /* Toggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = D92CFD2124C5D909005B91BE /* Toggle.swift */; }; + D9EF7E1D24BCF9E300A1E9AA /* copy-helper-swiftpm.sh in Resources */ = {isa = PBXBuildFile; fileRef = D9EF7E1C24BCF9E300A1E9AA /* copy-helper-swiftpm.sh */; }; E32E9B681EB87D7B000FEEE9 /* LaunchAtLogin.h in Headers */ = {isa = PBXBuildFile; fileRef = E32E9B661EB87D7B000FEEE9 /* LaunchAtLogin.h */; settings = {ATTRIBUTES = (Public, ); }; }; E32E9B6F1EB87DC5000FEEE9 /* LaunchAtLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = E32E9B6E1EB87DC5000FEEE9 /* LaunchAtLogin.swift */; }; E32E9B771EB87EA3000FEEE9 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = E32E9B761EB87EA3000FEEE9 /* main.swift */; }; @@ -26,6 +28,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + D92CFD2124C5D909005B91BE /* Toggle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Toggle.swift; sourceTree = ""; usesTabs = 1; }; + D9EF7E1C24BCF9E300A1E9AA /* copy-helper-swiftpm.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "copy-helper-swiftpm.sh"; sourceTree = ""; }; E32E9B631EB87D7B000FEEE9 /* LaunchAtLogin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LaunchAtLogin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E32E9B661EB87D7B000FEEE9 /* LaunchAtLogin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = LaunchAtLogin.h; sourceTree = ""; usesTabs = 1; }; E32E9B671EB87D7B000FEEE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -34,7 +38,7 @@ E32E9B761EB87EA3000FEEE9 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = main.swift; sourceTree = ""; usesTabs = 1; }; E32E9B7F1EB87EA3000FEEE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; E32E9B921EB889AE000FEEE9 /* copy-helper.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; lineEnding = 0; path = "copy-helper.sh"; sourceTree = ""; usesTabs = 1; }; - E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = LaunchAtLogin.entitlements; path = LaunchAtLogin/LaunchAtLogin.entitlements; sourceTree = ""; }; + E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LaunchAtLogin.entitlements; sourceTree = ""; }; E3B8C38A20C0003300272EC0 /* LaunchAtLoginHelper.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LaunchAtLoginHelper.entitlements; sourceTree = ""; }; /* End PBXFileReference section */ @@ -56,12 +60,20 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - E32E9B591EB87D7B000FEEE9 = { + D9CFA59424C0FB5E005BC9E9 /* Sources */ = { isa = PBXGroup; children = ( E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */, E32E9B651EB87D7B000FEEE9 /* LaunchAtLogin */, E32E9B751EB87EA3000FEEE9 /* LaunchAtLoginHelper */, + ); + path = Sources; + sourceTree = ""; + }; + E32E9B591EB87D7B000FEEE9 = { + isa = PBXGroup; + children = ( + D9CFA59424C0FB5E005BC9E9 /* Sources */, E32E9B641EB87D7B000FEEE9 /* Products */, ); sourceTree = ""; @@ -79,10 +91,13 @@ E32E9B651EB87D7B000FEEE9 /* LaunchAtLogin */ = { isa = PBXGroup; children = ( - E32E9B6E1EB87DC5000FEEE9 /* LaunchAtLogin.swift */, - E32E9B661EB87D7B000FEEE9 /* LaunchAtLogin.h */, + D9EF7E1C24BCF9E300A1E9AA /* copy-helper-swiftpm.sh */, E32E9B921EB889AE000FEEE9 /* copy-helper.sh */, E32E9B671EB87D7B000FEEE9 /* Info.plist */, + E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */, + E32E9B661EB87D7B000FEEE9 /* LaunchAtLogin.h */, + E32E9B6E1EB87DC5000FEEE9 /* LaunchAtLogin.swift */, + D92CFD2124C5D909005B91BE /* Toggle.swift */, ); path = LaunchAtLogin; sourceTree = ""; @@ -154,7 +169,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = "Sindre Sorhus"; TargetAttributes = { E32E9B621EB87D7B000FEEE9 = { @@ -176,7 +191,7 @@ }; }; buildConfigurationList = E32E9B5D1EB87D7B000FEEE9 /* Build configuration list for PBXProject "LaunchAtLogin" */; - compatibilityVersion = "Xcode 11.0"; + compatibilityVersion = "Xcode 12.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -201,6 +216,7 @@ files = ( E32E9B861EB8845E000FEEE9 /* LaunchAtLoginHelper.app in Resources */, E32E9B931EB889AE000FEEE9 /* copy-helper.sh in Resources */, + D9EF7E1D24BCF9E300A1E9AA /* copy-helper-swiftpm.sh in Resources */, E3A6EB58249009C3004D7101 /* LaunchAtLogin.entitlements in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -220,6 +236,7 @@ buildActionMask = 2147483647; files = ( E32E9B6F1EB87DC5000FEEE9 /* LaunchAtLogin.swift in Sources */, + D92CFD2224C5D909005B91BE /* Toggle.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -267,6 +284,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -300,7 +318,6 @@ SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - VALID_ARCHS = x86_64; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -331,6 +348,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -356,7 +374,6 @@ SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; - VALID_ARCHS = x86_64; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -375,14 +392,14 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = LaunchAtLogin/Info.plist; + INFOPLIST_FILE = Sources/LaunchAtLogin/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.0.1; + MARKETING_VERSION = 4.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.sindresorhus.LaunchAtLogin; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -405,14 +422,14 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = LaunchAtLogin/Info.plist; + INFOPLIST_FILE = Sources/LaunchAtLogin/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.0.1; + MARKETING_VERSION = 4.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.sindresorhus.LaunchAtLogin; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -423,13 +440,13 @@ E32E9B811EB87EA3000FEEE9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_ENTITLEMENTS = LaunchAtLoginHelper/LaunchAtLoginHelper.entitlements; + CODE_SIGN_ENTITLEMENTS = Sources/LaunchAtLoginHelper/LaunchAtLoginHelper.entitlements; CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; - INFOPLIST_FILE = LaunchAtLoginHelper/Info.plist; + INFOPLIST_FILE = Sources/LaunchAtLoginHelper/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", @@ -444,13 +461,13 @@ E32E9B821EB87EA3000FEEE9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_ENTITLEMENTS = LaunchAtLoginHelper/LaunchAtLoginHelper.entitlements; + CODE_SIGN_ENTITLEMENTS = Sources/LaunchAtLoginHelper/LaunchAtLoginHelper.entitlements; CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; - INFOPLIST_FILE = LaunchAtLoginHelper/Info.plist; + INFOPLIST_FILE = Sources/LaunchAtLoginHelper/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", diff --git a/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/xcshareddata/xcschemes/LaunchAtLogin.xcscheme b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/xcshareddata/xcschemes/LaunchAtLogin.xcscheme index d8b20f0..6b8bd3b 100644 --- a/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/xcshareddata/xcschemes/LaunchAtLogin.xcscheme +++ b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj/xcshareddata/xcschemes/LaunchAtLogin.xcscheme @@ -1,6 +1,6 @@ - - - - - - - - + + - - (isEnabled) + @available(macOS 10.15, *) + public static var publisher = _publisher.eraseToAnyPublisher() + + private static let id = "\(Bundle.main.bundleIdentifier!)-LaunchAtLoginHelper" + + public static var isEnabled: Bool { + get { + guard let jobs = (SMCopyAllJobDictionaries(kSMDomainUserLaunchd).takeRetainedValue() as? [[String: AnyObject]]) else { + return false + } + + let job = jobs.first { $0["Label"] as! String == id } + + return job?["OnDemand"] as? Bool ?? false + } + set { + if #available(macOS 10.15, *) { + observable.objectWillChange.send() + } + + kvo.willChangeValue(for: \.isEnabled) + SMLoginItemSetEnabled(id as CFString, newValue) + kvo.didChangeValue(for: \.isEnabled) + + if #available(macOS 10.15, *) { + _publisher.send(newValue) + } + } + } +} + +// MARK: - LaunchAtLoginObservable +extension LaunchAtLogin { + @available(macOS 10.15, *) + public final class Observable: ObservableObject { + public var isEnabled: Bool { + get { LaunchAtLogin.isEnabled } + set { + LaunchAtLogin.isEnabled = newValue + } + } + } +} + +// MARK: - LaunchAtLoginKVO +extension LaunchAtLogin { + public final class KVO: NSObject { + @objc public dynamic var isEnabled: Bool { + get { LaunchAtLogin.isEnabled } + set { + LaunchAtLogin.isEnabled = newValue + } + } + } +} diff --git a/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/Sources/LaunchAtLogin/LaunchAtLoginHelper-with-runtime.zip b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/Sources/LaunchAtLogin/LaunchAtLoginHelper-with-runtime.zip new file mode 100644 index 0000000..ef27b8e Binary files /dev/null and b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/Sources/LaunchAtLogin/LaunchAtLoginHelper-with-runtime.zip differ diff --git a/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/Sources/LaunchAtLogin/LaunchAtLoginHelper.zip b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/Sources/LaunchAtLogin/LaunchAtLoginHelper.zip new file mode 100644 index 0000000..64e9024 Binary files /dev/null and b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/Sources/LaunchAtLogin/LaunchAtLoginHelper.zip differ diff --git a/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/Sources/LaunchAtLogin/Toggle.swift b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/Sources/LaunchAtLogin/Toggle.swift new file mode 100644 index 0000000..43e02ee --- /dev/null +++ b/iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/Sources/LaunchAtLogin/Toggle.swift @@ -0,0 +1,80 @@ +import SwiftUI + +@available(macOS 10.15, *) +extension LaunchAtLogin { + /** + This package comes with a `LaunchAtLogin.Toggle` view which is like the built-in `Toggle` but with a predefined binding and label. Clicking the view toggles “launch at login” for your app. + + ``` + struct ContentView: View { + var body: some View { + LaunchAtLogin.Toggle() + } + } + ``` + + The default label is `"Launch at login"`, but it can be overridden for localization and other needs: + + ``` + struct ContentView: View { + var body: some View { + LaunchAtLogin.Toggle { + Text("Launch at login") + } + } + } + ``` + */ + public struct Toggle