Remove 'Enable UI scaling' check box

This commit is contained in:
Nicolas Mailloux 2023-01-28 09:26:17 -05:00
parent 4351642361
commit 68fbae33f5
3 changed files with 363 additions and 418 deletions

View file

@ -90,9 +90,6 @@ settings::settings(QWidget *parent) :
ui->setPasscodeLabel->hide(); ui->setPasscodeLabel->hide();
ui->securityLabel->hide(); ui->securityLabel->hide();
ui->line_2->hide(); ui->line_2->hide();
ui->uiScaleNumberLabel->hide();
ui->uiScalingSlider->hide();
ui->uiScalingLabel->hide();
// Variables // Variables
defineDefaultPageSize(0); defineDefaultPageSize(0);
@ -184,7 +181,25 @@ settings::settings(QWidget *parent) :
// Scaling // Scaling
string_checkconfig(".config/09-dpi/config"); string_checkconfig(".config/09-dpi/config");
if(checkconfig_str_val == "") { if(checkconfig_str_val == "") {
; // Writing default value depending on the device
if(global::deviceID == "n705\n") {
string_writeconfig(".config/09-dpi/config", "187");
}
else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "160");
}
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
string_writeconfig(".config/09-dpi/config", "195");
}
else if(global::deviceID == "n437\n") {
string_writeconfig(".config/09-dpi/config", "275");
}
else if(global::deviceID == "n873\n") {
string_writeconfig(".config/09-dpi/config", "285");
}
else {
string_writeconfig(".config/09-dpi/config", "187");
}
} }
else { else {
int dpi_number = checkconfig_str_val.toInt(); int dpi_number = checkconfig_str_val.toInt();
@ -315,20 +330,6 @@ settings::settings(QWidget *parent) :
ui->repackBtn->hide(); ui->repackBtn->hide();
} }
// DPI checkbox
string_checkconfig(".config/09-dpi/config");
// Check if the string is a number; else, we don't check the check box
if(checkconfig_str_val == "false") {
string_writeconfig(".config/09-dpi/config-enabled", "false");
}
else {
string_writeconfig(".config/09-dpi/config-enabled", "true");
}
if(checkconfig(".config/09-dpi/config-enabled") == true) {
ui_not_user_change = true;
ui->enableUiScalingCheckBox->click();
}
// Timezone // Timezone
ui->tzComboBox->addItems(QStringList(readFile(":/resources/tzlist").split("\n", Qt::SkipEmptyParts))); ui->tzComboBox->addItems(QStringList(readFile(":/resources/tzlist").split("\n", Qt::SkipEmptyParts)));
timezone_not_user_change = true; timezone_not_user_change = true;
@ -786,54 +787,6 @@ void settings::on_enableLockscreenCheckBox_toggled(bool checked)
} }
} }
void settings::on_enableUiScalingCheckBox_toggled(bool checked)
{
QString settingString = "UI scaling";
if(checked == true) {
logEnabled(settingString, className);
// Writing default value depending on the device
if(global::deviceID == "n705\n") {
string_writeconfig(".config/09-dpi/config", "187");
}
else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "160");
}
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
string_writeconfig(".config/09-dpi/config", "195");
}
else if(global::deviceID == "n437\n") {
string_writeconfig(".config/09-dpi/config", "275");
}
else if(global::deviceID == "n873\n") {
string_writeconfig(".config/09-dpi/config", "285");
}
else {
string_writeconfig(".config/09-dpi/config", "187");
}
string_writeconfig(".config/09-dpi/config-enabled", "true");
ui->uiScaleNumberLabel->show();
ui->uiScalingSlider->show();
ui->uiScalingLabel->show();
launch_sh = true;
if(ui_not_user_change == true) {
ui_enable_changed = false;
}
else {
ui_enable_changed = true;
}
}
else {
logDisabled(settingString, className);
string_writeconfig(".config/09-dpi/config", "false");
string_writeconfig(".config/09-dpi/config-enabled", "false");
ui->uiScaleNumberLabel->hide();
ui->uiScalingSlider->hide();
ui->uiScalingLabel->hide();
launch_sh = true;
ui_enable_changed = true;
}
}
void settings::on_showSystemInfoBtn_clicked() void settings::on_showSystemInfoBtn_clicked()
{ {
log("'Show system info' button clicked", className); log("'Show system info' button clicked", className);

View file

@ -49,7 +49,6 @@ private slots:
void on_resetBtn_clicked(); void on_resetBtn_clicked();
void on_setPasscodeBtn_clicked(); void on_setPasscodeBtn_clicked();
void on_enableLockscreenCheckBox_toggled(bool checked); void on_enableLockscreenCheckBox_toggled(bool checked);
void on_enableUiScalingCheckBox_toggled(bool checked);
void on_showSystemInfoBtn_clicked(); void on_showSystemInfoBtn_clicked();
void on_readerScrollBarCheckBox_toggled(bool checked); void on_readerScrollBarCheckBox_toggled(bool checked);
void brightnessDown(); void brightnessDown();

View file

@ -700,20 +700,99 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="21" column="0"> <item row="29" column="0">
<widget class="QCheckBox" name="autoCheckUpdatesBox"> <widget class="Line" name="line_10">
<property name="sizePolicy"> <property name="frameShadow">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <enum>QFrame::Plain</enum>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="text"> <property name="orientation">
<string>Automatically check for updates</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="14" column="0"> <item row="12" column="0">
<layout class="QGridLayout" name="gridLayout_19">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="2">
<widget class="QPushButton" name="generateSystemReportBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Generate</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Generate system report</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="28" column="0">
<widget class="QLabel" name="storageEncryptionLabel">
<property name="font">
<font>
<family>Chivo</family>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Storage encryption</string>
</property>
</widget>
</item>
<item row="21" column="0">
<widget class="QLabel" name="securityLabel">
<property name="font">
<font>
<family>Chivo</family>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Security</string>
</property>
</widget>
</item>
<item row="22" column="0">
<widget class="Line" name="line_2">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="23" column="0">
<widget class="QCheckBox" name="enableLockscreenCheckBox">
<property name="text">
<string>Enable lock screen and passcode</string>
</property>
</widget>
</item>
<item row="13" column="0">
<layout class="QGridLayout" name="gridLayout_18"> <layout class="QGridLayout" name="gridLayout_18">
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
@ -743,26 +822,23 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="29" column="0"> <item row="11" column="0">
<widget class="QLabel" name="storageEncryptionLabel"> <layout class="QGridLayout" name="gridLayout_7">
<property name="font">
<font>
<family>Chivo</family>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Storage encryption</string>
</property>
</widget>
</item>
<item row="26" column="0">
<layout class="QGridLayout" name="gridLayout_13">
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>System info</string>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<spacer name="horizontalSpacer_9"> <spacer name="horizontalSpacer_6">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -775,27 +851,20 @@
</spacer> </spacer>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QPushButton" name="setPasscodeBtn"> <widget class="QPushButton" name="showSystemInfoBtn">
<property name="font"> <property name="font">
<font> <font>
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Set</string> <string>Show</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="setPasscodeLabel">
<property name="text">
<string>Set a passcode</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="9" column="0"> <item row="8" column="0">
<layout class="QGridLayout" name="gridLayout_8"> <layout class="QGridLayout" name="gridLayout_8">
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
@ -846,189 +915,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="12" column="0">
<layout class="QGridLayout" name="gridLayout_7">
<property name="bottomMargin">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>System info</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="showSystemInfoBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Show</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="11" column="0">
<layout class="QGridLayout" name="gridLayout_12">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Reset this device</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="resetBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Reset</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="enableUiScalingCheckBox">
<property name="text">
<string>Enable UI scaling</string>
</property>
</widget>
</item>
<item row="13" column="0">
<layout class="QGridLayout" name="gridLayout_19">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="2">
<widget class="QPushButton" name="generateSystemReportBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Generate</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Generate system report</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="10" column="0">
<widget class="QCheckBox" name="darkModeCheckBox">
<property name="text">
<string>Enable night mode</string>
</property>
</widget>
</item>
<item row="30" column="0">
<widget class="Line" name="line_10">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="32" column="0">
<layout class="QGridLayout" name="gridLayout_17">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="repackLabel">
<property name="text">
<string>Repack</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="repackBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Repack</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="0"> <item row="7" column="0">
<widget class="Line" name="line_9"> <widget class="Line" name="line_9">
<property name="frameShadow"> <property name="frameShadow">
@ -1039,138 +925,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="33" column="0"> <item row="26" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="31" column="0">
<widget class="QCheckBox" name="enableEncryptedStorageCheckBox">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item row="15" column="0">
<layout class="QGridLayout" name="checkOtaUpdateGridLayout">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="checkOtaUpdateLabel">
<property name="text">
<string>Check for updates</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="checkOtaUpdateBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Check</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="20" column="0">
<layout class="QGridLayout" name="gridLayout_14">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="updateLabel">
<property name="text">
<string>Update InkBox</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="updateBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="22" column="0">
<widget class="QLabel" name="securityLabel">
<property name="font">
<font>
<family>Chivo</family>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Security</string>
</property>
</widget>
</item>
<item row="23" column="0">
<widget class="Line" name="line_2">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="24" column="0">
<widget class="QCheckBox" name="enableLockscreenCheckBox">
<property name="text">
<string>Enable lock screen and passcode</string>
</property>
</widget>
</item>
<item row="27" column="0">
<layout class="QGridLayout" name="gridLayout_20"> <layout class="QGridLayout" name="gridLayout_20">
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
@ -1216,6 +971,244 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="25" column="0">
<layout class="QGridLayout" name="gridLayout_13">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="setPasscodeBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Set</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="setPasscodeLabel">
<property name="text">
<string>Set a passcode</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="14" column="0">
<layout class="QGridLayout" name="checkOtaUpdateGridLayout">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="checkOtaUpdateLabel">
<property name="text">
<string>Check for updates</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="checkOtaUpdateBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Check</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="31" column="0">
<layout class="QGridLayout" name="gridLayout_17">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="repackLabel">
<property name="text">
<string>Repack</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="repackBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Repack</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="30" column="0">
<widget class="QCheckBox" name="enableEncryptedStorageCheckBox">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="darkModeCheckBox">
<property name="text">
<string>Enable night mode</string>
</property>
</widget>
</item>
<item row="10" column="0">
<layout class="QGridLayout" name="gridLayout_12">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Reset this device</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="resetBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Reset</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="32" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="20" column="0">
<widget class="QCheckBox" name="autoCheckUpdatesBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Automatically check for updates</string>
</property>
</widget>
</item>
<item row="19" column="0">
<layout class="QGridLayout" name="gridLayout_14">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="updateLabel">
<property name="text">
<string>Update InkBox</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="updateBtn">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>