Skip to content

Commit

Permalink
v2.11.27
Browse files Browse the repository at this point in the history
exelban committed Jan 26, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 479b812 commit 9325e20
Showing 23 changed files with 41 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ concurrency:

jobs:
build:
runs-on: macos-latest
runs-on: macos-15

steps:
- uses: actions/checkout@v4
2 changes: 1 addition & 1 deletion Kit/constants.swift
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ public enum ModuleType: Int {

case combined

public var rawValue: String {
public var stringValue: String {
switch self {
case .CPU: return "CPU"
case .RAM: return "RAM"
2 changes: 1 addition & 1 deletion Kit/module/notifications.swift
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ open class NotificationsWrapper: NSStackView {
private var ids: [String: Bool?] = [:]

public init(_ module: ModuleType, _ ids: [String] = []) {
self.module = module.rawValue
self.module = module.stringValue
super.init(frame: NSRect.zero)
self.initIDs(ids)

4 changes: 2 additions & 2 deletions Kit/module/popup.swift
Original file line number Diff line number Diff line change
@@ -28,8 +28,8 @@ open class PopupWrapper: NSStackView, Popup_p {
open var sizeCallback: ((NSSize) -> Void)? = nil

public init(_ typ: ModuleType, frame: NSRect) {
self.title = typ.rawValue
self.keyboardShortcut = Store.shared.array(key: "\(typ.rawValue)_popup_keyboardShortcut", defaultValue: []) as? [UInt16] ?? []
self.title = typ.stringValue
self.keyboardShortcut = Store.shared.array(key: "\(typ.stringValue)_popup_keyboardShortcut", defaultValue: []) as? [UInt16] ?? []

super.init(frame: frame)
}
4 changes: 2 additions & 2 deletions Kit/module/portal.swift
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ open class PortalWrapper: NSStackView, Portal_p {
private let header: PortalHeader

public init(_ type: ModuleType, height: CGFloat = Constants.Popup.portalHeight) {
self.name = type.rawValue
self.header = PortalHeader(type.rawValue)
self.name = type.stringValue
self.header = PortalHeader(type.stringValue)

super.init(frame: NSRect(x: 0, y: 0, width: Constants.Popup.width, height: height))

12 changes: 6 additions & 6 deletions Kit/module/reader.swift
Original file line number Diff line number Diff line change
@@ -75,8 +75,8 @@ open class Reader<T: Codable>: NSObject, ReaderInternal_p {
self.callbackHandler = callback

super.init()
DB.shared.setup(T.self, "\(module.rawValue)@\(self.name)")
if let lastValue = DB.shared.findOne(T.self, key: "\(module.rawValue)@\(self.name)") {
DB.shared.setup(T.self, "\(module.stringValue)@\(self.name)")
if let lastValue = DB.shared.findOne(T.self, key: "\(module.stringValue)@\(self.name)") {
self.value = lastValue
callback(lastValue)
}
@@ -86,7 +86,7 @@ open class Reader<T: Codable>: NSObject, ReaderInternal_p {
}

deinit {
DB.shared.insert(key: "\(self.module.rawValue)@\(self.name)", value: self.value, ts: self.history)
DB.shared.insert(key: "\(self.module.stringValue)@\(self.name)", value: self.value, ts: self.history)
}

public func initStoreValues(title: String) {
@@ -102,10 +102,10 @@ open class Reader<T: Codable>: NSObject, ReaderInternal_p {
if let value {
self.callbackHandler(value)
if let ts = self.lastDBWrite, let interval = self.interval, Date().timeIntervalSince(ts) > interval * 10 {
DB.shared.insert(key: "\(self.module.rawValue)@\(self.name)", value: value, ts: self.history)
DB.shared.insert(key: "\(self.module.stringValue)@\(self.name)", value: value, ts: self.history)
self.lastDBWrite = Date()
} else if self.lastDBWrite == nil {
DB.shared.insert(key: "\(self.module.rawValue)@\(self.name)", value: value, ts: self.history)
DB.shared.insert(key: "\(self.module.stringValue)@\(self.name)", value: value, ts: self.history)
self.lastDBWrite = Date()
}
}
@@ -162,7 +162,7 @@ open class Reader<T: Codable>: NSObject, ReaderInternal_p {
}

public func save(_ value: T) {
DB.shared.insert(key: "\(self.module.rawValue)@\(self.name)", value: value, ts: self.history, force: true)
DB.shared.insert(key: "\(self.module.stringValue)@\(self.name)", value: value, ts: self.history, force: true)
}
}

2 changes: 1 addition & 1 deletion Modules/Battery/portal.swift
Original file line number Diff line number Diff line change
@@ -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)

2 changes: 1 addition & 1 deletion Modules/Battery/settings.swift
Original file line number Diff line number Diff line change
@@ -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)

9 changes: 1 addition & 8 deletions Modules/CPU/settings.swift
Original file line number Diff line number Diff line change
@@ -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),
2 changes: 1 addition & 1 deletion Modules/Clock/portal.swift
Original file line number Diff line number Diff line change
@@ -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)

2 changes: 1 addition & 1 deletion Modules/Clock/settings.swift
Original file line number Diff line number Diff line change
@@ -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)

2 changes: 1 addition & 1 deletion Modules/Disk/settings.swift
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion Modules/GPU/settings.swift
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion Modules/Net/settings.swift
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion Modules/RAM/settings.swift
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion Modules/Sensors/portal.swift
Original file line number Diff line number Diff line change
@@ -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))

2 changes: 1 addition & 1 deletion Modules/Sensors/settings.swift
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions Stats.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -2861,7 +2861,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.11.26;
MARKETING_VERSION = 2.11.27;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2898,7 +2898,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.11.26;
MARKETING_VERSION = 2.11.27;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats;
PRODUCT_NAME = "$(TARGET_NAME)";
2 changes: 1 addition & 1 deletion Stats/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>662</string>
<string>668</string>
<key>Description</key>
<string>Simple macOS system monitor in your menu bar</string>
<key>LSApplicationCategoryType</key>
8 changes: 4 additions & 4 deletions Stats/Supporting Files/pl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@
"Name" = "Nazwa";
"Format" = "Format";
"Turn off" = "Wyłączyć";
"Normal" = "Normal";
"Normal" = "Normalny";
"Warning" = "Ostrzeżenie";
"Critical" = "Krytyczny";
"Usage" = "Wykorzystanie";
@@ -195,7 +195,7 @@
"Static width" = "Statyczna szerokość";
"Tachometer widget" = "Tachometr";
"State widget" = "Stan";
"Text widget" = "Text widget";
"Text widget" = "Tekst";
"Show symbols" = "Pokaż symbole";
"Label widget" = "Etykieta";
"Number of reads in the chart" = "Liczba odczytów na wykresie";
@@ -328,7 +328,7 @@
"Write speed" = "Zapis";
"Read speed" = "Odczyt";
"Drives" = "Dyski";
"SMART data" = "SMART data";
"SMART data" = "SMART dane";

// Sensors
"Temperature unit" = "Jednostka temperatury";
@@ -394,7 +394,7 @@
"Latency" = "Opóźnienie";
"Upload speed" = "Wysyłka";
"Download speed" = "Pobranie";
"Address" = "Address";
"Address" = "Adres";

// Battery
"Level" = "Poziom naładowania";
8 changes: 4 additions & 4 deletions Stats/Supporting Files/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@
"Name" = "Название";
"Format" = "Формат";
"Turn off" = "Выключить";
"Normal" = "Normal";
"Normal" = "Нормальный";
"Warning" = "Предупреждение";
"Critical" = "Критический";
"Usage" = "Использование";
@@ -195,7 +195,7 @@
"Static width" = "Статическая ширина";
"Tachometer widget" = "Тахометр";
"State widget" = "Состояние";
"Text widget" = "Text widget";
"Text widget" = "Текст";
"Show symbols" = "Показать символы";
"Label widget" = "Этикетка";
"Number of reads in the chart" = "Количество чтений на графике";
@@ -328,7 +328,7 @@
"Write speed" = "Запись";
"Read speed" = "Чтение";
"Drives" = "Диски";
"SMART data" = "SMART data";
"SMART data" = "SMART данные";

// Sensors
"Temperature unit" = "Единица измерения температуры";
@@ -394,7 +394,7 @@
"Latency" = "Задержка";
"Upload speed" = "Выгрузка";
"Download speed" = "Загрузка";
"Address" = "Address";
"Address" = "Адрес";

// Battery
"Level" = "Уровень заряда";
8 changes: 4 additions & 4 deletions Stats/Supporting Files/uk.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@
"Name" = "Назва";
"Format" = "Формат";
"Turn off" = "Вимкнути";
"Normal" = "Normal";
"Normal" = "Нормальний";
"Warning" = "Попереджнння";
"Critical" = "Критичний";
"Usage" = "Використання";
@@ -195,7 +195,7 @@
"Static width" = "Статична ширина";
"Tachometer widget" = "Тахометр";
"State widget" = "Стан";
"Text widget" = "Text widget";
"Text widget" = "Текст";
"Show symbols" = "Показати символи";
"Label widget" = "Етикетка";
"Number of reads in the chart" = "Кількість зчитувань на діаграмі";
@@ -328,7 +328,7 @@
"Write speed" = "Запис";
"Read speed" = "Зчитування";
"Drives" = "Диски";
"SMART data" = "SMART data";
"SMART data" = "SMART дані";

// Sensors
"Temperature unit" = "Одиниця виміру температури";
@@ -394,7 +394,7 @@
"Latency" = "Затримка";
"Upload speed" = "Висилання";
"Download speed" = "Завантаження";
"Address" = "Address";
"Address" = "Адреса";

// Battery
"Level" = "Рівень заряду";
4 changes: 2 additions & 2 deletions Widgets/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>2.11.26</string>
<string>2.11.27</string>
<key>CFBundleVersion</key>
<string>662</string>
<string>668</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>

0 comments on commit 9325e20

Please sign in to comment.