Skip to content

Commit e7f8f04

Browse files
authored
Added Check for Updates to About (MonitorControl#716)
- Added Check for Updates to About - Removed untranslated languages (as we promised for final release) - Enabled Javascript for Sparkle release notes - os_log levels were all over the place, changed all to .info
1 parent 68ad991 commit e7f8f04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+164
-2942
lines changed

MonitorControl.xcodeproj/project.pbxproj

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,8 @@
8787
8C17418F2707B92800E88D53 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InternetAccessPolicy.strings; sourceTree = "<group>"; };
8888
8C1741902707B92800E88D53 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/InternetAccessPolicy.strings; sourceTree = "<group>"; };
8989
8C1741912707B92900E88D53 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InternetAccessPolicy.strings; sourceTree = "<group>"; };
90-
8C1741922707B92A00E88D53 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InternetAccessPolicy.strings; sourceTree = "<group>"; };
9190
8C1741932707B92A00E88D53 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InternetAccessPolicy.strings; sourceTree = "<group>"; };
92-
8C1741942707B92B00E88D53 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InternetAccessPolicy.strings; sourceTree = "<group>"; };
93-
8C1741952707B92C00E88D53 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/InternetAccessPolicy.strings; sourceTree = "<group>"; };
94-
8C1741962707B92C00E88D53 /* es-419 */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-419"; path = "es-419.lproj/InternetAccessPolicy.strings"; sourceTree = "<group>"; };
9591
8C1741972707B92E00E88D53 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/InternetAccessPolicy.strings; sourceTree = "<group>"; };
96-
8C1741982707B92F00E88D53 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/InternetAccessPolicy.strings; sourceTree = "<group>"; };
9792
AA062E8926C9A039007E628C /* DisplaysPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplaysPrefsViewController.swift; sourceTree = "<group>"; };
9893
AA062E8D26CA7BE5007E628C /* DisplaysPrefsCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplaysPrefsCellView.swift; sourceTree = "<group>"; };
9994
AA16139A26BE772E00DCF027 /* Arm64DDC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Arm64DDC.swift; sourceTree = "<group>"; };
@@ -120,22 +115,12 @@
120115
AA9CB62B2704C0890086DC0E /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
121116
AA9CB62D2704C0D70086DC0E /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Main.strings; sourceTree = "<group>"; };
122117
AA9CB62E2704C0D70086DC0E /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
123-
AA9CB62F2704C1250086DC0E /* es-419 */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-419"; path = "es-419.lproj/Main.strings"; sourceTree = "<group>"; };
124-
AA9CB6302704C1250086DC0E /* es-419 */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-419"; path = "es-419.lproj/Localizable.strings"; sourceTree = "<group>"; };
125-
AA9CB6312704C1440086DC0E /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Main.strings; sourceTree = "<group>"; };
126-
AA9CB6322704C1440086DC0E /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
127118
AA9CB6332704C14D0086DC0E /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Main.strings; sourceTree = "<group>"; };
128119
AA9CB6342704C14D0086DC0E /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
129120
AA9CB6352704C16F0086DC0E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Main.strings; sourceTree = "<group>"; };
130121
AA9CB6362704C16F0086DC0E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = "<group>"; };
131-
AA9CB6372704C17A0086DC0E /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Main.strings; sourceTree = "<group>"; };
132-
AA9CB6382704C17A0086DC0E /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = "<group>"; };
133-
AA9CB6392704C1890086DC0E /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Main.strings; sourceTree = "<group>"; };
134-
AA9CB63A2704C1890086DC0E /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
135122
AA9CB63B2704C1900086DC0E /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Main.strings; sourceTree = "<group>"; };
136123
AA9CB63C2704C1900086DC0E /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = "<group>"; };
137-
AA9CB63D2704C1970086DC0E /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Main.strings; sourceTree = "<group>"; };
138-
AA9CB63E2704C1970086DC0E /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = "<group>"; };
139124
AA9CB63F2704C1A40086DC0E /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
140125
AA9CB6402704C1A40086DC0E /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
141126
AA9CB6412704C1B80086DC0E /* zh-Hant-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant-TW"; path = "zh-Hant-TW.lproj/Main.strings"; sourceTree = "<group>"; };
@@ -394,14 +379,9 @@
394379
de,
395380
fr,
396381
it,
397-
"es-419",
398-
ja,
399382
ko,
400383
nl,
401-
pl,
402-
ru,
403384
tr,
404-
uk,
405385
"zh-Hans",
406386
"zh-Hant-TW",
407387
);
@@ -590,14 +570,9 @@
590570
AA9CB6272704C0530086DC0E /* de */,
591571
AA9CB62A2704C0890086DC0E /* fr */,
592572
AA9CB62D2704C0D70086DC0E /* it */,
593-
AA9CB62F2704C1250086DC0E /* es-419 */,
594-
AA9CB6312704C1440086DC0E /* ja */,
595573
AA9CB6332704C14D0086DC0E /* ko */,
596574
AA9CB6352704C16F0086DC0E /* nl */,
597-
AA9CB6372704C17A0086DC0E /* pl */,
598-
AA9CB6392704C1890086DC0E /* ru */,
599575
AA9CB63B2704C1900086DC0E /* tr */,
600-
AA9CB63D2704C1970086DC0E /* uk */,
601576
AA9CB63F2704C1A40086DC0E /* zh-Hans */,
602577
AA9CB6412704C1B80086DC0E /* zh-Hant-TW */,
603578
);
@@ -615,13 +590,8 @@
615590
8C17418F2707B92800E88D53 /* de */,
616591
8C1741902707B92800E88D53 /* hu */,
617592
8C1741912707B92900E88D53 /* it */,
618-
8C1741922707B92A00E88D53 /* ja */,
619593
8C1741932707B92A00E88D53 /* ko */,
620-
8C1741942707B92B00E88D53 /* pl */,
621-
8C1741952707B92C00E88D53 /* ru */,
622-
8C1741962707B92C00E88D53 /* es-419 */,
623594
8C1741972707B92E00E88D53 /* tr */,
624-
8C1741982707B92F00E88D53 /* uk */,
625595
);
626596
name = InternetAccessPolicy.strings;
627597
sourceTree = "<group>";
@@ -634,14 +604,9 @@
634604
AA9CB6282704C0530086DC0E /* de */,
635605
AA9CB62B2704C0890086DC0E /* fr */,
636606
AA9CB62E2704C0D70086DC0E /* it */,
637-
AA9CB6302704C1250086DC0E /* es-419 */,
638-
AA9CB6322704C1440086DC0E /* ja */,
639607
AA9CB6342704C14D0086DC0E /* ko */,
640608
AA9CB6362704C16F0086DC0E /* nl */,
641-
AA9CB6382704C17A0086DC0E /* pl */,
642-
AA9CB63A2704C1890086DC0E /* ru */,
643609
AA9CB63C2704C1900086DC0E /* tr */,
644-
AA9CB63E2704C1970086DC0E /* uk */,
645610
AA9CB6402704C1A40086DC0E /* zh-Hans */,
646611
AA9CB6422704C1B80086DC0E /* zh-Hant-TW */,
647612
);

MonitorControl/Info.plist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
22-
<string>6670</string>
22+
<string>6695</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.utilities</string>
2525
<key>LSMinimumSystemVersion</key>
@@ -30,6 +30,8 @@
3030
<string>MIT Licensed. 2017.</string>
3131
<key>NSPrincipalClass</key>
3232
<string>NSApplication</string>
33+
<key>SUEnableJavaScript</key>
34+
<true/>
3335
<key>SUFeedURL</key>
3436
<string>https://monitorcontrol.app/appcast.xml</string>
3537
<key>SUPublicEDKey</key>

MonitorControl/Model/AppleDisplay.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class AppleDisplay: Display {
5151
let oldValue = self.brightnessSyncSourceValue
5252
self.savePref(brightness, for: .brightness)
5353
if brightness != oldValue {
54-
os_log("Pushing slider and reporting delta for Apple display %{public}@", type: .debug, String(self.identifier))
54+
os_log("Pushing slider and reporting delta for Apple display %{public}@", type: .info, String(self.identifier))
5555
var newValue: Float
5656

5757
if abs(brightness - oldValue) < 0.01 {

MonitorControl/Model/Display.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ class Display: Equatable {
7272
self.swUpdateDefaultGammaTable()
7373
self.smoothBrightnessTransient = self.getBrightness()
7474
if self.isVirtual {
75-
os_log("Creating or updating shade for virtual display %{public}@", type: .debug, String(self.identifier))
75+
os_log("Creating or updating shade for virtual display %{public}@", type: .info, String(self.identifier))
7676
_ = DisplayManager.shared.updateShade(displayID: self.identifier)
7777
} else {
78-
os_log("Destroying shade (if exists) for real display %{public}@", type: .debug, String(self.identifier))
78+
os_log("Destroying shade (if exists) for real display %{public}@", type: .info, String(self.identifier))
7979
_ = DisplayManager.shared.destroyShade(displayID: self.identifier)
8080
}
8181
self.brightnessSyncSourceValue = self.getBrightness()
@@ -113,7 +113,7 @@ class Display: Equatable {
113113
guard app.sleepID == 0, app.reconfigureID == 0 else {
114114
self.savePref(self.smoothBrightnessTransient, for: .brightness)
115115
self.smoothBrightnessRunning = false
116-
os_log("Pushing brightness stopped for Display %{public}@ because of sleep or reconfiguration", type: .debug, String(self.identifier))
116+
os_log("Pushing brightness stopped for Display %{public}@ because of sleep or reconfiguration", type: .info, String(self.identifier))
117117
return false
118118
}
119119
if slow {
@@ -125,7 +125,7 @@ class Display: Equatable {
125125
}
126126
var dontPushAgain = false
127127
if to != -1 {
128-
os_log("Pushing brightness towards goal of %{public}@ for Display %{public}@", type: .debug, String(to), String(self.identifier))
128+
os_log("Pushing brightness towards goal of %{public}@ for Display %{public}@", type: .info, String(to), String(self.identifier))
129129
let value = max(min(to, 1), 0)
130130
self.savePref(value, for: .brightness)
131131
self.brightnessSyncSourceValue = value
@@ -138,7 +138,7 @@ class Display: Equatable {
138138
if brightness != self.smoothBrightnessTransient {
139139
if abs(brightness - self.smoothBrightnessTransient) < 0.01 {
140140
self.smoothBrightnessTransient = brightness
141-
os_log("Pushing brightness finished for Display %{public}@", type: .debug, String(self.identifier))
141+
os_log("Pushing brightness finished for Display %{public}@", type: .info, String(self.identifier))
142142
dontPushAgain = true
143143
self.smoothBrightnessRunning = false
144144
} else if brightness > self.smoothBrightnessTransient {
@@ -154,7 +154,7 @@ class Display: Equatable {
154154
}
155155
}
156156
} else {
157-
os_log("No more need to push brightness for Display %{public}@ (setting one final time)", type: .debug, String(self.identifier))
157+
os_log("No more need to push brightness for Display %{public}@ (setting one final time)", type: .info, String(self.identifier))
158158
_ = self.setDirectBrightness(self.smoothBrightnessTransient, transient: true)
159159
self.smoothBrightnessRunning = false
160160
}
@@ -274,7 +274,7 @@ class Display: Equatable {
274274
}
275275
DisplayManager.shared.gammaInterferenceCounter += 1
276276
_ = self.setSwBrightness(1)
277-
os_log("Gamma table interference detected, number of events: %{public}@", type: .debug, String(DisplayManager.shared.gammaInterferenceCounter))
277+
os_log("Gamma table interference detected, number of events: %{public}@", type: .info, String(DisplayManager.shared.gammaInterferenceCounter))
278278
if DisplayManager.shared.gammaInterferenceCounter >= 3 {
279279
DisplayManager.shared.gammaInterferenceWarningShown = true
280280
let alert = NSAlert()
@@ -294,7 +294,7 @@ class Display: Equatable {
294294
displaysPrefsVc?.loadDisplayList()
295295
}
296296
} else {
297-
os_log("We won't watch for gamma table interference anymore", type: .debug)
297+
os_log("We won't watch for gamma table interference anymore", type: .info)
298298
}
299299
}
300300
}

MonitorControl/Support/AppDelegate.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
8484
}
8585

8686
@objc func quitClicked(_: AnyObject) {
87-
os_log("Quit clicked", type: .debug)
87+
os_log("Quit clicked", type: .info)
8888
NSApplication.shared.terminate(self)
8989
}
9090

9191
@objc func prefsClicked(_: AnyObject) {
92-
os_log("Preferences clicked", type: .debug)
92+
os_log("Preferences clicked", type: .info)
9393
self.preferencesWindowController.show()
9494
}
9595

@@ -208,7 +208,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
208208
}
209209
if self.sleepID == 0, self.reconfigureID == 0 {
210210
if !self.jobRunning {
211-
os_log("MonitorControl job started.", type: .debug)
211+
os_log("MonitorControl job started.", type: .info)
212212
self.jobRunning = true
213213
}
214214
var refreshedSomething = false
@@ -218,7 +218,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
218218
refreshedSomething = true
219219
if prefs.bool(forKey: PrefKey.enableBrightnessSync.rawValue) {
220220
for targetDisplay in DisplayManager.shared.displays where targetDisplay != display {
221-
os_log("Updating delta from display %{public}@ to display %{public}@", type: .debug, String(display.identifier), String(targetDisplay.identifier))
221+
os_log("Updating delta from display %{public}@ to display %{public}@", type: .info, String(display.identifier), String(targetDisplay.identifier))
222222
let newValue = max(0, min(1, targetDisplay.getBrightness() + delta))
223223
_ = targetDisplay.setBrightness(newValue)
224224
if let slider = targetDisplay.sliderHandler[.brightness] {
@@ -265,8 +265,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
265265

266266
@objc func audioDeviceChanged() {
267267
if let defaultDevice = self.coreAudio.defaultOutputDevice {
268-
os_log("Default output device changed to “%{public}@”.", type: .debug, defaultDevice.name)
269-
os_log("Can device set its own volume? %{public}@", type: .debug, defaultDevice.canSetVirtualMasterVolume(scope: .output).description)
268+
os_log("Default output device changed to “%{public}@”.", type: .info, defaultDevice.name)
269+
os_log("Can device set its own volume? %{public}@", type: .info, defaultDevice.canSetVirtualMasterVolume(scope: .output).description)
270270
}
271271
self.updateMediaKeyTap()
272272
}

MonitorControl/Support/DisplayManager.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class DisplayManager {
2222
self.gammaActivityEnforcer.level = .screenSaver
2323
self.gammaActivityEnforcer.orderFrontRegardless()
2424
self.gammaActivityEnforcer.collectionBehavior = [.stationary, .canJoinAllSpaces]
25-
os_log("Gamma activity enforcer created.", type: .debug)
25+
os_log("Gamma activity enforcer created.", type: .info)
2626
}
2727

2828
func enforceGammaActivity() {
@@ -59,7 +59,7 @@ class DisplayManager {
5959
shade.orderFrontRegardless()
6060
shade.collectionBehavior = [.stationary, .canJoinAllSpaces, .ignoresCycle]
6161
shade.setFrame(screen.frame, display: true)
62-
os_log("Window shade created for display %{public}@", type: .debug, String(displayID))
62+
os_log("Window shade created for display %{public}@", type: .info, String(displayID))
6363
return shade
6464
}
6565
return nil
@@ -83,22 +83,22 @@ class DisplayManager {
8383
func destroyAllShades() -> Bool {
8484
var ret = false
8585
for displayID in self.shades.keys {
86-
os_log("Attempting to destory shade for display %{public}@", type: .debug, String(displayID))
86+
os_log("Attempting to destory shade for display %{public}@", type: .info, String(displayID))
8787
if self.destroyShade(displayID: displayID) {
8888
ret = true
8989
}
9090
}
9191
if ret {
92-
os_log("Destroyed all shades.", type: .debug)
92+
os_log("Destroyed all shades.", type: .info)
9393
} else {
94-
os_log("No shades were found to be destroyed.", type: .debug)
94+
os_log("No shades were found to be destroyed.", type: .info)
9595
}
9696
return ret
9797
}
9898

9999
func destroyShade(displayID: CGDirectDisplayID) -> Bool {
100100
if let shade = shades[displayID] {
101-
os_log("Destroying shade for display %{public}@", type: .debug, String(displayID))
101+
os_log("Destroying shade for display %{public}@", type: .info, String(displayID))
102102
self.shadeGrave.append(shade)
103103
self.shades.removeValue(forKey: displayID)
104104
shade.close()
@@ -204,7 +204,7 @@ class DisplayManager {
204204

205205
func updateAudioControlTargetDisplays(deviceName: String) -> Int {
206206
self.audioControlTargetDisplays.removeAll()
207-
os_log("Detecting displays for audio control via audio device name matching...", type: .debug)
207+
os_log("Detecting displays for audio control via audio device name matching...", type: .info)
208208
var numOfAddedDisplays: Int = 0
209209
for ddcCapableDisplay in self.getDdcCapableDisplays() {
210210
var displayAudioDeviceName = ddcCapableDisplay.readPrefAsString(key: .audioDeviceNameOverride)
@@ -214,7 +214,7 @@ class DisplayManager {
214214
if self.normalizedName(displayAudioDeviceName) == self.normalizedName(deviceName) {
215215
self.audioControlTargetDisplays.append(ddcCapableDisplay)
216216
numOfAddedDisplays += 1
217-
os_log("Added display for audio control - %{public}@", type: .debug, ddcCapableDisplay.name)
217+
os_log("Added display for audio control - %{public}@", type: .info, ddcCapableDisplay.name)
218218
}
219219
}
220220
return numOfAddedDisplays
@@ -332,10 +332,10 @@ class DisplayManager {
332332
OSDUtils.popEmptyOsd(displayID: otherDisplay.identifier, command: Command.brightness) // This will give the user a hint why is the brightness suddenly changes and also give screen activity to counter the 'no gamma change when there is no screen activity' issue on some macs
333333
}
334334
otherDisplay.savePref(otherDisplay.getSwBrightness(), key: .SwBrightness)
335-
os_log("Restoring sw brightness to %{public}@ on other display %{public}@", type: .debug, String(savedPrefValue), String(otherDisplay.identifier))
335+
os_log("Restoring sw brightness to %{public}@ on other display %{public}@", type: .info, String(savedPrefValue), String(otherDisplay.identifier))
336336
_ = otherDisplay.setSwBrightness(savedPrefValue, smooth: async)
337337
if otherDisplay.isSw(), let slider = otherDisplay.sliderHandler[.brightness] {
338-
os_log("Restoring sw slider to %{public}@ for other display %{public}@", type: .debug, String(savedPrefValue), String(otherDisplay.identifier))
338+
os_log("Restoring sw slider to %{public}@ for other display %{public}@", type: .info, String(savedPrefValue), String(otherDisplay.identifier))
339339
slider.setValue(savedPrefValue, displayID: otherDisplay.identifier)
340340
}
341341
} else {

0 commit comments

Comments
 (0)