78 lines
2.3 KiB
C++
78 lines
2.3 KiB
C++
#include "General.hpp"
|
|
|
|
namespace {
|
|
QVariantList strList(std::initializer_list<const char *> items) {
|
|
QVariantList list;
|
|
for (auto *item : items) list << QString::fromLatin1(item);
|
|
return list;
|
|
}
|
|
|
|
QVariantMap threshold(const char *icon, const char *message, const char *name, int perc) {
|
|
QVariantMap m;
|
|
m["icon"] = QString::fromLatin1(icon);
|
|
m["message"] = QString::fromLatin1(message);
|
|
m["name"] = QString::fromLatin1(name);
|
|
m["perc"] = perc;
|
|
return m;
|
|
}
|
|
}
|
|
|
|
Apps::Apps(QObject *parent) : ConfigSection(parent) {
|
|
m_archiver = strList({"ark"});
|
|
m_audio = strList({"pavucontrol"});
|
|
m_document = strList({"libreoffice"});
|
|
m_editor = strList({"kate"});
|
|
m_explorer = strList({"dolphin"});
|
|
m_image = strList({"imv"});
|
|
m_playback = strList({"vlc"});
|
|
m_terminal = strList({"wezterm"});
|
|
wireSignals();
|
|
}
|
|
|
|
Battery::Battery(QObject *parent) : ConfigSection(parent) {
|
|
m_critPerc = 5;
|
|
m_popupThresholds = {
|
|
threshold("battery_android_frame_2", "Battery low", "Low battery", 20),
|
|
threshold("battery_android_frame_2", "Battery lower", "Low battery", 15),
|
|
threshold("battery_android_frame_2", "Battery lowest", "Low battery", 10),
|
|
};
|
|
wireSignals();
|
|
}
|
|
|
|
ColorSettings::ColorSettings(QObject *parent) : ConfigSection(parent) {
|
|
m_hyprsunsetTemp = 2600;
|
|
m_mode = QStringLiteral("dark");
|
|
m_neovimColors = false;
|
|
m_scheduleDark = false;
|
|
m_scheduleDarkEnd = 600;
|
|
m_scheduleDarkStart = 1140;
|
|
m_scheduleHyprsunset = true;
|
|
m_scheduleHyprsunsetEnd = 570;
|
|
m_scheduleHyprsunsetStart = 1200;
|
|
m_schemeGeneration = true;
|
|
m_smart = false;
|
|
wireSignals();
|
|
}
|
|
|
|
Idle::Idle(QObject *parent) : ConfigSection(parent) {
|
|
QVariantMap lock;
|
|
lock["idleAction"] = QStringLiteral("lock");
|
|
lock["name"] = QStringLiteral("Lock");
|
|
lock["timeout"] = 180;
|
|
m_timeouts = { lock };
|
|
wireSignals();
|
|
}
|
|
|
|
General::General(QObject *parent) : ConfigSection(parent) {
|
|
m_apps = new Apps(this);
|
|
m_battery = new Battery(this);
|
|
m_color = new ColorSettings(this);
|
|
m_dateFormat = QStringLiteral("ddd d MMM - hh:mm:ss");
|
|
m_desktopIcons = true;
|
|
m_idle = new Idle(this);
|
|
m_logo = QString();
|
|
m_showOverFullscreen = true;
|
|
m_wallpaperPath = QStringLiteral("/mnt/IronWolf/SDImages/SWWW_Wals/");
|
|
wireSignals();
|
|
}
|