mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
ipd improvements
This commit is contained in:
parent
3262c7945f
commit
dfd89c5531
7 changed files with 133 additions and 163 deletions
|
@ -217,6 +217,12 @@ namespace {
|
||||||
logFile.close();
|
logFile.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void logEnabled(QString configOption, QString className) {
|
||||||
|
log("Enabling " + configOption + " setting", className);
|
||||||
|
}
|
||||||
|
void logDisabled(QString configOption, QString className) {
|
||||||
|
log("Disabling " + configOption + " setting", className);
|
||||||
|
}
|
||||||
bool checkconfig(QString file) {
|
bool checkconfig(QString file) {
|
||||||
if(QFile::exists(file)) {
|
if(QFile::exists(file)) {
|
||||||
QFile config(file);
|
QFile config(file);
|
||||||
|
|
|
@ -13,8 +13,8 @@ void sleepThread::start()
|
||||||
QThread::sleep(1);
|
QThread::sleep(1);
|
||||||
if(pipePath.exists() == true) {
|
if(pipePath.exists() == true) {
|
||||||
log("Looking for messages in pipe", className);
|
log("Looking for messages in pipe", className);
|
||||||
char * myfifo = "/run/ipd/fifo";
|
char * pipe = "/dev/ipd/fifo";
|
||||||
int fd = ::open(myfifo, O_RDONLY);
|
int fd = ::open(pipe, O_RDONLY);
|
||||||
char * readchar[5];
|
char * readchar[5];
|
||||||
::read(fd, readchar, 5);
|
::read(fd, readchar, 5);
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,11 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) :
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
powerDaemonSettings::setFont(QFont("u001"));
|
powerDaemonSettings::setFont(QFont("u001"));
|
||||||
ui->mainLabel->setFont(QFont("Inter"));
|
ui->mainLabel->setFont(QFont("Inter"));
|
||||||
ui->CBSLabel->setFont(QFont("Inter"));
|
|
||||||
ui->idleSleepLabel->setFont(QFont("Inter"));
|
// Avoid some display issues (label moving because width of text would change with a proportional font)
|
||||||
|
ui->CBSLabel->setFont(QFont("Noto Sans Mono"));
|
||||||
|
ui->idleSleepLabel->setFont(QFont("Noto Sans Mono"));
|
||||||
|
|
||||||
ui->label_2->setFont(QFont("Inter"));
|
ui->label_2->setFont(QFont("Inter"));
|
||||||
ui->exitBtn->setFont(QFont("Inter"));
|
ui->exitBtn->setFont(QFont("Inter"));
|
||||||
|
|
||||||
|
@ -25,10 +28,6 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) :
|
||||||
ui->ledUsageBtn->setProperty("type", "borderless");
|
ui->ledUsageBtn->setProperty("type", "borderless");
|
||||||
ui->hCustomCaseBtn->setProperty("type", "borderless");
|
ui->hCustomCaseBtn->setProperty("type", "borderless");
|
||||||
ui->deepSleepBtn->setProperty("type", "borderless");
|
ui->deepSleepBtn->setProperty("type", "borderless");
|
||||||
ui->CBSDecreaseBtn->setProperty("type", "borderless");
|
|
||||||
ui->CBSIncreaseBtn->setProperty("type", "borderless");
|
|
||||||
ui->idleSleepDecreaseBtn->setProperty("type", "borderless");
|
|
||||||
ui->idleSleepIncreaseBtn->setProperty("type", "borderless");
|
|
||||||
|
|
||||||
ui->mainLabel->setStyleSheet("font-weight: bold");
|
ui->mainLabel->setStyleSheet("font-weight: bold");
|
||||||
ui->CBSLabel->setStyleSheet("font-weight: bold");
|
ui->CBSLabel->setStyleSheet("font-weight: bold");
|
||||||
|
@ -73,7 +72,6 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) :
|
||||||
|
|
||||||
// 1 - cinematicBrightnessDelayMs
|
// 1 - cinematicBrightnessDelayMs
|
||||||
QString cinematicBrightnessMs = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/1-cinematicBrightnessDelayMs");
|
QString cinematicBrightnessMs = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/1-cinematicBrightnessDelayMs");
|
||||||
log("cinematicBrightnessDelayMs setting is: " + cinematicBrightnessMs, className);
|
|
||||||
|
|
||||||
ui->CBSLabel->setText(cinematicBrightnessMs);
|
ui->CBSLabel->setText(cinematicBrightnessMs);
|
||||||
|
|
||||||
|
@ -103,13 +101,11 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) :
|
||||||
ui->hCpuFreqComboBox->addItems(cpuGovernorList);
|
ui->hCpuFreqComboBox->addItems(cpuGovernorList);
|
||||||
ui->hCpuFreqComboBox->setCurrentIndex(0);
|
ui->hCpuFreqComboBox->setCurrentIndex(0);
|
||||||
|
|
||||||
log("cpuGovernor setting is: " + cpuGovernor, className);
|
|
||||||
|
|
||||||
// 3 - whenChargerSleep
|
// 3 - whenChargerSleep
|
||||||
QString whenChargerSleep = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/3-whenChargerSleep");
|
QString whenChargerSleep = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/3-whenChargerSleep");
|
||||||
if(whenChargerSleep == "true") {
|
if(whenChargerSleep == "true") {
|
||||||
whenChargerSleepBool = true;
|
whenChargerSleepBool = true;
|
||||||
ui->hWhenChargerSleepBtn->click();
|
ui->hWhenChargerSleepBtn->click();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
whenChargerSleepBool = false;
|
whenChargerSleepBool = false;
|
||||||
|
@ -119,7 +115,7 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) :
|
||||||
QString chargerWakeUp = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/4-chargerWakeUp");
|
QString chargerWakeUp = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/4-chargerWakeUp");
|
||||||
if(chargerWakeUp == "true") {
|
if(chargerWakeUp == "true") {
|
||||||
chargerWakeUpBool = true;
|
chargerWakeUpBool = true;
|
||||||
ui->hChargerWakeUpBtn->click();
|
ui->hChargerWakeUpBtn->click();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
chargerWakeUpBool = false;
|
chargerWakeUpBool = false;
|
||||||
|
@ -128,7 +124,7 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) :
|
||||||
// 5 - wifiReconnect
|
// 5 - wifiReconnect
|
||||||
QString wifiReconnect = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/5-wifiReconnect");
|
QString wifiReconnect = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/5-wifiReconnect");
|
||||||
if(wifiReconnect == "true") {
|
if(wifiReconnect == "true") {
|
||||||
ui->wifiReconnectBtn->click();
|
ui->wifiReconnectBtn->click();
|
||||||
wifiReconnectBool = true;
|
wifiReconnectBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -138,7 +134,7 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) :
|
||||||
// 6 - ledUsage
|
// 6 - ledUsage
|
||||||
QString ledUsagePath = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/6-ledUsage");
|
QString ledUsagePath = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/6-ledUsage");
|
||||||
if(ledUsagePath == "true") {
|
if(ledUsagePath == "true") {
|
||||||
ui->ledUsageBtn->click();
|
ui->ledUsageBtn->click();
|
||||||
ledUsageBool = true;
|
ledUsageBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -153,7 +149,7 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) :
|
||||||
// 8 - customCase
|
// 8 - customCase
|
||||||
QString customCaseString = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/8-customCase");
|
QString customCaseString = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/8-customCase");
|
||||||
if(customCaseString == "true") {
|
if(customCaseString == "true") {
|
||||||
ui->hCustomCaseBtn->click();
|
ui->hCustomCaseBtn->click();
|
||||||
customCaseBool = true;
|
customCaseBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -163,7 +159,7 @@ powerDaemonSettings::powerDaemonSettings(QWidget *parent) :
|
||||||
// 9 - deepSleep
|
// 9 - deepSleep
|
||||||
QString deepSleepString = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/9-deepSleep");
|
QString deepSleepString = readFile("/mnt/onboard/.adds/inkbox/.config/20-sleep_daemon/9-deepSleep");
|
||||||
if(deepSleepString == "true") {
|
if(deepSleepString == "true") {
|
||||||
ui->deepSleepBtn->click();
|
ui->deepSleepBtn->click();
|
||||||
deepSleepBool = true;
|
deepSleepBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -232,42 +228,54 @@ void powerDaemonSettings::on_expBtn_clicked()
|
||||||
ui->expBtn->hide();
|
ui->expBtn->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void powerDaemonSettings::on_hWhenChargerSleepBtn_clicked()
|
void powerDaemonSettings::on_hWhenChargerSleepBtn_clicked(bool checked)
|
||||||
{
|
{
|
||||||
if(whenChargerSleepBool == false) {
|
QString settingString = "suspend when charging";
|
||||||
|
if(checked == true) {
|
||||||
|
logEnabled(settingString, className);
|
||||||
whenChargerSleepBool = true;
|
whenChargerSleepBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
logDisabled(settingString, className);
|
||||||
whenChargerSleepBool = false;
|
whenChargerSleepBool = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void powerDaemonSettings::on_hChargerWakeUpBtn_clicked()
|
void powerDaemonSettings::on_hChargerWakeUpBtn_clicked(bool checked)
|
||||||
{
|
{
|
||||||
if(chargerWakeUpBool == false) {
|
QString settingString = "ignore charger wake-up events";
|
||||||
|
if(checked == true) {
|
||||||
|
logEnabled(settingString, className);
|
||||||
chargerWakeUpBool = true;
|
chargerWakeUpBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
logDisabled(settingString, className);
|
||||||
chargerWakeUpBool = false;
|
chargerWakeUpBool = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void powerDaemonSettings::on_wifiReconnectBtn_clicked()
|
void powerDaemonSettings::on_wifiReconnectBtn_clicked(bool checked)
|
||||||
{
|
{
|
||||||
if(wifiReconnectBool == false) {
|
QString settingString = "Wi-Fi reconnection on wake-up";
|
||||||
|
if(checked == true) {
|
||||||
|
logEnabled(settingString, className);
|
||||||
wifiReconnectBool = true;
|
wifiReconnectBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
logDisabled(settingString, className);
|
||||||
wifiReconnectBool = false;
|
wifiReconnectBool = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void powerDaemonSettings::on_ledUsageBtn_clicked()
|
void powerDaemonSettings::on_ledUsageBtn_clicked(bool checked)
|
||||||
{
|
{
|
||||||
if(ledUsageBool == false) {
|
QString settingString = "use LED";
|
||||||
|
if(checked == true) {
|
||||||
|
logEnabled(settingString, className);
|
||||||
ledUsageBool = true;
|
ledUsageBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
logDisabled(settingString, className);
|
||||||
ledUsageBool = false;
|
ledUsageBool = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -317,28 +325,34 @@ void powerDaemonSettings::convertIdleSleepInt()
|
||||||
text.append(QString::number(minutes) + "m");
|
text.append(QString::number(minutes) + "m");
|
||||||
}
|
}
|
||||||
if(seconds != 0) {
|
if(seconds != 0) {
|
||||||
text.append(" " + QString::number(seconds) + "s");
|
text.append(QString::number(seconds) + "s");
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->idleSleepLabel->setText(text);
|
ui->idleSleepLabel->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void powerDaemonSettings::on_hCustomCaseBtn_clicked()
|
void powerDaemonSettings::on_hCustomCaseBtn_clicked(bool checked)
|
||||||
{
|
{
|
||||||
if(customCaseBool == false) {
|
QString settingString = "custom case";
|
||||||
|
if(checked == true) {
|
||||||
|
logEnabled(settingString, className);
|
||||||
customCaseBool = true;
|
customCaseBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
logDisabled(settingString, className);
|
||||||
customCaseBool = false;
|
customCaseBool = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void powerDaemonSettings::on_deepSleepBtn_clicked()
|
void powerDaemonSettings::on_deepSleepBtn_clicked(bool checked)
|
||||||
{
|
{
|
||||||
if(deepSleepBool == false) {
|
QString settingString = "deep sleep";
|
||||||
|
if(checked == true) {
|
||||||
|
logEnabled(settingString, className);
|
||||||
deepSleepBool = true;
|
deepSleepBool = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
logDisabled(settingString, className);
|
||||||
deepSleepBool = false;
|
deepSleepBool = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,15 +22,15 @@ private slots:
|
||||||
void on_CBSDecreaseBtn_clicked();
|
void on_CBSDecreaseBtn_clicked();
|
||||||
void on_exitBtn_clicked();
|
void on_exitBtn_clicked();
|
||||||
void on_expBtn_clicked();
|
void on_expBtn_clicked();
|
||||||
void on_hWhenChargerSleepBtn_clicked();
|
void on_hWhenChargerSleepBtn_clicked(bool checked);
|
||||||
void on_hChargerWakeUpBtn_clicked();
|
void on_hChargerWakeUpBtn_clicked(bool checked);
|
||||||
void on_wifiReconnectBtn_clicked();
|
void on_wifiReconnectBtn_clicked(bool checked);
|
||||||
void on_ledUsageBtn_clicked();
|
void on_ledUsageBtn_clicked(bool checked);
|
||||||
void on_idleSleepIncreaseBtn_clicked();
|
void on_idleSleepIncreaseBtn_clicked();
|
||||||
void on_idleSleepDecreaseBtn_clicked();
|
void on_idleSleepDecreaseBtn_clicked();
|
||||||
void convertIdleSleepInt();
|
void convertIdleSleepInt();
|
||||||
void on_hCustomCaseBtn_clicked();
|
void on_hCustomCaseBtn_clicked(bool checked);
|
||||||
void on_deepSleepBtn_clicked();
|
void on_deepSleepBtn_clicked(bool checked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::powerDaemonSettings * ui;
|
Ui::powerDaemonSettings * ui;
|
||||||
|
|
|
@ -87,16 +87,6 @@
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line_6">
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="CBSIncreaseBtn">
|
<widget class="QPushButton" name="CBSIncreaseBtn">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -110,16 +100,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line_5">
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="CBSDecreaseBtn">
|
<widget class="QPushButton" name="CBSDecreaseBtn">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -133,16 +113,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line_7">
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="CBSLabel">
|
<widget class="QLabel" name="CBSLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
|
@ -156,6 +126,29 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line_3">
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Plain</enum>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Cinematic brightness speed</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -169,19 +162,6 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>50</weight>
|
|
||||||
<bold>false</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Cinematic brightness speed</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -189,7 +169,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="wifiReconnectBtn">
|
<widget class="QCheckBox" name="wifiReconnectBtn">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Reconnect to Wi-Fi after suspending</string>
|
<string>Reconnect to Wi-Fi on wake-up</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -234,16 +214,6 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line_8">
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="idleSleepIncreaseBtn">
|
<widget class="QPushButton" name="idleSleepIncreaseBtn">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -257,16 +227,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line_4">
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="idleSleepDecreaseBtn">
|
<widget class="QPushButton" name="idleSleepDecreaseBtn">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -280,16 +240,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line_9">
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="idleSleepLabel">
|
<widget class="QLabel" name="idleSleepLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
|
@ -303,6 +253,29 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line_4">
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Plain</enum>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sleep when idle</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_9">
|
<spacer name="horizontalSpacer_9">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -316,19 +289,6 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>50</weight>
|
|
||||||
<bold>false</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Sleep when idle</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
@ -401,15 +401,15 @@ void settings::on_aboutBtn_clicked()
|
||||||
|
|
||||||
void settings::on_demoCheckBox_toggled(bool checked)
|
void settings::on_demoCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "demo setting (change MainWindow label)";
|
QString settingString = "change MainWindow label demo";
|
||||||
// Write to config file
|
// Write to config file
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
checked_box = true;
|
checked_box = true;
|
||||||
writeconfig(".config/01-demo/config", "InkboxChangeLabel=");
|
writeconfig(".config/01-demo/config", "InkboxChangeLabel=");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
checked_box = false;
|
checked_box = false;
|
||||||
writeconfig(".config/01-demo/config", "InkboxChangeLabel=");
|
writeconfig(".config/01-demo/config", "InkboxChangeLabel=");
|
||||||
}
|
}
|
||||||
|
@ -417,15 +417,15 @@ void settings::on_demoCheckBox_toggled(bool checked)
|
||||||
|
|
||||||
void settings::on_clockCheckBox_toggled(bool checked)
|
void settings::on_clockCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "clock with seconds setting";
|
QString settingString = "clock with seconds";
|
||||||
// Write to config file
|
// Write to config file
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
checked_box = true;
|
checked_box = true;
|
||||||
writeconfig(".config/02-clock/config", "ClockShowSeconds=");
|
writeconfig(".config/02-clock/config", "ClockShowSeconds=");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
checked_box = false;
|
checked_box = false;
|
||||||
writeconfig(".config/02-clock/config", "ClockShowSeconds=");
|
writeconfig(".config/02-clock/config", "ClockShowSeconds=");
|
||||||
}
|
}
|
||||||
|
@ -433,14 +433,14 @@ void settings::on_clockCheckBox_toggled(bool checked)
|
||||||
|
|
||||||
void settings::on_quoteCheckBox_toggled(bool checked)
|
void settings::on_quoteCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "show quotes setting";
|
QString settingString = "disable show quotes";
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
checked_box = true;
|
checked_box = true;
|
||||||
writeconfig(".config/05-quote/config", "DisableQuote=");
|
writeconfig(".config/05-quote/config", "DisableQuote=");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
checked_box = false;
|
checked_box = false;
|
||||||
writeconfig(".config/05-quote/config", "DisableQuote=");
|
writeconfig(".config/05-quote/config", "DisableQuote=");
|
||||||
}
|
}
|
||||||
|
@ -566,14 +566,14 @@ void settings::on_updateBtn_clicked()
|
||||||
|
|
||||||
void settings::on_darkModeCheckBox_toggled(bool checked)
|
void settings::on_darkModeCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "dark mode setting";
|
QString settingString = "dark mode";
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
string_writeconfig(".config/10-dark_mode/config", "true");
|
string_writeconfig(".config/10-dark_mode/config", "true");
|
||||||
string_writeconfig("/tmp/invertScreen", "y");
|
string_writeconfig("/tmp/invertScreen", "y");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
string_writeconfig(".config/10-dark_mode/config", "false");
|
string_writeconfig(".config/10-dark_mode/config", "false");
|
||||||
string_writeconfig("/tmp/invertScreen", "n");
|
string_writeconfig("/tmp/invertScreen", "n");
|
||||||
}
|
}
|
||||||
|
@ -652,14 +652,14 @@ void settings::on_uiScalingSlider_valueChanged(int value)
|
||||||
|
|
||||||
void settings::on_menuBarCheckBox_toggled(bool checked)
|
void settings::on_menuBarCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "sticky menu bar setting";
|
QString settingString = "sticky menu bar";
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
checked_box = true;
|
checked_box = true;
|
||||||
writeconfig(".config/11-menubar/sticky", "StickyMenuBar=");
|
writeconfig(".config/11-menubar/sticky", "StickyMenuBar=");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
checked_box = false;
|
checked_box = false;
|
||||||
writeconfig(".config/11-menubar/sticky", "StickyMenuBar=");
|
writeconfig(".config/11-menubar/sticky", "StickyMenuBar=");
|
||||||
}
|
}
|
||||||
|
@ -718,22 +718,22 @@ void settings::on_setPasscodeBtn_clicked()
|
||||||
|
|
||||||
void settings::on_enableLockscreenCheckBox_toggled(bool checked)
|
void settings::on_enableLockscreenCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "lockscreen setting";
|
QString settingString = "lockscreen";
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
string_writeconfig(".config/12-lockscreen/config", "true");
|
string_writeconfig(".config/12-lockscreen/config", "true");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
string_writeconfig(".config/12-lockscreen/config", "false");
|
string_writeconfig(".config/12-lockscreen/config", "false");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void settings::on_enableUiScalingCheckBox_toggled(bool checked)
|
void settings::on_enableUiScalingCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "UI scaling setting";
|
QString settingString = "UI scaling";
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
// Writing default value depending on the device
|
// Writing default value depending on the device
|
||||||
if(global::deviceID == "n705\n") {
|
if(global::deviceID == "n705\n") {
|
||||||
string_writeconfig(".config/09-dpi/config", "187");
|
string_writeconfig(".config/09-dpi/config", "187");
|
||||||
|
@ -766,7 +766,7 @@ void settings::on_enableUiScalingCheckBox_toggled(bool checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
string_writeconfig(".config/09-dpi/config", "false");
|
string_writeconfig(".config/09-dpi/config", "false");
|
||||||
string_writeconfig(".config/09-dpi/config-enabled", "false");
|
string_writeconfig(".config/09-dpi/config-enabled", "false");
|
||||||
ui->uiScaleNumberLabel->hide();
|
ui->uiScaleNumberLabel->hide();
|
||||||
|
@ -811,13 +811,13 @@ void settings::on_pageSizeHeightSpinBox_valueChanged(int arg1)
|
||||||
|
|
||||||
void settings::on_readerScrollBarCheckBox_toggled(bool checked)
|
void settings::on_readerScrollBarCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "scrollbar display if necessary setting";
|
QString settingString = "scrollbar display if necessary";
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
string_writeconfig(".config/14-reader_scrollbar/config", "true");
|
string_writeconfig(".config/14-reader_scrollbar/config", "true");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
string_writeconfig(".config/14-reader_scrollbar/config", "false");
|
string_writeconfig(".config/14-reader_scrollbar/config", "false");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -828,14 +828,14 @@ void settings::brightnessDown() {
|
||||||
|
|
||||||
void settings::on_globalReadingSettingsCheckBox_toggled(bool checked)
|
void settings::on_globalReadingSettingsCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "global reading settings setting";
|
QString settingString = "global reading settings";
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
checked_box = true;
|
checked_box = true;
|
||||||
writeconfig(".config/16-global_reading_settings/config", "GlobalReadingSettings=");
|
writeconfig(".config/16-global_reading_settings/config", "GlobalReadingSettings=");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
checked_box = false;
|
checked_box = false;
|
||||||
writeconfig(".config/16-global_reading_settings/config", "GlobalReadingSettings=");
|
writeconfig(".config/16-global_reading_settings/config", "GlobalReadingSettings=");
|
||||||
}
|
}
|
||||||
|
@ -917,10 +917,10 @@ void settings::quit_restart() {
|
||||||
|
|
||||||
void settings::on_enableEncryptedStorageCheckBox_toggled(bool checked)
|
void settings::on_enableEncryptedStorageCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
QString settingString = "encrypted storage setting";
|
QString settingString = "encrypted storage";
|
||||||
if(checked == true) {
|
if(checked == true) {
|
||||||
if(enableEncryptedStorageUserChange == true) {
|
if(enableEncryptedStorageUserChange == true) {
|
||||||
logEnabled(settingString);
|
logEnabled(settingString, className);
|
||||||
setDefaultWorkDir();
|
setDefaultWorkDir();
|
||||||
string_writeconfig(".config/18-encrypted_storage/initial_setup_done", "false");
|
string_writeconfig(".config/18-encrypted_storage/initial_setup_done", "false");
|
||||||
string_writeconfig(".config/18-encrypted_storage/status", "true");
|
string_writeconfig(".config/18-encrypted_storage/status", "true");
|
||||||
|
@ -937,7 +937,7 @@ void settings::on_enableEncryptedStorageCheckBox_toggled(bool checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logDisabled(settingString);
|
logDisabled(settingString, className);
|
||||||
global::encfs::disableStorageEncryptionDialog = true;
|
global::encfs::disableStorageEncryptionDialog = true;
|
||||||
generalDialogWindow = new generalDialog(this);
|
generalDialogWindow = new generalDialog(this);
|
||||||
generalDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
|
generalDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
@ -1027,11 +1027,3 @@ void settings::on_tzComboBox_currentTextChanged(const QString &arg1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void settings::logEnabled(QString settingString) {
|
|
||||||
log("Enabling " + settingString, className);
|
|
||||||
}
|
|
||||||
|
|
||||||
void settings::logDisabled(QString settingString) {
|
|
||||||
log("Disabling " + settingString, className);
|
|
||||||
}
|
|
||||||
|
|
|
@ -71,8 +71,6 @@ private slots:
|
||||||
void on_repackBtn_clicked();
|
void on_repackBtn_clicked();
|
||||||
void on_generateSystemReportBtn_clicked();
|
void on_generateSystemReportBtn_clicked();
|
||||||
void on_tzComboBox_currentTextChanged(const QString &arg1);
|
void on_tzComboBox_currentTextChanged(const QString &arg1);
|
||||||
void logEnabled(QString settingString);
|
|
||||||
void logDisabled(QString settingString);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void showToast(QString messageToDisplay);
|
void showToast(QString messageToDisplay);
|
||||||
|
|
Loading…
Reference in a new issue