Skip to content

Commit b5ef595

Browse files
committed
Fixed presentation of preference window on launch
1 parent 51d506c commit b5ef595

4 files changed

Lines changed: 28 additions & 10 deletions

File tree

src/Caffeine.xcodeproj/project.pbxproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
F21DAB752C316A530044ACF2 /* PreferencesWindowController.strings in Resources */ = {isa = PBXBuildFile; fileRef = F21DAB732C316A530044ACF2 /* PreferencesWindowController.strings */; };
2323
F21DAB822C316B1C0044ACF2 /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F21DAB812C316B1C0044ACF2 /* PreferencesWindowController.swift */; };
2424
F21DAB852C316B4B0044ACF2 /* PreferencesWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F21DAB832C316B4B0044ACF2 /* PreferencesWindowController.xib */; };
25+
F2FAEE9D2D7599330082C855 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = F2FAEE9C2D7599330082C855 /* PrivacyInfo.xcprivacy */; };
2526
/* End PBXBuildFile section */
2627

2728
/* Begin PBXCopyFilesBuildPhase section */
@@ -89,6 +90,7 @@
8990
F21DAB802C316A990044ACF2 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/PreferencesWindowController.strings"; sourceTree = "<group>"; };
9091
F21DAB812C316B1C0044ACF2 /* PreferencesWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferencesWindowController.swift; sourceTree = "<group>"; };
9192
F21DAB842C316B4B0044ACF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PreferencesWindowController.xib; sourceTree = "<group>"; };
93+
F2FAEE9C2D7599330082C855 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
9294
/* End PBXFileReference section */
9395

9496
/* Begin PBXFrameworksBuildPhase section */
@@ -159,6 +161,7 @@
159161
F21DAB832C316B4B0044ACF2 /* PreferencesWindowController.xib */,
160162
F21DAB132C30423D0044ACF2 /* Info.plist */,
161163
F21DAB032C3040F70044ACF2 /* Assets.xcassets */,
164+
F2FAEE9C2D7599330082C855 /* PrivacyInfo.xcprivacy */,
162165
F21DAB082C3040F70044ACF2 /* Caffeine.entitlements */,
163166
);
164167
name = Resources;
@@ -254,6 +257,7 @@
254257
buildActionMask = 2147483647;
255258
files = (
256259
F21DAB2D2C30483A0044ACF2 /* MainMenu.strings in Resources */,
260+
F2FAEE9D2D7599330082C855 /* PrivacyInfo.xcprivacy in Resources */,
257261
F21DAB542C3048A80044ACF2 /* active.png in Resources */,
258262
F21DAB562C3048A80044ACF2 /* inactive.png in Resources */,
259263
F21DAB572C3048A80044ACF2 /* [email protected] in Resources */,
@@ -483,7 +487,7 @@
483487
CODE_SIGN_ENTITLEMENTS = Caffeine/Caffeine.entitlements;
484488
CODE_SIGN_STYLE = Automatic;
485489
COMBINE_HIDPI_IMAGES = YES;
486-
CURRENT_PROJECT_VERSION = 22;
490+
CURRENT_PROJECT_VERSION = 23;
487491
DEVELOPMENT_TEAM = 568T6RKXH7;
488492
ENABLE_HARDENED_RUNTIME = YES;
489493
FRAMEWORK_SEARCH_PATHS = ../sparkle/framework;
@@ -498,7 +502,7 @@
498502
"$(inherited)",
499503
"@executable_path/../Frameworks",
500504
);
501-
MARKETING_VERSION = 1.5;
505+
MARKETING_VERSION = 1.5.1;
502506
PRODUCT_BUNDLE_IDENTIFIER = net.domzilla.caffeine;
503507
PRODUCT_NAME = "$(TARGET_NAME)";
504508
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -514,7 +518,7 @@
514518
CODE_SIGN_ENTITLEMENTS = Caffeine/Caffeine.entitlements;
515519
CODE_SIGN_STYLE = Automatic;
516520
COMBINE_HIDPI_IMAGES = YES;
517-
CURRENT_PROJECT_VERSION = 22;
521+
CURRENT_PROJECT_VERSION = 23;
518522
DEVELOPMENT_TEAM = 568T6RKXH7;
519523
ENABLE_HARDENED_RUNTIME = YES;
520524
FRAMEWORK_SEARCH_PATHS = ../sparkle/framework;
@@ -529,7 +533,7 @@
529533
"$(inherited)",
530534
"@executable_path/../Frameworks",
531535
);
532-
MARKETING_VERSION = 1.5;
536+
MARKETING_VERSION = 1.5.1;
533537
PRODUCT_BUNDLE_IDENTIFIER = net.domzilla.caffeine;
534538
PRODUCT_NAME = "$(TARGET_NAME)";
535539
SWIFT_EMIT_LOC_STRINGS = YES;

src/Caffeine/Classes/AppDelegate.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate, SPUStandardU
6969
}
7070
}
7171

72-
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
73-
self.showPreferences(nil)
74-
return false
75-
}
76-
7772
override func awakeFromNib() {
7873
statusItemMenuIcon = NSImage(named: "inactive")
7974
statusItemMenuIcon.isTemplate = true

src/Caffeine/Classes/PreferencesWindowController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class PreferencesWindowController: NSWindowController {
114114
override func windowDidLoad() {
115115
super.windowDidLoad()
116116

117-
showAtLaunchButton.state = UserDefaults.standard.bool(forKey: "CASuppressLaunchMessage") ? .on : .off
117+
showAtLaunchButton.state = UserDefaults.standard.bool(forKey: "CASuppressLaunchMessage") ? .off : .on
118118
activateAtLaunchButton.state = UserDefaults.standard.bool(forKey: "CAActivateAtLaunch") ? .on : .off
119119
deactivateOnManualSleepButton.state = UserDefaults.standard.bool(forKey: "CADeactivateOnManualSleep") ? .on : .off
120120
durationButton.selectItem(withTag: UserDefaults.standard.integer(forKey: "CADefaultDuration"))

src/Caffeine/PrivacyInfo.xcprivacy

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSPrivacyAccessedAPITypes</key>
6+
<array>
7+
<dict>
8+
<key>NSPrivacyAccessedAPITypeReasons</key>
9+
<array>
10+
<string>CA92.1</string>
11+
</array>
12+
<key>NSPrivacyAccessedAPIType</key>
13+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
14+
</dict>
15+
</array>
16+
<key>NSPrivacyTracking</key>
17+
<false/>
18+
</dict>
19+
</plist>

0 commit comments

Comments
 (0)