mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
N249: Brightness fixes
This commit is contained in:
parent
7daf01c951
commit
cf4fb0ff2a
12 changed files with 104 additions and 67 deletions
|
@ -205,6 +205,7 @@ namespace global {
|
||||||
inline bool isN236 = false;
|
inline bool isN236 = false;
|
||||||
inline bool isN437 = false;
|
inline bool isN437 = false;
|
||||||
inline bool isN306 = false;
|
inline bool isN306 = false;
|
||||||
|
inline bool isN249 = false;
|
||||||
inline bool isKT = false;
|
inline bool isKT = false;
|
||||||
inline bool runningInstanceIsReaderOnly;
|
inline bool runningInstanceIsReaderOnly;
|
||||||
inline QString deviceID;
|
inline QString deviceID;
|
||||||
|
@ -293,6 +294,15 @@ namespace {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void setBrightness(int value) {
|
void setBrightness(int value) {
|
||||||
|
if(global::deviceID == "n249\n") {
|
||||||
|
if(QFile::exists("/var/run/brightness_write")) {
|
||||||
|
std::ofstream fhandler;
|
||||||
|
fhandler.open("/var/run/brightness_write");
|
||||||
|
fhandler << value;
|
||||||
|
fhandler.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
if(QFile::exists("/var/run/brightness")) {
|
if(QFile::exists("/var/run/brightness")) {
|
||||||
std::ofstream fhandler;
|
std::ofstream fhandler;
|
||||||
fhandler.open("/var/run/brightness");
|
fhandler.open("/var/run/brightness");
|
||||||
|
@ -300,6 +310,7 @@ namespace {
|
||||||
fhandler.close();
|
fhandler.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
void setBrightness_ntxio(int value) {
|
void setBrightness_ntxio(int value) {
|
||||||
// Thanks to Kevin Short for this (GloLight)
|
// Thanks to Kevin Short for this (GloLight)
|
||||||
int light;
|
int light;
|
||||||
|
@ -553,7 +564,7 @@ namespace {
|
||||||
QString getConnectionInformation() {
|
QString getConnectionInformation() {
|
||||||
QString getIpProg ("sh");
|
QString getIpProg ("sh");
|
||||||
QStringList getIpArgs;
|
QStringList getIpArgs;
|
||||||
if(global::deviceID != "n437\n") {
|
if(global::deviceID != "n437\n" and global::deviceID != "n249\n") {
|
||||||
getIpArgs << "-c" << "/sbin/ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'";
|
getIpArgs << "-c" << "/sbin/ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -624,7 +635,7 @@ namespace {
|
||||||
defaultEpubPageHeight = 425;
|
defaultEpubPageHeight = 425;
|
||||||
defaultEpubPageWidth = 425;
|
defaultEpubPageWidth = 425;
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "emu\n") {
|
||||||
defaultEpubPageHeight = 450;
|
defaultEpubPageHeight = 450;
|
||||||
defaultEpubPageWidth = 450;
|
defaultEpubPageWidth = 450;
|
||||||
}
|
}
|
||||||
|
@ -657,7 +668,7 @@ namespace {
|
||||||
defaultPdfPageWidth = 974;
|
defaultPdfPageWidth = 974;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
if(global::reader::pdfOrientation == 0) {
|
if(global::reader::pdfOrientation == 0) {
|
||||||
defaultPdfPageHeight = 1398;
|
defaultPdfPageHeight = 1398;
|
||||||
defaultPdfPageWidth = 1022;
|
defaultPdfPageWidth = 1022;
|
||||||
|
@ -683,7 +694,7 @@ namespace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void preSetBrightness(int brightnessValue) {
|
void preSetBrightness(int brightnessValue) {
|
||||||
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n") {
|
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n") {
|
||||||
setBrightness(brightnessValue);
|
setBrightness(brightnessValue);
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n613\n") {
|
else if(global::deviceID == "n613\n") {
|
||||||
|
@ -738,22 +749,33 @@ namespace {
|
||||||
}
|
}
|
||||||
int getWarmth() {
|
int getWarmth() {
|
||||||
QString sysfsWarmthPath;
|
QString sysfsWarmthPath;
|
||||||
|
int warmthValue;
|
||||||
if(global::deviceID == "n873\n") {
|
if(global::deviceID == "n873\n") {
|
||||||
sysfsWarmthPath = "/sys/class/backlight/lm3630a_led/color";
|
sysfsWarmthPath = "/sys/class/backlight/lm3630a_led/color";
|
||||||
}
|
}
|
||||||
|
else if(global::deviceID == "n249\n") {
|
||||||
|
sysfsWarmthPath = "/sys/class/backlight/backlight_warm/actual_brightness";
|
||||||
|
}
|
||||||
QString warmthConfig = readFile(sysfsWarmthPath);
|
QString warmthConfig = readFile(sysfsWarmthPath);
|
||||||
int warmthValue = warmthConfig.toInt();
|
warmthValue = warmthConfig.toInt();
|
||||||
|
if (global::deviceID == "n873\n") {
|
||||||
warmthValue = 10 - warmthValue;
|
warmthValue = 10 - warmthValue;
|
||||||
|
}
|
||||||
return warmthValue;
|
return warmthValue;
|
||||||
}
|
}
|
||||||
void setWarmth(int warmthValue) {
|
void setWarmth(int warmthValue) {
|
||||||
|
QString sysfsWarmthPath;
|
||||||
|
QString warmthValueStr;
|
||||||
|
if(global::deviceID == "n873\n") {
|
||||||
// Value 0 gives a warmer lighting than value 10
|
// Value 0 gives a warmer lighting than value 10
|
||||||
warmthValue = 10 - warmthValue;
|
warmthValue = 10 - warmthValue;
|
||||||
QString warmthValueStr = QString::number(warmthValue);
|
warmthValueStr = QString::number(warmthValue);
|
||||||
QString sysfsWarmthPath;
|
|
||||||
if(global::deviceID == "n873\n") {
|
|
||||||
sysfsWarmthPath = "/sys/class/backlight/lm3630a_led/color";
|
sysfsWarmthPath = "/sys/class/backlight/lm3630a_led/color";
|
||||||
}
|
}
|
||||||
|
else if(global::deviceID == "n249\n") {
|
||||||
|
warmthValueStr = QString::number(warmthValue);
|
||||||
|
sysfsWarmthPath = "/sys/class/backlight/backlight_warm/brightness";
|
||||||
|
}
|
||||||
writeFile(sysfsWarmthPath, warmthValueStr);
|
writeFile(sysfsWarmthPath, warmthValueStr);
|
||||||
}
|
}
|
||||||
void cinematicWarmth(int warmthValue) {
|
void cinematicWarmth(int warmthValue) {
|
||||||
|
@ -1040,7 +1062,7 @@ namespace {
|
||||||
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
||||||
return 2.6;
|
return 2.6;
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n" or global::deviceID == "n873\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n" or global::deviceID == "n873\n") {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1049,7 +1071,7 @@ namespace {
|
||||||
}
|
}
|
||||||
global::wifi::wifiState checkWifiState() {
|
global::wifi::wifiState checkWifiState() {
|
||||||
QString interfaceName;
|
QString interfaceName;
|
||||||
if(global::deviceID == "n437\n" or global::deviceID == "kt\n") {
|
if(global::deviceID == "n437\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n") {
|
||||||
interfaceName = "wlan0";
|
interfaceName = "wlan0";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -23,7 +23,7 @@ homePageWidget::homePageWidget(QWidget *parent) :
|
||||||
stdIconWidth = sW / 25;
|
stdIconWidth = sW / 25;
|
||||||
stdIconHeight = sH / 25;
|
stdIconHeight = sH / 25;
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "emu\n") {
|
||||||
stdIconWidth = sW / 23.5;
|
stdIconWidth = sW / 23.5;
|
||||||
stdIconHeight = sH / 23.5;
|
stdIconHeight = sH / 23.5;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ homePageWidget::homePageWidget(QWidget *parent) :
|
||||||
stdIconWidth = sW / stdIconWidthDivider;
|
stdIconWidth = sW / stdIconWidthDivider;
|
||||||
stdIconHeight = sH / stdIconHeightDivider;
|
stdIconHeight = sH / stdIconHeightDivider;
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
stdIconWidthDivider = 6.5;
|
stdIconWidthDivider = 6.5;
|
||||||
stdIconHeightDivider = 6.5;
|
stdIconHeightDivider = 6.5;
|
||||||
stdIconWidth = sW / stdIconWidthDivider;
|
stdIconWidth = sW / stdIconWidthDivider;
|
||||||
|
|
|
@ -91,7 +91,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
wifiIconWidth = sW / 22.5;
|
wifiIconWidth = sW / 22.5;
|
||||||
wifiIconHeight = sH / 22.5;
|
wifiIconHeight = sH / 22.5;
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "emu\n") {
|
||||||
stdIconWidth = sW / 12.5;
|
stdIconWidth = sW / 12.5;
|
||||||
stdIconHeight = sH / 12.5;
|
stdIconHeight = sH / 12.5;
|
||||||
brightnessIconWidth = sW / 24.5;
|
brightnessIconWidth = sW / 24.5;
|
||||||
|
@ -149,7 +149,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
|
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
|
||||||
ui->batteryIcon->setStyleSheet("font-size: 5pt; padding-bottom: 0px; padding-top: 0px; padding-left: 1px; padding-right: 1px;");
|
ui->batteryIcon->setStyleSheet("font-size: 5pt; padding-bottom: 0px; padding-top: 0px; padding-left: 1px; padding-right: 1px;");
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "emu\n") {
|
||||||
ui->batteryIcon->setStyleSheet("font-size: 5pt; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px;");
|
ui->batteryIcon->setStyleSheet("font-size: 5pt; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px;");
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n873\n") {
|
else if(global::deviceID == "n873\n") {
|
||||||
|
@ -640,7 +640,7 @@ void MainWindow::resetIcons() {
|
||||||
|
|
||||||
void MainWindow::setBatteryIcon() {
|
void MainWindow::setBatteryIcon() {
|
||||||
// Battery
|
// Battery
|
||||||
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n") {
|
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n") {
|
||||||
// Hide brightness controls; they won't be very useful there anyway (for anything but the Glo (HD)/Libra/Aura 2) ...
|
// Hide brightness controls; they won't be very useful there anyway (for anything but the Glo (HD)/Libra/Aura 2) ...
|
||||||
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
|
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
|
||||||
ui->brightnessBtn->hide();
|
ui->brightnessBtn->hide();
|
||||||
|
|
|
@ -69,7 +69,7 @@ localLibraryWidget::localLibraryWidget(QWidget *parent) :
|
||||||
stdIconWidthDivider = 8.7;
|
stdIconWidthDivider = 8.7;
|
||||||
stdIconHeightDivider = 8.7;
|
stdIconHeightDivider = 8.7;
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
stdIconWidthDivider = 8.1;
|
stdIconWidthDivider = 8.1;
|
||||||
stdIconHeightDivider = 8.1;
|
stdIconHeightDivider = 8.1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,6 +172,9 @@ int main(int argc, char *argv[])
|
||||||
else if(global::deviceID == "n306\n") {
|
else if(global::deviceID == "n306\n") {
|
||||||
global::isN306 = true;
|
global::isN306 = true;
|
||||||
}
|
}
|
||||||
|
else if(global::deviceID == "n249\n") {
|
||||||
|
global::isN249 = true;
|
||||||
|
}
|
||||||
else if(global::deviceID == "kt\n") {
|
else if(global::deviceID == "kt\n") {
|
||||||
global::isKT = true;
|
global::isKT = true;
|
||||||
}
|
}
|
||||||
|
@ -219,6 +222,9 @@ int main(int argc, char *argv[])
|
||||||
else if(global::deviceID == "n306\n") {
|
else if(global::deviceID == "n306\n") {
|
||||||
global::isN306 = true;
|
global::isN306 = true;
|
||||||
}
|
}
|
||||||
|
else if(global::deviceID == "n249\n") {
|
||||||
|
global::isN249 = true;
|
||||||
|
}
|
||||||
else if(global::deviceID == "kt\n") {
|
else if(global::deviceID == "kt\n") {
|
||||||
global::isKT = true;
|
global::isKT = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,7 +252,7 @@ reader::reader(QWidget *parent) :
|
||||||
ui->fontChooser->setCurrentText(global::reader::font);
|
ui->fontChooser->setCurrentText(global::reader::font);
|
||||||
}
|
}
|
||||||
// Night mode
|
// Night mode
|
||||||
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n") {
|
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n249\n" or global::deviceID == "n306\n") {
|
||||||
if(checkconfig(".config/10-dark_mode/config") == true) {
|
if(checkconfig(".config/10-dark_mode/config") == true) {
|
||||||
log("Setting night mode to ON", className);
|
log("Setting night mode to ON", className);
|
||||||
writeFile("/tmp/invertScreen", "y");
|
writeFile("/tmp/invertScreen", "y");
|
||||||
|
@ -281,7 +281,7 @@ reader::reader(QWidget *parent) :
|
||||||
ui->previousBtn->setStyleSheet("padding: 13.5px");
|
ui->previousBtn->setStyleSheet("padding: 13.5px");
|
||||||
ui->optionsBtn->setStyleSheet("padding: 13.5px");
|
ui->optionsBtn->setStyleSheet("padding: 13.5px");
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
ui->nextBtn->setStyleSheet("padding: 12.5px");
|
ui->nextBtn->setStyleSheet("padding: 12.5px");
|
||||||
ui->previousBtn->setStyleSheet("padding: 12.5px");
|
ui->previousBtn->setStyleSheet("padding: 12.5px");
|
||||||
ui->optionsBtn->setStyleSheet("padding: 12.5px");
|
ui->optionsBtn->setStyleSheet("padding: 12.5px");
|
||||||
|
@ -343,7 +343,7 @@ reader::reader(QWidget *parent) :
|
||||||
if(checkconfig("/opt/inkbox_genuine") == true) {
|
if(checkconfig("/opt/inkbox_genuine") == true) {
|
||||||
float stdIconWidth;
|
float stdIconWidth;
|
||||||
float stdIconHeight;
|
float stdIconHeight;
|
||||||
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") {
|
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") {
|
||||||
stdIconWidth = sW / 16;
|
stdIconWidth = sW / 16;
|
||||||
stdIconHeight = sW / 16;
|
stdIconHeight = sW / 16;
|
||||||
}
|
}
|
||||||
|
@ -535,7 +535,7 @@ reader::reader(QWidget *parent) :
|
||||||
if(global::deviceID == "n705\n") {
|
if(global::deviceID == "n705\n") {
|
||||||
infoLabelDefinedLength = 35;
|
infoLabelDefinedLength = 35;
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") {
|
||||||
infoLabelDefinedLength = 50;
|
infoLabelDefinedLength = 50;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -563,7 +563,7 @@ reader::reader(QWidget *parent) :
|
||||||
if(global::deviceID == "n705\n") {
|
if(global::deviceID == "n705\n") {
|
||||||
infoLabelDefinedLength = 35;
|
infoLabelDefinedLength = 35;
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") {
|
||||||
infoLabelDefinedLength = 50;
|
infoLabelDefinedLength = 50;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1122,7 +1122,7 @@ void reader::on_optionsBtn_clicked()
|
||||||
if(global::deviceID == "n873\n") {
|
if(global::deviceID == "n873\n") {
|
||||||
ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 13.5px");
|
ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 13.5px");
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 12.5px");
|
ui->optionsBtn->setStyleSheet("background: white; color: black; padding: 12.5px");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1130,7 +1130,7 @@ void reader::on_optionsBtn_clicked()
|
||||||
}
|
}
|
||||||
ui->optionsBtn->setIcon(QIcon(":/resources/settings.png"));
|
ui->optionsBtn->setIcon(QIcon(":/resources/settings.png"));
|
||||||
// The Glo HD (N437) has a newer platform plugin that doesn't need this
|
// The Glo HD (N437) has a newer platform plugin that doesn't need this
|
||||||
if(global::deviceID != "n437\n") {
|
if(global::deviceID != "n437\n" or global::deviceID != "n306\n" or global::deviceID != "n249\n") {
|
||||||
QTimer::singleShot(500, this, SLOT(repaint()));
|
QTimer::singleShot(500, this, SLOT(repaint()));
|
||||||
}
|
}
|
||||||
menubar_shown = false;
|
menubar_shown = false;
|
||||||
|
@ -1140,7 +1140,7 @@ void reader::on_optionsBtn_clicked()
|
||||||
if(global::deviceID == "n873\n") {
|
if(global::deviceID == "n873\n") {
|
||||||
ui->optionsBtn->setStyleSheet("background: black; color: white; padding: 13.5px");
|
ui->optionsBtn->setStyleSheet("background: black; color: white; padding: 13.5px");
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
ui->optionsBtn->setStyleSheet("background: black; color: white; padding: 12.5px");
|
ui->optionsBtn->setStyleSheet("background: black; color: white; padding: 12.5px");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -48,7 +48,7 @@ koboxSettings::koboxSettings(QWidget *parent) :
|
||||||
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
||||||
dpiSetting = "175";
|
dpiSetting = "175";
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
dpiSetting = "225";
|
dpiSetting = "225";
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n873\n") {
|
else if(global::deviceID == "n873\n") {
|
||||||
|
|
|
@ -106,7 +106,7 @@ settings::settings(QWidget *parent) :
|
||||||
ui->quoteCheckBox->click();
|
ui->quoteCheckBox->click();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n") {
|
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "n249\n") {
|
||||||
if(checkconfig(".config/10-dark_mode/config") == true) {
|
if(checkconfig(".config/10-dark_mode/config") == true) {
|
||||||
ui->darkModeCheckBox->click();
|
ui->darkModeCheckBox->click();
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ settings::settings(QWidget *parent) :
|
||||||
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
||||||
writeFile(".config/09-dpi/config", "195");
|
writeFile(".config/09-dpi/config", "195");
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
writeFile(".config/09-dpi/config", "275");
|
writeFile(".config/09-dpi/config", "275");
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n873\n") {
|
else if(global::deviceID == "n873\n") {
|
||||||
|
@ -248,7 +248,7 @@ settings::settings(QWidget *parent) :
|
||||||
ui->uiScalingSlider->setValue(3);
|
ui->uiScalingSlider->setValue(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
if(dpi_number == 275) {
|
if(dpi_number == 275) {
|
||||||
ui->uiScalingSlider->setValue(0);
|
ui->uiScalingSlider->setValue(0);
|
||||||
}
|
}
|
||||||
|
@ -672,7 +672,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
|
||||||
if(global::deviceID == "n306\n") {
|
if(global::deviceID == "n306\n") {
|
||||||
writeFile(".config/09-dpi/config", "212");
|
writeFile(".config/09-dpi/config", "212");
|
||||||
}
|
}
|
||||||
if(global::deviceID == "n437\n") {
|
if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
writeFile(".config/09-dpi/config", "275");
|
writeFile(".config/09-dpi/config", "275");
|
||||||
}
|
}
|
||||||
if(global::deviceID == "n873\n") {
|
if(global::deviceID == "n873\n") {
|
||||||
|
@ -692,7 +692,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
|
||||||
if(global::deviceID == "n306\n") {
|
if(global::deviceID == "n306\n") {
|
||||||
writeFile(".config/09-dpi/config", "227");
|
writeFile(".config/09-dpi/config", "227");
|
||||||
}
|
}
|
||||||
if(global::deviceID == "n437\n") {
|
if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
writeFile(".config/09-dpi/config", "290");
|
writeFile(".config/09-dpi/config", "290");
|
||||||
}
|
}
|
||||||
if(global::deviceID == "n873\n") {
|
if(global::deviceID == "n873\n") {
|
||||||
|
@ -712,7 +712,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
|
||||||
if(global::deviceID == "n306\n") {
|
if(global::deviceID == "n306\n") {
|
||||||
writeFile(".config/09-dpi/config", "242");
|
writeFile(".config/09-dpi/config", "242");
|
||||||
}
|
}
|
||||||
if(global::deviceID == "n437\n") {
|
if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
writeFile(".config/09-dpi/config", "305");
|
writeFile(".config/09-dpi/config", "305");
|
||||||
}
|
}
|
||||||
if(global::deviceID == "n873\n") {
|
if(global::deviceID == "n873\n") {
|
||||||
|
|
|
@ -36,7 +36,7 @@ brightnessDialog::brightnessDialog(QWidget *parent) :
|
||||||
ui->valueLabel->setStyleSheet("font-size: 9pt");
|
ui->valueLabel->setStyleSheet("font-size: 9pt");
|
||||||
ui->warmthValueLabel->setStyleSheet("font-size: 9pt");
|
ui->warmthValueLabel->setStyleSheet("font-size: 9pt");
|
||||||
|
|
||||||
if(global::isN705 == true or global::isN905C == true or global::isN613 == true or global::isKT == true) {
|
if(global::isN249 == false and global::isN873 == false) {
|
||||||
ui->warmthSlider->hide();
|
ui->warmthSlider->hide();
|
||||||
ui->warmthDecBtn->hide();
|
ui->warmthDecBtn->hide();
|
||||||
ui->warmthIncBtn->hide();
|
ui->warmthIncBtn->hide();
|
||||||
|
@ -48,7 +48,7 @@ brightnessDialog::brightnessDialog(QWidget *parent) :
|
||||||
ui->warmthValueLabel->deleteLater();
|
ui->warmthValueLabel->deleteLater();
|
||||||
this->adjustSize();
|
this->adjustSize();
|
||||||
}
|
}
|
||||||
else if (global::isN873 == true){
|
else if(global::isN249 == true or global::isN873 == true) {
|
||||||
ui->warmthDecBtn->setProperty("type", "borderless");
|
ui->warmthDecBtn->setProperty("type", "borderless");
|
||||||
ui->warmthIncBtn->setProperty("type", "borderless");
|
ui->warmthIncBtn->setProperty("type", "borderless");
|
||||||
ui->warmthDecBtn->setText("");
|
ui->warmthDecBtn->setText("");
|
||||||
|
@ -69,16 +69,33 @@ brightnessDialog::brightnessDialog(QWidget *parent) :
|
||||||
this->adjustSize();
|
this->adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
// I know, Mini and Touch don't have frontlights but that's a template to include others later...
|
|
||||||
int value;
|
int value;
|
||||||
int warmthValue;
|
int warmthValue;
|
||||||
if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
|
if(global::isN249 == true or global::isN873 == true) {
|
||||||
|
if(global::isN249 == true) {
|
||||||
|
ui->warmthSlider->setMaximum(100);
|
||||||
|
}
|
||||||
|
else if(global::isN873 == true) {
|
||||||
|
ui->warmthSlider->setMaximum(10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(global::isN249 or global::isN873 == true) {
|
||||||
value = getBrightness();
|
value = getBrightness();
|
||||||
if(global::isN873 == true) {
|
if(global::isN249 == true or global::isN873 == true) {
|
||||||
warmthValue = getWarmth();
|
warmthValue = getWarmth();
|
||||||
|
if(warmthValue == 0) {
|
||||||
|
if(global::isN249 == true) {
|
||||||
|
ui->warmthValueLabel->setText("0%");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->warmthValueLabel->setText("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
ui->warmthSlider->setValue(warmthValue);
|
ui->warmthSlider->setValue(warmthValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if(global::isN613 == true) {
|
else if(global::isN613 == true) {
|
||||||
setDefaultWorkDir();
|
setDefaultWorkDir();
|
||||||
value = brightnessCheckconfig(".config/03-brightness/config");
|
value = brightnessCheckconfig(".config/03-brightness/config");
|
||||||
|
@ -94,17 +111,11 @@ brightnessDialog::brightnessDialog(QWidget *parent) :
|
||||||
QString valueStr = QString::number(value);
|
QString valueStr = QString::number(value);
|
||||||
valueStr = valueStr.append("%");
|
valueStr = valueStr.append("%");
|
||||||
ui->valueLabel->setText(valueStr);
|
ui->valueLabel->setText(valueStr);
|
||||||
// Warmth value label
|
|
||||||
if(global::isN873 == true) {
|
|
||||||
warmthValue = getWarmth();
|
|
||||||
QString warmthValueStr = QString::number(warmthValue);
|
|
||||||
ui->warmthValueLabel->setText(warmthValueStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Saving current brightness value in case we want to go backwards
|
// Saving current brightness value in case we want to go backwards
|
||||||
if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
|
if(global::isN249 == true or global::isN873 == true) {
|
||||||
oldValue = getBrightness();
|
oldValue = getBrightness();
|
||||||
if(global::isN873 == true) {
|
if(global::isN249 == true or global::isN873 == true) {
|
||||||
oldWarmthValue = getWarmth();
|
oldWarmthValue = getWarmth();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,13 +137,13 @@ void brightnessDialog::on_quitBtn_clicked()
|
||||||
{
|
{
|
||||||
// Reverting back to the old value
|
// Reverting back to the old value
|
||||||
brightnessDialog::preSetBrightness(oldValue);
|
brightnessDialog::preSetBrightness(oldValue);
|
||||||
if(global::isN873 == true) {
|
if(global::isN249 == true or global::isN873 == true) {
|
||||||
setWarmth(oldWarmthValue);
|
setWarmth(oldWarmthValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Just in case ;)
|
// Just in case ;)
|
||||||
brightnessWriteconfig(oldValue);
|
brightnessWriteconfig(oldValue);
|
||||||
if(global::isN873 == true) {
|
if(global::isN249 == true or global::isN873 == true) {
|
||||||
warmthWriteconfig(oldWarmthValue);
|
warmthWriteconfig(oldWarmthValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +182,7 @@ void brightnessDialog::on_okBtn_clicked()
|
||||||
// Write brightness config
|
// Write brightness config
|
||||||
log("Display brightness set to " + QString::number(brightnessValue), className);
|
log("Display brightness set to " + QString::number(brightnessValue), className);
|
||||||
brightnessWriteconfig(brightnessValue);
|
brightnessWriteconfig(brightnessValue);
|
||||||
if(global::isN873 == true) {
|
if(global::isN249 == true or global::isN873 == true) {
|
||||||
warmthValue = ui->warmthSlider->value();
|
warmthValue = ui->warmthSlider->value();
|
||||||
log("Display warmth set to " + QString::number(warmthValue), className);
|
log("Display warmth set to " + QString::number(warmthValue), className);
|
||||||
warmthWriteconfig(warmthValue);
|
warmthWriteconfig(warmthValue);
|
||||||
|
@ -182,10 +193,7 @@ void brightnessDialog::on_okBtn_clicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
void brightnessDialog::preSetBrightness(int brightnessValue) {
|
void brightnessDialog::preSetBrightness(int brightnessValue) {
|
||||||
if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
|
if(global::isN613 == true) {
|
||||||
setBrightness(brightnessValue);
|
|
||||||
}
|
|
||||||
else if(global::isN613 == true) {
|
|
||||||
setBrightness_ntxio(brightnessValue);
|
setBrightness_ntxio(brightnessValue);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -197,6 +205,9 @@ void brightnessDialog::on_warmthSlider_valueChanged(int value)
|
||||||
{
|
{
|
||||||
setWarmth(value);
|
setWarmth(value);
|
||||||
QString valueStr = QString::number(value);
|
QString valueStr = QString::number(value);
|
||||||
|
if(global::isN249 == true) {
|
||||||
|
valueStr = valueStr + "%";
|
||||||
|
}
|
||||||
ui->warmthValueLabel->setText(valueStr);
|
ui->warmthValueLabel->setText(valueStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
||||||
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
||||||
dpiSetting = "175";
|
dpiSetting = "175";
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
dpiSetting = "225";
|
dpiSetting = "225";
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n873\n") {
|
else if(global::deviceID == "n873\n") {
|
||||||
|
@ -130,7 +130,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
||||||
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n" or global::deviceID == "emu\n") {
|
||||||
dpiSetting = "225";
|
dpiSetting = "225";
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
dpiSetting = "275";
|
dpiSetting = "275";
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n873\n") {
|
else if(global::deviceID == "n873\n") {
|
||||||
|
|
|
@ -25,7 +25,7 @@ egg::egg(QWidget *parent) :
|
||||||
ui->nextBtn->setStyleSheet("padding: 13.5px");
|
ui->nextBtn->setStyleSheet("padding: 13.5px");
|
||||||
ui->previousBtn->setStyleSheet("padding: 13.5px");
|
ui->previousBtn->setStyleSheet("padding: 13.5px");
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
ui->nextBtn->setStyleSheet("padding: 12.5px");
|
ui->nextBtn->setStyleSheet("padding: 12.5px");
|
||||||
ui->previousBtn->setStyleSheet("padding: 12.5px");
|
ui->previousBtn->setStyleSheet("padding: 12.5px");
|
||||||
}
|
}
|
||||||
|
@ -49,10 +49,8 @@ void egg::changeIndex(int index) {
|
||||||
/*
|
/*
|
||||||
Contributors list:
|
Contributors list:
|
||||||
Szybet (0)
|
Szybet (0)
|
||||||
NiLuJe (1)
|
|
||||||
akemnade (2)
|
|
||||||
Maintainer:
|
Maintainer:
|
||||||
tux-linux (3)
|
tux-linux (1)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Contributor name
|
// Contributor name
|
||||||
|
|
|
@ -26,7 +26,7 @@ virtualkeyboard::virtualkeyboard(QWidget *parent) :
|
||||||
if(global::deviceID == "n873\n") {
|
if(global::deviceID == "n873\n") {
|
||||||
padding = 27;
|
padding = 27;
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
padding = 20;
|
padding = 20;
|
||||||
}
|
}
|
||||||
ui->closeBtn->setStyleSheet("font-weight: bold; font-size: 9pt; padding: " + QString::number(padding) + "px");
|
ui->closeBtn->setStyleSheet("font-weight: bold; font-size: 9pt; padding: " + QString::number(padding) + "px");
|
||||||
|
@ -136,7 +136,7 @@ virtualkeyboard::virtualkeyboard(QWidget *parent) :
|
||||||
ui->sat->setStyleSheet("font-weight: bold; font-size: 7pt; padding: 27px");
|
ui->sat->setStyleSheet("font-weight: bold; font-size: 7pt; padding: 27px");
|
||||||
ui->spaceBtn->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 15px; border: 1px solid black");
|
ui->spaceBtn->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 15px; border: 1px solid black");
|
||||||
}
|
}
|
||||||
else if(global::deviceID == "n437\n") {
|
else if(global::deviceID == "n437\n" or global::deviceID == "n249\n") {
|
||||||
ui->n1->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 20px");
|
ui->n1->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 20px");
|
||||||
ui->n2->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 20px");
|
ui->n2->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 20px");
|
||||||
ui->n3->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 20px");
|
ui->n3->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 20px");
|
||||||
|
|
Loading…
Reference in a new issue