mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: fixed showing the default value of update interval for all modules even after the change (#1942)
This commit is contained in:
@@ -140,7 +140,16 @@ public let ShortLong: [KeyValue_t] = [
|
||||
KeyValue_t(key: "long", value: "Long")
|
||||
]
|
||||
|
||||
public let ReaderUpdateIntervals: [Int] = [1, 2, 3, 5, 10, 15, 30, 60]
|
||||
public let ReaderUpdateIntervals: [KeyValue_t] = [
|
||||
KeyValue_t(key: "1", value: "1 sec"),
|
||||
KeyValue_t(key: "2", value: "2 sec"),
|
||||
KeyValue_t(key: "3", value: "3 sec"),
|
||||
KeyValue_t(key: "5", value: "5 sec"),
|
||||
KeyValue_t(key: "10", value: "10 sec"),
|
||||
KeyValue_t(key: "15", value: "15 sec"),
|
||||
KeyValue_t(key: "30", value: "30 sec"),
|
||||
KeyValue_t(key: "60", value: "60 sec")
|
||||
]
|
||||
public let NumbersOfProcesses: [Int] = [0, 3, 5, 8, 10, 15]
|
||||
|
||||
public let NetworkReaders: [KeyValue_t] = [
|
||||
|
||||
@@ -76,13 +76,13 @@ internal class Settings: NSStackView, Settings_v {
|
||||
self.addArrangedSubview(PreferencesSection([
|
||||
PreferencesRow(localizedString("Update interval"), component: selectView(
|
||||
action: #selector(self.changeUpdateInterval),
|
||||
items: ReaderUpdateIntervals.map{ KeyValue_t(key: "\($0)", value: "\($0) sec") },
|
||||
selected: "\(self.updateIntervalValue) sec"
|
||||
items: ReaderUpdateIntervals,
|
||||
selected: "\(self.updateIntervalValue)"
|
||||
)),
|
||||
PreferencesRow(localizedString("Update interval for top processes"), component: selectView(
|
||||
action: #selector(self.changeUpdateTopInterval),
|
||||
items: ReaderUpdateIntervals.map{ KeyValue_t(key: "\($0)", value: "\($0) sec") },
|
||||
selected: "\(self.updateTopIntervalValue) sec"
|
||||
items: ReaderUpdateIntervals,
|
||||
selected: "\(self.updateTopIntervalValue)"
|
||||
))
|
||||
]))
|
||||
|
||||
|
||||
@@ -285,9 +285,6 @@ public class Disk: Module {
|
||||
switch w.item {
|
||||
case let widget as SpeedWidget:
|
||||
widget.setValue(upload: d.activity.write, download: d.activity.read)
|
||||
if self.capacityReader?.interval != 1 {
|
||||
self.settingsView.setUpdateInterval(value: 1)
|
||||
}
|
||||
case let widget as NetworkChart:
|
||||
widget.setValue(upload: Double(d.activity.write), download: Double(d.activity.read))
|
||||
if self.capacityReader?.interval != 1 {
|
||||
|
||||
@@ -55,8 +55,8 @@ internal class Settings: NSStackView, Settings_v {
|
||||
self.addArrangedSubview(PreferencesSection([
|
||||
PreferencesRow(localizedString("Update interval"), component: selectView(
|
||||
action: #selector(self.changeUpdateInterval),
|
||||
items: ReaderUpdateIntervals.map{ KeyValue_t(key: "\($0)", value: "\($0) sec") },
|
||||
selected: "\(self.updateIntervalValue) sec"
|
||||
items: ReaderUpdateIntervals,
|
||||
selected: "\(self.updateIntervalValue)"
|
||||
))
|
||||
]))
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ internal class Settings: NSStackView, Settings_v {
|
||||
self.addArrangedSubview(PreferencesSection([
|
||||
PreferencesRow(localizedString("Update interval"), component: selectView(
|
||||
action: #selector(self.changeUpdateInterval),
|
||||
items: ReaderUpdateIntervals.map{ KeyValue_t(key: "\($0)", value: "\($0) sec") },
|
||||
selected: "\(self.updateIntervalValue) sec"
|
||||
items: ReaderUpdateIntervals,
|
||||
selected: "\(self.updateIntervalValue)"
|
||||
))
|
||||
]))
|
||||
|
||||
|
||||
@@ -51,13 +51,13 @@ internal class Settings: NSStackView, Settings_v {
|
||||
self.addArrangedSubview(PreferencesSection([
|
||||
PreferencesRow(localizedString("Update interval"), component: selectView(
|
||||
action: #selector(self.changeUpdateInterval),
|
||||
items: ReaderUpdateIntervals.map{ KeyValue_t(key: "\($0)", value: "\($0) sec") },
|
||||
selected: "\(self.updateIntervalValue) sec"
|
||||
items: ReaderUpdateIntervals,
|
||||
selected: "\(self.updateIntervalValue)"
|
||||
)),
|
||||
PreferencesRow(localizedString("Update interval for top processes"), component: selectView(
|
||||
action: #selector(self.changeUpdateTopInterval),
|
||||
items: ReaderUpdateIntervals.map{ KeyValue_t(key: "\($0)", value: "\($0) sec") },
|
||||
selected: "\(self.updateTopIntervalValue) sec"
|
||||
items: ReaderUpdateIntervals,
|
||||
selected: "\(self.updateTopIntervalValue)"
|
||||
))
|
||||
]))
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ internal class Settings: NSStackView, Settings_v {
|
||||
self.addArrangedSubview(PreferencesSection([
|
||||
PreferencesRow(localizedString("Update interval"), component: selectView(
|
||||
action: #selector(self.changeUpdateInterval),
|
||||
items: ReaderUpdateIntervals.map{ KeyValue_t(key: "\($0)", value: "\($0) sec") },
|
||||
selected: "\(self.updateIntervalValue) sec"
|
||||
items: ReaderUpdateIntervals,
|
||||
selected: "\(self.updateIntervalValue)"
|
||||
))
|
||||
]))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user