Skip to content

Commit

Permalink
Remove "open at login" functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgio Calderolla committed Apr 21, 2021
1 parent c537fdf commit 410bab6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 117 deletions.
8 changes: 4 additions & 4 deletions Catch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -163,7 +162,6 @@
44A6FA8C1DE1A5F1005303DF /* IntervalTimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IntervalTimer.swift; path = Sources/App/IntervalTimer.swift; sourceTree = "<group>"; };
44AB5B5D1DCE794A00AE6EB6 /* HistoryItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HistoryItem.swift; path = Sources/App/HistoryItem.swift; sourceTree = "<group>"; };
44AB5B5F1DCE823A00AE6EB6 /* UserNotifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UserNotifications.swift; path = Sources/App/UserNotifications.swift; sourceTree = "<group>"; };
44AB5B7F1DD54D7300AE6EB6 /* LoginItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LoginItem.swift; path = Sources/App/LoginItem.swift; sourceTree = "<group>"; };
44AB5B811DD5532C00AE6EB6 /* BundleInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BundleInfo.swift; path = Sources/App/BundleInfo.swift; sourceTree = "<group>"; };
44B363451DC99D1900128259 /* FeedChecker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FeedChecker.swift; path = Sources/App/FeedChecker.swift; sourceTree = "<group>"; };
44B363471DC9B9FB00128259 /* WorkspaceExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WorkspaceExtensions.swift; path = Sources/App/WorkspaceExtensions.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -298,7 +296,6 @@
isa = PBXGroup;
children = (
44AB5B811DD5532C00AE6EB6 /* BundleInfo.swift */,
44AB5B7F1DD54D7300AE6EB6 /* LoginItem.swift */,
4441F59524308C8D001AEC1E /* Scripts.swift */,
44B3634B1DCA6F7100128259 /* TimeOfDayMath.swift */,
44AB5B5F1DCE823A00AE6EB6 /* UserNotifications.swift */,
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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",
Expand All @@ -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;
Expand All @@ -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 = (
Expand All @@ -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;
Expand Down
78 changes: 37 additions & 41 deletions Resources/App/Base.lproj/UI.xib
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<rect key="contentRect" x="310" y="248" width="700" height="317"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1080"/>
<view key="contentView" misplaced="YES" id="553" customClass="PreferencesView" customModule="Catch" customModuleProvider="target">
<view key="contentView" id="553" customClass="PreferencesView" customModule="Catch" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="700" height="317"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
Expand Down Expand Up @@ -525,45 +525,41 @@
<rect key="frame" x="0.0" y="0.0" width="660" height="237"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="980">
<rect key="frame" x="-2" y="220" width="107" height="18"/>
<buttonCell key="cell" type="check" title="Open at login" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="981">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="658" name="value" keyPath="values.openAtLogin" id="985"/>
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="AN1-pr-EUN">
<rect key="frame" x="-2" y="198" width="231" height="18"/>
<buttonCell key="cell" type="check" title="Prevent system sleep when active" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="kuL-eb-cd0">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="658" name="value" keyPath="values.preventSystemSleep" id="W6z-IT-FgR"/>
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="806">
<rect key="frame" x="-2" y="176" width="221" height="18"/>
<buttonCell key="cell" type="check" title="Automatically check for updates" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="807">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3el-4q-ruU">
<rect key="frame" x="0.0" y="197" width="660" height="40"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="AN1-pr-EUN">
<rect key="frame" x="-2" y="23" width="231" height="18"/>
<buttonCell key="cell" type="check" title="Prevent system sleep when active" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="kuL-eb-cd0">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="658" name="value" keyPath="values.preventSystemSleep" id="W6z-IT-FgR"/>
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="806">
<rect key="frame" x="-2" y="-1" width="221" height="18"/>
<buttonCell key="cell" type="check" title="Automatically check for updates" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="807">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
</subviews>
<visibilityPriorities>
<integer value="1000"/>
<integer value="1000"/>
</visibilityPriorities>
<customSpacing>
<real value="3.4028234663852886e+38"/>
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
</subviews>
<constraints>
<constraint firstItem="806" firstAttribute="leading" secondItem="619" secondAttribute="leading" id="7Xn-iF-Bxd"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="806" secondAttribute="bottom" id="9ec-Za-Ud0"/>
<constraint firstItem="980" firstAttribute="top" secondItem="619" secondAttribute="top" id="Crc-NF-5Jv"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="806" secondAttribute="trailing" id="VeJ-IQ-3XS"/>
<constraint firstItem="980" firstAttribute="leading" secondItem="619" secondAttribute="leading" id="Z6r-wV-hzs"/>
<constraint firstItem="806" firstAttribute="top" secondItem="AN1-pr-EUN" secondAttribute="bottom" constant="6" symbolic="YES" id="aTo-bk-WAm"/>
<constraint firstItem="AN1-pr-EUN" firstAttribute="leading" secondItem="619" secondAttribute="leading" id="bnC-Av-6uz"/>
<constraint firstItem="AN1-pr-EUN" firstAttribute="top" secondItem="980" secondAttribute="bottom" constant="6" symbolic="YES" id="gRc-21-ji5"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="AN1-pr-EUN" secondAttribute="trailing" id="sor-xy-etC"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="980" secondAttribute="trailing" id="xrZ-65-g80"/>
<constraint firstAttribute="trailing" secondItem="3el-4q-ruU" secondAttribute="trailing" id="EgE-dT-Vif"/>
<constraint firstItem="3el-4q-ruU" firstAttribute="leading" secondItem="619" secondAttribute="leading" id="Mqo-F7-a37"/>
<constraint firstItem="3el-4q-ruU" firstAttribute="top" secondItem="619" secondAttribute="top" id="Uhn-FI-38p"/>
</constraints>
</view>
</tabViewItem>
Expand Down Expand Up @@ -660,7 +656,7 @@ DQ
<window title="Recent Episodes" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="aQN-n7-TBr" userLabel="Recent Episodes" customClass="NSPanel">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="120" y="64" width="431" height="435"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1080"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<value key="minSize" type="size" width="200" height="300"/>
<view key="contentView" id="gSi-VU-gYd">
<rect key="frame" x="0.0" y="0.0" width="451" height="435"/>
Expand Down Expand Up @@ -783,7 +779,7 @@ DQ
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="213" width="572" height="151"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1080"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<view key="contentView" id="JVG-A7-ap0" customClass="AddFeedView" customModule="Catch" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="572" height="132"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -862,7 +858,7 @@ DQ
<window title="Feed Contents" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="6AF-Wa-kWE">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="689" y="399" width="600" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1080"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<view key="contentView" id="apF-ZH-7em">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down
12 changes: 0 additions & 12 deletions Sources/App/Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()

Expand All @@ -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
Expand All @@ -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:))
Expand Down
60 changes: 0 additions & 60 deletions Sources/App/LoginItem.swift

This file was deleted.

0 comments on commit 410bab6

Please sign in to comment.