mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: improved SMC helper service initialization
This commit is contained in:
@@ -765,7 +765,7 @@ public class ProcessView: NSStackView {
|
||||
view.cell?.truncatesLastVisibleLine = true
|
||||
return view
|
||||
}()
|
||||
private var valueView: ValueField = ValueField(frame: NSRect(x: 0, y: 0, width: 0, height: 0))
|
||||
private var valueView: ValueField = ValueField()
|
||||
|
||||
public init(size: CGSize = CGSize(width: 264, height: 22)) {
|
||||
var rect = NSRect(x: 5, y: 5, width: 12, height: 12)
|
||||
@@ -1153,13 +1153,20 @@ public class SMCHelper {
|
||||
}
|
||||
|
||||
private func helper(_ completion: ((Bool) -> Void)?) -> HelperProtocol? {
|
||||
guard let helper = self.helperConnection()?.remoteObjectProxyWithErrorHandler({ _ in
|
||||
if let onCompletion = completion { onCompletion(false) }
|
||||
}) as? HelperProtocol else { return nil }
|
||||
guard let helper = self.helperConnection() else {
|
||||
completion?(false)
|
||||
return nil
|
||||
}
|
||||
guard let service = helper.remoteObjectProxyWithErrorHandler({ error in
|
||||
print(error)
|
||||
}) as? HelperProtocol else {
|
||||
completion?(false)
|
||||
return nil
|
||||
}
|
||||
|
||||
helper.setSMCPath(Bundle.main.path(forResource: "smc", ofType: nil)!)
|
||||
service.setSMCPath(Bundle.main.path(forResource: "smc", ofType: nil)!)
|
||||
|
||||
return helper
|
||||
return service
|
||||
}
|
||||
|
||||
public func uninstall(silent: Bool = false) {
|
||||
|
||||
@@ -126,14 +126,14 @@ internal class Popup: PopupWrapper {
|
||||
let view = SettingsContainerView()
|
||||
|
||||
view.addArrangedSubview(selectSettingsRow(
|
||||
title: localizedString("Color of write"),
|
||||
title: localizedString("Write color"),
|
||||
action: #selector(toggleWriteColor),
|
||||
items: Color.allColors,
|
||||
selected: self.writeColorState.key
|
||||
))
|
||||
|
||||
view.addArrangedSubview(selectSettingsRow(
|
||||
title: localizedString("Color of read"),
|
||||
title: localizedString("Read color"),
|
||||
action: #selector(toggleReadColor),
|
||||
items: Color.allColors,
|
||||
selected: self.readColorState.key
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>469</string>
|
||||
<string>471</string>
|
||||
<key>Description</key>
|
||||
<string>Simple macOS system monitor in your menu bar</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
|
||||
Reference in New Issue
Block a user