From ce994a0d1ed7053ba566110275aaf2c6829fc963 Mon Sep 17 00:00:00 2001 From: "Peter G. (nephros)" Date: Sun, 2 May 2021 16:00:00 +0200 Subject: [PATCH 1/6] support weird US temperature measurement --- application/qml/pages/MainPage.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/application/qml/pages/MainPage.qml b/application/qml/pages/MainPage.qml index d60147a..abfc258 100644 --- a/application/qml/pages/MainPage.qml +++ b/application/qml/pages/MainPage.qml @@ -177,9 +177,7 @@ Page { } MyDetailItem { label: qsTr("Temperature:") - // TODO: use weird degrees for US users - //value: useImperial ? celsiusToFahrenheit(battery.temperature) + " F" : Math.floor(battery.temperature / 10) + " °C" - value: Math.floor(battery.temperature / 10) + " °C" + value: (Qt.locale().measurementSystem == Locale.ImperialUSSystem) ? Math.floor((battery.temperature / 10) * 1.8 + 32) + " F" : Math.floor(battery.temperature / 10) + " °C" } } } From 93fa677a6fcd4234c09c0b91bf13d9c815d44006 Mon Sep 17 00:00:00 2001 From: "Peter G. (nephros)" Date: Sun, 2 May 2021 12:33:32 +0200 Subject: [PATCH 2/6] prepare settings for health alert --- application/qml/pages/SettingsPage.qml | 55 ++++++++++++++++++++++++++ application/src/settings.cpp | 38 +++++++++++------- application/src/settings.h | 23 +++++++++++ 3 files changed, 102 insertions(+), 14 deletions(-) diff --git a/application/qml/pages/SettingsPage.qml b/application/qml/pages/SettingsPage.qml index 3c9b06c..ded6bbc 100644 --- a/application/qml/pages/SettingsPage.qml +++ b/application/qml/pages/SettingsPage.qml @@ -43,9 +43,11 @@ Page { highLimitSlider.value = settings.highLimit lowLimitSlider.value = settings.lowLimit highAlertSlider.value = settings.highAlert + healthAlertSlider.value = settings.healthAlert lowAlertSlider.value = settings.lowAlert highIntervalSlider.value = settings.highNotificationsInterval lowIntervalSlider.value = settings.lowNotificationsInterval + healthIntervalSlider.value = settings.healthNotificationsInterval if(logger.debug) logger.log("SettingsPage values updated") daemonCheck.start() } @@ -365,6 +367,59 @@ Page { smallChange: 10 largeChange: 60 } + + SectionHeader { text: qsTr("Battery health notification") } + + MySlider { + id: healthAlertSlider + minimumValue: 0 + maximumValue: 2 + stepSize: 1 + onValueChanged: { + if(healthAlertSlider.value <= value) + healthAlertSlider.value = value + 1 + } + valueText: { + if (value === 0) + return "None" + if (value === 1) + return "Warning" + if (value === 2) + return "Critical" + } + onReleased: save() + function save(){ + settings.healthAlert = value + } + } + + SectionHeader { text: qsTr("Battery health warning interval") } + + MySlider { + id: healthIntervalSlider + minimumValue: 50 + maximumValue: 610 + stepSize: 10 + valueText: updateValueText() + onValueChanged: updateValueText() + function updateValueText() { + if(value == 50) + return qsTr("Once") + if(value == 610) + return qsTr("Never") + return Math.floor(value / 60) + (value % 60 < 10 ? ":0" + value % 60 : ":" + value % 60) + } + onReleased: save() + function save() { + settings.healthNotificationsInterval = value + } + } + + AdjustmentButtons { + targetSlider: healthIntervalSlider + smallChange: 10 + largeChange: 60 + } } } } diff --git a/application/src/settings.cpp b/application/src/settings.cpp index 04ef177..fe0107a 100644 --- a/application/src/settings.cpp +++ b/application/src/settings.cpp @@ -56,20 +56,24 @@ Settings::~Settings() } // Getters condensed. -int Settings::getLowAlert() { return lowAlert; } -int Settings::getHighAlert() { return highAlert; } -int Settings::getHighNotificationsInterval() { return highNotificationsInterval; } -int Settings::getLowNotificationsInterval() { return lowNotificationsInterval; } -int Settings::getLowLimit() { return lowLimit; } -int Settings::getHighLimit() { return highLimit; } -bool Settings::getLimitEnabled() { return limitEnabled == 1; } -QString Settings::getLowAlertFile() { return lowAlertFile; } -QString Settings::getHighAlertFile() { return highAlertFile; } -QString Settings::getLogFilename() { return logFilename; } -QString Settings::getNotificationTitle() { return notificationTitle; } -QString Settings::getNotificationLowText() { return notificationLowText; } -QString Settings::getNotificationHighText() { return notificationHighText; } -int Settings::getLogLevel() { return logLevel; } +int Settings::getLowAlert() { return lowAlert; } +int Settings::getHighAlert() { return highAlert; } +int Settings::getHealthAlert() { return healthAlert; } +int Settings::getHighNotificationsInterval() { return highNotificationsInterval; } +int Settings::getLowNotificationsInterval() { return lowNotificationsInterval; } +int Settings::getHealthNotificationsInterval() { return healthNotificationsInterval; } +int Settings::getLowLimit() { return lowLimit; } +int Settings::getHighLimit() { return highLimit; } +bool Settings::getLimitEnabled() { return limitEnabled == 1; } +QString Settings::getLowAlertFile() { return lowAlertFile; } +QString Settings::getHighAlertFile() { return highAlertFile; } +QString Settings::getHealthAlertFile() { return healthAlertFile; } +QString Settings::getLogFilename() { return logFilename; } +QString Settings::getNotificationTitle() { return notificationTitle; } +QString Settings::getNotificationLowText() { return notificationLowText; } +QString Settings::getNotificationHighText() { return notificationHighText; } +QString Settings::getNotificationHealthText() { return notificationHealthText; } +int Settings::getLogLevel() { return logLevel; } void Settings::setLowAlert(const int newLimit) { if(saveInteger(sLowAlert, newLimit, lowAlert)) { @@ -83,6 +87,12 @@ void Settings::setHighAlert(const int newLimit) { } } +void Settings::setHealthAlert(const int newLimit) { + if(saveInteger(sHealthAlert, newLimit, healthAlert)) { + emit healthAlertChanged(healthAlert); + } +} + void Settings::setHighNotificationsInterval(const int newInterval) { if(saveInteger(sHighNotificationsInterval, newInterval, highNotificationsInterval)) { emit highNotificationsIntervalChanged(highNotificationsInterval); diff --git a/application/src/settings.h b/application/src/settings.h index eecc6a0..497ba44 100644 --- a/application/src/settings.h +++ b/application/src/settings.h @@ -27,16 +27,20 @@ class Settings : public QObject Q_OBJECT Q_PROPERTY(int highAlert READ getHighAlert WRITE setHighAlert NOTIFY highAlertChanged) Q_PROPERTY(int lowAlert READ getLowAlert WRITE setLowAlert NOTIFY lowAlertChanged) + Q_PROPERTY(int healthAlert READ getHealthAlert WRITE setHealthAlert NOTIFY healthAlertChanged) Q_PROPERTY(int highNotificationsInterval READ getHighNotificationsInterval WRITE setHighNotificationsInterval NOTIFY highNotificationsIntervalChanged) Q_PROPERTY(int lowNotificationsInterval READ getLowNotificationsInterval WRITE setLowNotificationsInterval NOTIFY lowNotificationsIntervalChanged) + Q_PROPERTY(int healthNotificationsInterval READ getHealthNotificationsInterval WRITE setHealthNotificationsInterval NOTIFY healthNotificationsIntervalChanged) Q_PROPERTY(int highLimit READ getHighLimit WRITE setHighLimit NOTIFY highLimitChanged) Q_PROPERTY(int lowLimit READ getLowLimit WRITE setLowLimit NOTIFY lowLimitChanged) Q_PROPERTY(bool limitEnabled READ getLimitEnabled WRITE setLimitEnabled NOTIFY limitEnabledChanged) Q_PROPERTY(QString highAlertFile READ getHighAlertFile NOTIFY highAlertFileChanged) Q_PROPERTY(QString lowAlertFile READ getLowAlertFile NOTIFY lowAlertFileChanged) + Q_PROPERTY(QString healthAlertFile READ getHealthAlertFile NOTIFY healthAlertFileChanged) Q_PROPERTY(QString notificationTitle READ getNotificationTitle WRITE setNotificationTitle NOTIFY notificationTitleChanged) Q_PROPERTY(QString notificationLowText READ getNotificationLowText WRITE setNotificationLowText NOTIFY notificationLowTextChanged) Q_PROPERTY(QString notificationHighText READ getNotificationHighText WRITE setNotificationHighText NOTIFY notificationHighTextChanged) + Q_PROPERTY(QString notificationHealthText READ getNotificationHealthText WRITE setNotificationHealthText NOTIFY notificationHealthTextChanged) Q_PROPERTY(QString logFilename READ getLogFilename NOTIFY logFilenameChanged) Q_PROPERTY(int logLevel READ getLogLevel WRITE setLogLevel NOTIFY logLevelChanged) @@ -46,29 +50,36 @@ public: int getLowAlert(); int getHighAlert(); + int getHealthAlert(); int getHighNotificationsInterval(); int getLowNotificationsInterval(); + int getHealthNotificationsInterval(); int getLowLimit(); int getHighLimit(); bool getLimitEnabled(); QString getLowAlertFile(); QString getHighAlertFile(); + QString getHealthAlertFile(); QString getNotificationTitle(); QString getNotificationLowText(); QString getNotificationHighText(); + QString getNotificationHealthText(); QString getLogFilename(); int getLogLevel(); void setLowAlert(const int newLimit); void setHighAlert(const int newLimit); + void setHealthAlert(const int newLimit); void setHighNotificationsInterval(const int newInterval); void setLowNotificationsInterval(const int newInterval); + void setHealthNotificationsInterval(const int newInterval); void setLowLimit(const int newLimit); void setHighLimit(const int newLimit); void setLimitEnabled(const bool newEnabled); void setNotificationTitle(const QString newText); void setNotificationLowText(const QString newText); void setNotificationHighText(const QString newText); + void setNotificationHealthText(const QString newText); void setLogLevel(const int newLogLevel); private: @@ -79,32 +90,40 @@ private: // Default values int lowAlert = 25; int highAlert = 75; + int healthAlert = 1; // warn int highNotificationsInterval = 60; int lowNotificationsInterval = 60; + int healthNotificationsInterval = 60; int limitEnabled = 1; // Converted to boolean for QML int lowLimit = 65; int highLimit = 70; QString lowAlertFile = "/usr/share/sounds/jolla-ambient/stereo/general_warning.wav"; QString highAlertFile = "/usr/share/sounds/jolla-ambient/stereo/positive_confirmation.wav"; + QString healthAlertFile = lowAlertFile; QString notificationTitle; QString notificationLowText; QString notificationHighText; + QString notificationHealthText; QString logFilename; int logLevel; // To avoid repeating the same string over and over and over... const char* sLowAlert = "lowAlert"; const char* sHighAlert = "highAlert"; + const char* sHealthAlert = "healthAlert"; const char* sHighNotificationsInterval = "highNotificationsInterval"; const char* sLowNotificationsInterval = "lowNotificationsInterval"; + const char* sHealthNotificationsInterval = "healthNotificationsInterval"; const char* sLimitEnabled = "limitEnabled"; const char* sLowLimit = "lowLimit"; const char* sHighLimit = "highLimit"; const char* sLowAlertFile = "lowAlertFile"; const char* sHighAlertFile = "highAlertFile"; + const char* sHealthAlertFile = "healthAlertFile"; const char* sNotificationTitle = "notificationTitle"; const char* sNotificationLowText = "notificationLowText"; const char* sNotificationHighText = "notificationHighText"; + const char* sNotificationHealthText = "notificationHealthText"; const char* sLogFilename = "logFilename"; const char* sLogLevel = "logLevel"; @@ -117,16 +136,20 @@ private: signals: void lowAlertChanged(int); void highAlertChanged(int); + void healthAlertChanged(int); void highNotificationsIntervalChanged(int); void lowNotificationsIntervalChanged(int); + void healthNotificationsIntervalChanged(int); void limitEnabledChanged(bool); void lowLimitChanged(int); void highLimitChanged(int); void lowAlertFileChanged(QString); void highAlertFileChanged(QString); + void healthAlertFileChanged(QString); void notificationTitleChanged(QString); void notificationLowTextChanged(QString); void notificationHighTextChanged(QString); + void notificationHealthTextChanged(QString); void logFilenameChanged(QString); void logLevelChanged(int); }; From dfbf1ec078020f59139817956c5c588e4342f4da Mon Sep 17 00:00:00 2001 From: "Peter G. (nephros)" Date: Sun, 2 May 2021 11:33:45 +0200 Subject: [PATCH 3/6] implement settings for health alert --- application/qml/pages/SettingsPage.qml | 51 ++++++++++++++++---------- application/src/settings.cpp | 15 ++++++++ 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/application/qml/pages/SettingsPage.qml b/application/qml/pages/SettingsPage.qml index ded6bbc..040f479 100644 --- a/application/qml/pages/SettingsPage.qml +++ b/application/qml/pages/SettingsPage.qml @@ -43,7 +43,7 @@ Page { highLimitSlider.value = settings.highLimit lowLimitSlider.value = settings.lowLimit highAlertSlider.value = settings.highAlert - healthAlertSlider.value = settings.healthAlert + healthSelector.currentIndex = settings.healthAlert lowAlertSlider.value = settings.lowAlert highIntervalSlider.value = settings.highNotificationsInterval lowIntervalSlider.value = settings.lowNotificationsInterval @@ -368,28 +368,39 @@ Page { largeChange: 60 } + Label { + x: Theme.paddingLarge + text: qsTr("Health Notification settings") + color: Theme.highlightColor + } + Label { + text: qsTr("Display visual and audible notifications about battery health, when the battery temperature is below or above safe values.") + anchors { + left: parent.left + right: parent.right + leftMargin: Theme.horizontalPageMargin*2 + rightMargin: Theme.horizontalPageMargin + } + color: Theme.primaryColor + font.pixelSize: Theme.fontSizeExtraSmall + wrapMode: Text.Wrap + } + SectionHeader { text: qsTr("Battery health notification") } - MySlider { - id: healthAlertSlider - minimumValue: 0 - maximumValue: 2 - stepSize: 1 - onValueChanged: { - if(healthAlertSlider.value <= value) - healthAlertSlider.value = value + 1 + ComboBox { + id: healthSelector + width: parent.width + label: qsTr("Warn on Health status" + ":") + currentIndex: settings.healthAlert + menu: ContextMenu { + MenuItem { text: qsTr("None") } + MenuItem { text: qsTr("Warning") } + MenuItem { text: qsTr("Critical") } } - valueText: { - if (value === 0) - return "None" - if (value === 1) - return "Warning" - if (value === 2) - return "Critical" - } - onReleased: save() - function save(){ - settings.healthAlert = value + onValueChanged: save() + function save() { + settings.healthAlert = healthSelector.currentIndex } } diff --git a/application/src/settings.cpp b/application/src/settings.cpp index fe0107a..29bbe64 100644 --- a/application/src/settings.cpp +++ b/application/src/settings.cpp @@ -31,8 +31,10 @@ Settings::Settings(Logger *newLogger, QObject *parent) : QObject(parent) // Read in the values loadInteger(sLowAlert, lowAlert, 5, 99); loadInteger(sHighAlert, highAlert, 6, 100); + loadInteger(sHealthAlert, healthAlert, 0, 2); loadInteger(sHighNotificationsInterval, highNotificationsInterval, 50, 610); loadInteger(sLowNotificationsInterval, lowNotificationsInterval, 50, 610); + loadInteger(sHealthNotificationsInterval, healthNotificationsInterval, 50, 610); loadInteger(sLimitEnabled, limitEnabled, 0, 1); loadInteger(sLowLimit, lowLimit, 5, 99); loadInteger(sHighLimit, highLimit, 6, 100); @@ -43,10 +45,12 @@ Settings::Settings(Logger *newLogger, QObject *parent) : QObject(parent) loadString(sNotificationTitle, notificationTitle); loadString(sNotificationLowText, notificationLowText); loadString(sNotificationHighText, notificationHighText); + loadString(sNotificationHealthText, notificationHealthText); saveString(sNotificationTitle, tr("Battery charge %1%"), notificationTitle); saveString(sNotificationLowText, tr("Please connect the charger."), notificationLowText); saveString(sNotificationHighText, tr("Please disconnect the charger."), notificationHighText); + saveString(sNotificationHealthText, tr("Battery health"), notificationHealthText); } Settings::~Settings() @@ -105,6 +109,12 @@ void Settings::setLowNotificationsInterval(const int newInterval) { } } +void Settings::setHealthNotificationsInterval(const int newInterval) { + if(saveInteger(sHealthNotificationsInterval, newInterval, healthNotificationsInterval)) { + emit healthNotificationsIntervalChanged(healthNotificationsInterval); + } +} + void Settings::setLowLimit(const int newLimit) { if(saveInteger(sLowLimit, newLimit, lowLimit)) { emit lowLimitChanged(lowLimit); @@ -136,6 +146,11 @@ void Settings::setNotificationHighText(const QString newText) { emit notificationHighTextChanged(notificationHighText); } +void Settings::setNotificationHealthText(const QString newText) { + if(saveString(sNotificationHealthText, newText, notificationHealthText)) + emit notificationHealthTextChanged(notificationHealthText); +} + void Settings::setLogLevel(const int newLogLevel) { if(saveInteger(sLogLevel, newLogLevel, logLevel)) emit logLevelChanged(logLevel); From 91e6cad41455811d62d99c04f83182158ae1897f Mon Sep 17 00:00:00 2001 From: "Peter G. (nephros)" Date: Sun, 2 May 2021 17:18:25 +0200 Subject: [PATCH 4/6] Add several strings for health notification --- application/src/settings.cpp | 28 ++++++++++++++++++++++------ application/src/settings.h | 24 ++++++++++++++++++------ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/application/src/settings.cpp b/application/src/settings.cpp index 29bbe64..ebf9e42 100644 --- a/application/src/settings.cpp +++ b/application/src/settings.cpp @@ -45,12 +45,16 @@ Settings::Settings(Logger *newLogger, QObject *parent) : QObject(parent) loadString(sNotificationTitle, notificationTitle); loadString(sNotificationLowText, notificationLowText); loadString(sNotificationHighText, notificationHighText); - loadString(sNotificationHealthText, notificationHealthText); + loadString(sNotificationHealthTitle, notificationHealthTitle); + loadString(sNotificationHealthWarnText, notificationHealthWarnText); + loadString(sNotificationHealthCritText, notificationHealthCritText); saveString(sNotificationTitle, tr("Battery charge %1%"), notificationTitle); saveString(sNotificationLowText, tr("Please connect the charger."), notificationLowText); saveString(sNotificationHighText, tr("Please disconnect the charger."), notificationHighText); - saveString(sNotificationHealthText, tr("Battery health"), notificationHealthText); + saveString(sNotificationHealthTitle, tr("Battery health %1"), notificationHealthTitle); + saveString(sNotificationHealthWarnText, tr("Battery health is not good"), notificationHealthWarnText); + saveString(sNotificationHealthCritText, tr("Battery health is critical"), notificationHealthCritText); } Settings::~Settings() @@ -76,7 +80,9 @@ QString Settings::getLogFilename() { return logFilename; } QString Settings::getNotificationTitle() { return notificationTitle; } QString Settings::getNotificationLowText() { return notificationLowText; } QString Settings::getNotificationHighText() { return notificationHighText; } -QString Settings::getNotificationHealthText() { return notificationHealthText; } +QString Settings::getNotificationHealthTitle() { return notificationHealthTitle; } +QString Settings::getNotificationHealthWarnText() { return notificationHealthWarnText; } +QString Settings::getNotificationHealthCritText() { return notificationHealthCritText; } int Settings::getLogLevel() { return logLevel; } void Settings::setLowAlert(const int newLimit) { @@ -146,9 +152,19 @@ void Settings::setNotificationHighText(const QString newText) { emit notificationHighTextChanged(notificationHighText); } -void Settings::setNotificationHealthText(const QString newText) { - if(saveString(sNotificationHealthText, newText, notificationHealthText)) - emit notificationHealthTextChanged(notificationHealthText); +void Settings::setNotificationHealthTitle(const QString newText) { + if(saveString(sNotificationHealthTitle, newText, notificationTitle)) + emit notificationHealthTitleChanged(notificationTitle); +} + +void Settings::setNotificationHealthWarnText(const QString newText) { + if(saveString(sNotificationHealthWarnText, newText, notificationHealthWarnText)) + emit notificationHealthWarnTextChanged(notificationHealthWarnText); +} + +void Settings::setNotificationHealthCritText(const QString newText) { + if(saveString(sNotificationHealthCritText, newText, notificationHealthCritText)) + emit notificationHealthCritTextChanged(notificationHealthCritText); } void Settings::setLogLevel(const int newLogLevel) { diff --git a/application/src/settings.h b/application/src/settings.h index 497ba44..b30fc7d 100644 --- a/application/src/settings.h +++ b/application/src/settings.h @@ -40,7 +40,9 @@ class Settings : public QObject Q_PROPERTY(QString notificationTitle READ getNotificationTitle WRITE setNotificationTitle NOTIFY notificationTitleChanged) Q_PROPERTY(QString notificationLowText READ getNotificationLowText WRITE setNotificationLowText NOTIFY notificationLowTextChanged) Q_PROPERTY(QString notificationHighText READ getNotificationHighText WRITE setNotificationHighText NOTIFY notificationHighTextChanged) - Q_PROPERTY(QString notificationHealthText READ getNotificationHealthText WRITE setNotificationHealthText NOTIFY notificationHealthTextChanged) + Q_PROPERTY(QString notificationHealthTitle READ getNotificationHealthTitle WRITE setNotificationHealthTitle NOTIFY notificationHealthTitleChanged) + Q_PROPERTY(QString notificationHealthWarnText READ getNotificationHealthWarnText WRITE setNotificationHealthWarnText NOTIFY notificationHealthWarnTextChanged) + Q_PROPERTY(QString notificationHealthCritText READ getNotificationHealthCritText WRITE setNotificationHealthCritText NOTIFY notificationHealthCritTextChanged) Q_PROPERTY(QString logFilename READ getLogFilename NOTIFY logFilenameChanged) Q_PROPERTY(int logLevel READ getLogLevel WRITE setLogLevel NOTIFY logLevelChanged) @@ -63,7 +65,9 @@ public: QString getNotificationTitle(); QString getNotificationLowText(); QString getNotificationHighText(); - QString getNotificationHealthText(); + QString getNotificationHealthTitle(); + QString getNotificationHealthWarnText(); + QString getNotificationHealthCritText(); QString getLogFilename(); int getLogLevel(); @@ -79,7 +83,9 @@ public: void setNotificationTitle(const QString newText); void setNotificationLowText(const QString newText); void setNotificationHighText(const QString newText); - void setNotificationHealthText(const QString newText); + void setNotificationHealthTitle(const QString newText); + void setNotificationHealthWarnText(const QString newText); + void setNotificationHealthCritText(const QString newText); void setLogLevel(const int newLogLevel); private: @@ -103,7 +109,9 @@ private: QString notificationTitle; QString notificationLowText; QString notificationHighText; - QString notificationHealthText; + QString notificationHealthTitle; + QString notificationHealthWarnText; + QString notificationHealthCritText; QString logFilename; int logLevel; @@ -123,7 +131,9 @@ private: const char* sNotificationTitle = "notificationTitle"; const char* sNotificationLowText = "notificationLowText"; const char* sNotificationHighText = "notificationHighText"; - const char* sNotificationHealthText = "notificationHealthText"; + const char* sNotificationHealthTitle = "notificationHealthTitle"; + const char* sNotificationHealthWarnText = "notificationHealthWarnText"; + const char* sNotificationHealthCritText = "notificationHealthCritText"; const char* sLogFilename = "logFilename"; const char* sLogLevel = "logLevel"; @@ -149,7 +159,9 @@ signals: void notificationTitleChanged(QString); void notificationLowTextChanged(QString); void notificationHighTextChanged(QString); - void notificationHealthTextChanged(QString); + void notificationHealthTitleChanged(QString); + void notificationHealthWarnTextChanged(QString); + void notificationHealthCritTextChanged(QString); void logFilenameChanged(QString); void logLevelChanged(int); }; From 3ca91d5e071d35f173daaa8c97a0bddef8f915eb Mon Sep 17 00:00:00 2001 From: "Peter G. (nephros)" Date: Sun, 2 May 2021 22:07:55 +0200 Subject: [PATCH 5/6] update German translation --- .../harbour-batterybuddy-de_DE.ts | 77 ++++++++++++++++--- 1 file changed, 66 insertions(+), 11 deletions(-) diff --git a/application/translations/harbour-batterybuddy-de_DE.ts b/application/translations/harbour-batterybuddy-de_DE.ts index a0bf919..0bb3030 100644 --- a/application/translations/harbour-batterybuddy-de_DE.ts +++ b/application/translations/harbour-batterybuddy-de_DE.ts @@ -156,34 +156,34 @@ LogPage View log - + Logdatei ansehen Update - + Aktualisieren Copy - + Kopieren Log level - + Log Level Quiet Low log setting - + Still Verbose Medium log setting - + Mittel Debug High log setting - + Debug @@ -275,20 +275,43 @@ Current: Strom: + + Good + Battery is OK + die Batterie ist OK + + + Warm + Battery is warm + die Batterie ist warm + + + Overheated + Battery is very hot + die Batterie ist sehr heiss + + + Health: + Zustand: + + + Temperature: + Temperatur: + Settings Battery charge %1% - Akkustand %1% + Akkustand %1% Please connect the charger. - Bitte Ladegerät anschließen. + Bitte Ladegerät anschließen. Please disconnect the charger. - Bitte Ladegerät trennen. + Bitte Ladegerät trennen. @@ -364,7 +387,39 @@ View log - + Logdatei ansehen + + + Health Notification settings + Einstellungen zur Zustandbenachrichtigung + + + Display visual and audible notifications about battery health, when the battery temperature is below or above safe values. + Visuelle und akustische Benachrichtigungen zum Batteriezustand anzeigen, sobald die Temperatur über gewissen Schwellwerten liegt. + + + Battery health notification + Zustandsbenachrichtigung + + + Warn on Health status: + Benachrichtigung bei Zustand: + + + None + Keine + + + Warning + Warnung + + + Critical + Kritisch + + + Battery health warning interval + Zustandsbenachrichtigungsintervall From eec28a8da7153c22f70739e78e46988b1355cd22 Mon Sep 17 00:00:00 2001 From: "Peter G. (nephros)" Date: Sun, 2 May 2021 23:07:50 +0200 Subject: [PATCH 6/6] improve wording --- application/qml/pages/SettingsPage.qml | 10 ++++---- .../harbour-batterybuddy-de_DE.ts | 24 +++++++++++++++---- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/application/qml/pages/SettingsPage.qml b/application/qml/pages/SettingsPage.qml index 040f479..7e71107 100644 --- a/application/qml/pages/SettingsPage.qml +++ b/application/qml/pages/SettingsPage.qml @@ -374,7 +374,7 @@ Page { color: Theme.highlightColor } Label { - text: qsTr("Display visual and audible notifications about battery health, when the battery temperature is below or above safe values.") + text: qsTr("Display visual and audible notifications about battery health, when the battery status exceeds safe values.
This usually means high temperature but can be affected by other factors depending on the hardware.") anchors { left: parent.left right: parent.right @@ -386,15 +386,15 @@ Page { wrapMode: Text.Wrap } - SectionHeader { text: qsTr("Battery health notification") } + SectionHeader { text: qsTr("Health notification") } ComboBox { id: healthSelector width: parent.width - label: qsTr("Warn on Health status" + ":") + label: qsTr("Notify on Health status" + ":") currentIndex: settings.healthAlert menu: ContextMenu { - MenuItem { text: qsTr("None") } + MenuItem { text: qsTr("Never") } MenuItem { text: qsTr("Warning") } MenuItem { text: qsTr("Critical") } } @@ -404,7 +404,7 @@ Page { } } - SectionHeader { text: qsTr("Battery health warning interval") } + SectionHeader { text: qsTr("Health notification interval") } MySlider { id: healthIntervalSlider diff --git a/application/translations/harbour-batterybuddy-de_DE.ts b/application/translations/harbour-batterybuddy-de_DE.ts index 0bb3030..758b046 100644 --- a/application/translations/harbour-batterybuddy-de_DE.ts +++ b/application/translations/harbour-batterybuddy-de_DE.ts @@ -395,19 +395,19 @@ Display visual and audible notifications about battery health, when the battery temperature is below or above safe values. - Visuelle und akustische Benachrichtigungen zum Batteriezustand anzeigen, sobald die Temperatur über gewissen Schwellwerten liegt. + Visuelle und akustische Benachrichtigungen zum Batteriezustand anzeigen, sobald die Temperatur über gewissen Schwellwerten liegt. Battery health notification - Zustandsbenachrichtigung + Zustandsbenachrichtigung Warn on Health status: - Benachrichtigung bei Zustand: + Benachrichtigung bei Zustand: None - Keine + Keine Warning @@ -419,6 +419,22 @@ Battery health warning interval + Zustandsbenachrichtigungsintervall + + + Display visual and audible notifications about battery health, when the battery status exceeds safe values.<br />This usually means high temperature but can be affected by other factors depending on the hardware. + Visuelle und akustische Benachrichtigungen zum Batteriezustand anzeigen, sobald gewisse Schwellwerte erreicht werden.<br />Das betrifft meist die Temperatur, kann aber je nach Hardware auch andere Faktoren beinhalten. + + + Health notification + Zustandsbenachrichtigung + + + Notify on Health status: + Benachrichtigung zum Zustand: + + + Health notification interval Zustandsbenachrichtigungsintervall