v4.3.3 by waydabber · Pull Request #1646 · MonitorControl/MonitorControl · GitHub
Skip to content
Merged

v4.3.3 #1646

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions MonitorControl.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions MonitorControl/Enums/PrefKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ enum PrefKey: String {
case SUEnableAutomaticChecks

// Receive beta updates?
case isBetaChannel // This is not added to Preferences yet as it will be needed in the future only.
case isBetaChannel // This is not added to Settings yet as it will be needed in the future only.

// Build number
case buildNumber
Expand Down Expand Up @@ -60,7 +60,7 @@ enum PrefKey: String {
// Instead of assuming default values, enable read or write upon startup (according to readDDCInsteadOfRestoreValues)
case startupAction

// Show advanced options under Displays tab in Preferences
// Show advanced options under Displays tab in Settings
case showAdvancedSettings

// Allow zero software brightness
Expand Down
6 changes: 3 additions & 3 deletions MonitorControl/Extensions/Preferences+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

import Cocoa

import Preferences
import Settings

extension Preferences.PaneIdentifier {
extension Settings.PaneIdentifier {
static let main = Self("Main")
static let menusliders = Self("Menu & Sliders")
static let keyboard = Self("Keyboard")
static let displays = Self("Displays")
static let about = Self("About")
}

public extension PreferencesWindowController {
public extension SettingsWindowController {
override func keyDown(with event: NSEvent) {
if event.modifierFlags.intersection(.deviceIndependentFlagsMask) == .command, let key = event.charactersIgnoringModifiers {
if key == "w" {
Expand Down
2 changes: 1 addition & 1 deletion MonitorControl/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>7104</string>
<string>7122</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
32 changes: 16 additions & 16 deletions MonitorControl/Support/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Cocoa
import Foundation
import MediaKeyTap
import os.log
import Preferences
import ServiceManagement
import Settings
import SimplyCoreAudio
import Sparkle

Expand All @@ -24,23 +24,23 @@ class AppDelegate: NSObject, NSApplicationDelegate {
var audioPlayer: AVAudioPlayer?
let updaterController = SPUStandardUpdaterController(startingUpdater: false, updaterDelegate: UpdaterDelegate(), userDriverDelegate: nil)

var preferencePaneStyle: Preferences.Style {
var settingsPaneStyle: Settings.Style {
if !DEBUG_MACOS10, #available(macOS 11.0, *) {
return Preferences.Style.toolbarItems
return Settings.Style.toolbarItems
} else {
return Preferences.Style.segmentedControl
return Settings.Style.segmentedControl
}
}

lazy var preferencesWindowController: PreferencesWindowController = .init(
preferencePanes: [
lazy var settingsWindowController: SettingsWindowController = .init(
panes: [
mainPrefsVc!,
menuslidersPrefsVc!,
keyboardPrefsVc!,
displaysPrefsVc!,
aboutPrefsVc!,
],
style: self.preferencePaneStyle,
style: self.settingsPaneStyle,
animated: true
)

Expand Down Expand Up @@ -71,8 +71,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

@objc func prefsClicked(_: AnyObject) {
os_log("Preferences clicked", type: .info)
self.preferencesWindowController.show()
os_log("Settings clicked", type: .info)
self.settingsWindowController.show()
}

func applicationShouldHandleReopen(_: NSApplication, hasVisibleWindows _: Bool) -> Bool {
Expand All @@ -93,7 +93,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
if !self.safeMode {
let alert = NSAlert()
alert.messageText = NSLocalizedString("Incompatible previous version", comment: "Shown in the alert dialog")
alert.informativeText = NSLocalizedString("Preferences for an incompatible previous app version detected. Default preferences are reloaded.", comment: "Shown in the alert dialog")
alert.informativeText = NSLocalizedString("Settings for an incompatible previous app version detected. Default settings are reloaded.", comment: "Shown in the alert dialog")
alert.runModal()
}
prefs.removePersistentDomain(forName: bundleID)
Expand All @@ -103,7 +103,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {

func setDefaultPrefs() {
if !prefs.bool(forKey: PrefKey.appAlreadyLaunched.rawValue) {
// Only preferences that are not false, 0 or "" by default are set here. Assumes pre-wiped database.
// Only settings that are not false, 0 or "" by default are set here. Assumes pre-wiped database.
prefs.set(true, forKey: PrefKey.appAlreadyLaunched.rawValue)
prefs.set(true, forKey: PrefKey.SUEnableAutomaticChecks.rawValue)
}
Expand Down Expand Up @@ -262,8 +262,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.updateMediaKeyTap()
}

func preferenceReset() {
os_log("Resetting all preferences.")
func settingsReset() {
os_log("Resetting all settings.")
if !prefs.bool(forKey: PrefKey.disableCombinedBrightness.rawValue) {
DisplayManager.shared.resetSwBrightnessForAllDisplays(async: false)
}
Expand Down Expand Up @@ -295,7 +295,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
SMLoginItemSetEnabled(identifier, enabled)
}

func getSystemPreferences() -> [String: AnyObject]? {
func getSystemSettings() -> [String: AnyObject]? {
var propertyListFormat = PropertyListSerialization.PropertyListFormat.xml
let plistPath = NSString(string: "~/Library/Preferences/.GlobalPreferences.plist").expandingTildeInPath
guard let plistXML = FileManager.default.contents(atPath: plistPath) else {
Expand All @@ -318,7 +318,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

func playVolumeChangedSound() {
guard let preferences = app.getSystemPreferences(), let hasSoundEnabled = preferences["com.apple.sound.beep.feedback"] as? Int, hasSoundEnabled == 1 else {
guard let settings = app.getSystemSettings(), let hasSoundEnabled = settings["com.apple.sound.beep.feedback"] as? Int, hasSoundEnabled == 1 else {
return
}
do {
Expand All @@ -342,7 +342,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.safeMode = true
let alert = NSAlert()
alert.messageText = NSLocalizedString("Safe Mode Activated", comment: "Shown in the alert dialog")
alert.informativeText = NSLocalizedString("Shift was pressed during launch. MonitorControl started in safe mode. Default preferences are reloaded, DDC read is blocked.", comment: "Shown in the alert dialog")
alert.informativeText = NSLocalizedString("Shift was pressed during launch. MonitorControl started in safe mode. Default settings are reloaded, DDC read is blocked.", comment: "Shown in the alert dialog")
alert.runModal()
}
}
Expand Down
1 change: 1 addition & 0 deletions MonitorControl/Support/DisplayManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class DisplayManager {
self.gammaActivityEnforcer.title = "Monitor Control Gamma Activity Enforcer"
self.gammaActivityEnforcer.isMovableByWindowBackground = false
self.gammaActivityEnforcer.backgroundColor = DEBUG_GAMMA_ENFORCER ? .red : .black
self.gammaActivityEnforcer.alphaValue = 1 * (DEBUG_GAMMA_ENFORCER ? 0.5 : 0.01)
self.gammaActivityEnforcer.ignoresMouseEvents = true
self.gammaActivityEnforcer.level = .screenSaver
self.gammaActivityEnforcer.orderFrontRegardless()
Expand Down
2 changes: 1 addition & 1 deletion MonitorControl/Support/MediaKeyTapManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class MediaKeyTapManager: MediaKeyTapDelegate {
if !self.readPrivileges(prompt: true), !firstAsk {
let alert = NSAlert()
alert.messageText = NSLocalizedString("Shortcuts not available", comment: "Shown in the alert dialog")
alert.informativeText = NSLocalizedString("You need to enable MonitorControl in System Preferences > Security and Privacy > Accessibility for the keyboard shortcuts to work", comment: "Shown in the alert dialog")
alert.informativeText = NSLocalizedString("You need to enable MonitorControl in System Settings > Security and Privacy > Accessibility for the keyboard shortcuts to work", comment: "Shown in the alert dialog")
alert.runModal()
}
}
Expand Down
24 changes: 12 additions & 12 deletions MonitorControl/Support/MenuHandler.swift
Loading