feat: added notifications view to the Battery module

This commit is contained in:
Serhiy Mytrovtsiy
2023-12-20 13:20:08 +01:00
parent 4754b6144a
commit cedb16e2d6
10 changed files with 109 additions and 156 deletions

View File

@@ -38,6 +38,12 @@ open class NotificationsWrapper: NSStackView {
fatalError("init(coder:) has not been implemented")
}
public func willTerminate() {
for id in self.ids {
removeNotification(id.key)
}
}
public func initIDs(_ ids: [String]) {
for id in ids {
let notificationID = "Stats_\(self.module)_\(id)"

View File

@@ -255,6 +255,8 @@ public var isARM: Bool {
public let notificationLevels: [KeyValue_t] = [
KeyValue_t(key: "", value: "Disabled"),
KeyValue_t(key: "0.03", value: "3%"),
KeyValue_t(key: "0.05", value: "5%"),
KeyValue_t(key: "0.1", value: "10%"),
KeyValue_t(key: "0.15", value: "15%"),
KeyValue_t(key: "0.2", value: "20%"),