mirror of
https://github.com/MonitorControl/MonitorControl.git
synced 2026-05-29 22:01:27 -06:00
- Removed whitelist which caused some issues for some people #105 - Added `hide OSD` option to `AdvancedPrefsViewController` - Added `Longer Delay` option to `AdvancedPrefsViewController` - Added `PollingMode` and `PollingCount` to `AdvancedPrefsViewController` (should help #37) - Added option to reset all preferences to `AdvancedPrefsViewController` See the wiki for more info: https://github.com/the0neyouseek/MonitorControl/wiki/Advanced-Preferences
31 lines
776 B
Swift
31 lines
776 B
Swift
import Cocoa
|
|
import os.log
|
|
|
|
/*
|
|
menu tags:
|
|
0: none
|
|
1: minimal
|
|
2: normal
|
|
3: heavy
|
|
4: custom
|
|
We use these tags as a way to mark selection
|
|
*/
|
|
class PollingModeCellView: NSTableCellView {
|
|
var display: Display?
|
|
@IBOutlet var pollingModeMenu: NSPopUpButtonCell!
|
|
|
|
var didChangePollingMode: ((_ pollingModeInt: Int) -> Void)?
|
|
|
|
@IBAction func valueChanged(_ sender: NSPopUpButton) {
|
|
if let display = display {
|
|
let newValue = sender.selectedTag()
|
|
let originalValue = display.getPollingMode()
|
|
|
|
if newValue != originalValue {
|
|
display.setPollingMode(newValue)
|
|
self.didChangePollingMode?(newValue)
|
|
os_log("Value changed for polling count: %{public}@", type: .info, "from `\(originalValue)` to `\(newValue)`")
|
|
}
|
|
}
|
|
}
|
|
}
|