This commit is contained in:
Serhiy Mytrovtsiy
2025-01-26 14:32:51 +01:00
parent 479b812f84
commit 9325e2001c
23 changed files with 41 additions and 48 deletions

View File

@@ -26,7 +26,7 @@ internal class Portal: NSStackView, Portal_p {
}
public init(_ module: ModuleType) {
self.name = module.rawValue
self.name = module.stringValue
super.init(frame: NSRect.zero)

View File

@@ -24,7 +24,7 @@ internal class Settings: NSStackView, Settings_v {
private var timeFormat: String = "short"
public init(_ module: ModuleType) {
self.title = module.rawValue
self.title = module.stringValue
self.numberOfProcesses = Store.shared.int(key: "\(self.title)_processes", defaultValue: self.numberOfProcesses)
self.timeFormat = Store.shared.string(key: "\(self.title)_timeFormat", defaultValue: self.timeFormat)

View File

@@ -35,7 +35,7 @@ internal class Settings: NSStackView, Settings_v {
private var groupByClustersView: NSSwitch? = nil
public init(_ module: ModuleType) {
self.title = module.rawValue
self.title = module.stringValue
self.hyperthreadState = Store.shared.bool(key: "\(self.title)_hyperhreading", defaultValue: self.hyperthreadState)
self.usagePerCoreState = Store.shared.bool(key: "\(self.title)_usagePerCore", defaultValue: self.usagePerCoreState)
self.splitValueState = Store.shared.bool(key: "\(self.title)_splitValue", defaultValue: self.splitValueState)
@@ -63,13 +63,6 @@ internal class Settings: NSStackView, Settings_v {
public func load(widgets: [widget_t]) {
self.subviews.forEach{ $0.removeFromSuperview() }
var hasIPG = false
#if arch(x86_64)
let path: CFString = "/Library/Frameworks/IntelPowerGadget.framework" as CFString
let bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path, CFURLPathStyle.cfurlposixPathStyle, true)
hasIPG = CFBundleCreate(kCFAllocatorDefault, bundleURL) != nil
#endif
self.addArrangedSubview(PreferencesSection([
PreferencesRow(localizedString("Update interval"), component: selectView(
action: #selector(self.changeUpdateInterval),

View File

@@ -21,7 +21,7 @@ public class Portal: NSStackView, Portal_p {
private var multiplyContainer: ScrollableStackView = ScrollableStackView(orientation: .horizontal)
init(_ module: ModuleType, list: [Clock_t]) {
self.name = module.rawValue
self.name = module.stringValue
super.init(frame: NSRect.zero)

View File

@@ -51,7 +51,7 @@ internal class Settings: NSStackView, Settings_v, NSTableViewDelegate, NSTableVi
private var deleteButton: NSButton? = nil
public init(_ module: ModuleType) {
self.title = module.rawValue
self.title = module.stringValue
super.init(frame: NSRect.zero)

View File

@@ -32,7 +32,7 @@ internal class Settings: NSStackView, Settings_v {
private var list: [String] = []
public init(_ module: ModuleType) {
self.title = module.rawValue
self.title = module.stringValue
self.selectedDisk = Store.shared.string(key: "\(self.title)_disk", defaultValue: "")
self.removableState = Store.shared.bool(key: "\(self.title)_removable", defaultValue: self.removableState)

View File

@@ -27,7 +27,7 @@ internal class Settings: NSStackView, Settings_v {
private var button: NSPopUpButton?
public init(_ module: ModuleType) {
self.title = module.rawValue
self.title = module.stringValue
self.selectedGPU = Store.shared.string(key: "\(self.title)_gpu", defaultValue: "")
self.updateIntervalValue = Store.shared.int(key: "\(self.title)_updateInterval", defaultValue: self.updateIntervalValue)
self.showTypeValue = Store.shared.bool(key: "\(self.title)_showType", defaultValue: self.showTypeValue)

View File

@@ -86,7 +86,7 @@ internal class Settings: NSStackView, Settings_v, NSTextFieldDelegate {
}
public init(_ module: ModuleType) {
self.title = module.rawValue
self.title = module.stringValue
self.numberOfProcesses = Store.shared.int(key: "\(self.title)_processes", defaultValue: self.numberOfProcesses)
self.readerType = Store.shared.string(key: "\(self.title)_reader", defaultValue: self.readerType)
self.usageReset = Store.shared.string(key: "\(self.title)_usageReset", defaultValue: self.usageReset)

View File

@@ -60,7 +60,7 @@ internal class Settings: NSStackView, Settings_v, NSTextFieldDelegate {
private let textWidgetHelpPanel: HelpHUD = HelpHUD(textWidgetHelp)
public init(_ module: ModuleType) {
self.title = module.rawValue
self.title = module.stringValue
self.updateIntervalValue = Store.shared.int(key: "\(self.title)_updateInterval", defaultValue: self.updateIntervalValue)
self.updateTopIntervalValue = Store.shared.int(key: "\(self.title)_updateTopInterval", defaultValue: self.updateTopIntervalValue)
self.numberOfProcesses = Store.shared.int(key: "\(self.title)_processes", defaultValue: self.numberOfProcesses)

View File

@@ -25,7 +25,7 @@ public class Portal: NSStackView, Portal_p {
}
init(_ name: ModuleType) {
self.name = name.rawValue
self.name = name.stringValue
super.init(frame: NSRect( x: 0, y: 0, width: Constants.Popup.width, height: Constants.Popup.portalHeight))

View File

@@ -33,7 +33,7 @@ internal class Settings: NSStackView, Settings_v {
private var selectedSensor: String = "Average System Total"
public init(_ module: ModuleType) {
self.title = module.rawValue
self.title = module.stringValue
self.hidState = SystemKit.shared.device.platform == .m1 ? true : false
super.init(frame: NSRect.zero)