Skip to content

Commit

Permalink
fix: Trying to fix #86 - KVO triggered from the thermal log queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
macmade committed Jun 20, 2024
1 parent 24e059e commit 0d34958
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Hot/Classes/InfoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class InfoViewController: NSViewController
@objc public private( set ) dynamic var speedLimit: Int = 0
@objc public private( set ) dynamic var temperature: Int = 0
@objc public private( set ) dynamic var thermalPressure: Int = 0
@objc public private( set ) dynamic var hasSensors: Bool = false

public var onUpdate: ( () -> Void )?

Expand Down Expand Up @@ -115,6 +116,8 @@ public class InfoViewController: NSViewController

private func update()
{
self.hasSensors = self.log.sensors.isEmpty == false

if let n = self.log.schedulerLimit?.intValue
{
self.schedulerLimit = n
Expand Down
11 changes: 5 additions & 6 deletions Hot/UI/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down Expand Up @@ -651,8 +651,7 @@
<action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="R4o-n2-Eq4">
<modifierMask key="keyEquivalentModifierMask"/>
<menuItem title="Zoom" keyEquivalent="" id="R4o-n2-Eq4">
<connections>
<action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
</connections>
Expand Down Expand Up @@ -705,9 +704,9 @@
</items>
</menu>
<connections>
<binding destination="Voe-Tx-rLC" name="hidden" keyPath="self.infoViewController.log.sensors" id="I5E-xc-zkg">
<binding destination="Voe-Tx-rLC" name="hidden" keyPath="self.infoViewController.hasSensors" id="Iwh-ax-u58">
<dictionary key="options">
<string key="NSValueTransformerName">DictionaryIsEmpty</string>
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
</connections>
Expand Down
2 changes: 1 addition & 1 deletion Submodules/Sensors
Submodule Sensors updated 1 files
+1 −1 Submodules/SensorsKit

0 comments on commit 0d34958

Please sign in to comment.