Skip to content

Commit

Permalink
Added newer Notification App settings
Browse files Browse the repository at this point in the history
  • Loading branch information
nicola02nb committed Oct 14, 2024
1 parent f0318f5 commit 9950347
Show file tree
Hide file tree
Showing 9 changed files with 457 additions and 330 deletions.
12 changes: 12 additions & 0 deletions src/DataTypes/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ Settings loadSettingsFromFile(const QString &filePath)
if (json.contains("runOnStartup")) {
s.runOnstartup = json["runOnStartup"].toBool();
}
if (json.contains("notificationBatteryFull")) {
s.batteryLowThreshold = json["notificationBatteryFull"].toInt();
}
if (json.contains("notificationBatteryLow")) {
s.batteryLowThreshold = json["notificationBatteryLow"].toInt();
}
if (json.contains("audioNotification")) {
s.batteryLowThreshold = json["audioNotification"].toInt();
}
if (json.contains("batteryLowThreshold")) {
s.batteryLowThreshold = json["batteryLowThreshold"].toInt();
}
Expand All @@ -41,6 +50,9 @@ void saveSettingstoFile(const Settings &settings, const QString &filePath)
{
QJsonObject json;
json["runOnStartup"] = settings.runOnstartup;
json["notificationBatteryFull"] = settings.notificationBatteryFull;
json["notificationBatteryLow"] = settings.notificationBatteryLow;
json["audioNotification"] = settings.audioNotification;
json["batteryLowThreshold"] = settings.batteryLowThreshold;
json["msecUpdateIntervalTime"] = settings.msecUpdateIntervalTime;
json["styleName"] = settings.styleName;
Expand Down
6 changes: 6 additions & 0 deletions src/DataTypes/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ class Settings
Settings();

bool runOnstartup = false;

bool notificationBatteryFull = true;
bool notificationBatteryLow = true;
int batteryLowThreshold = 15;
bool audioNotification = true;

int msecUpdateIntervalTime = 30000;

QString styleName = "Default";
};

Expand Down
Loading

0 comments on commit 9950347

Please sign in to comment.