N249: Brightness fixes

This commit is contained in:
Nicolas Mailloux 2023-07-20 15:11:12 -04:00
parent 7daf01c951
commit cf4fb0ff2a
12 changed files with 104 additions and 67 deletions

View file

@ -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,11 +294,21 @@ namespace {
return 0; return 0;
} }
void setBrightness(int value) { void setBrightness(int value) {
if(QFile::exists("/var/run/brightness")) { if(global::deviceID == "n249\n") {
std::ofstream fhandler; if(QFile::exists("/var/run/brightness_write")) {
fhandler.open("/var/run/brightness"); std::ofstream fhandler;
fhandler << value; fhandler.open("/var/run/brightness_write");
fhandler.close(); fhandler << value;
fhandler.close();
}
}
else {
if(QFile::exists("/var/run/brightness")) {
std::ofstream fhandler;
fhandler.open("/var/run/brightness");
fhandler << value;
fhandler.close();
}
} }
} }
void setBrightness_ntxio(int value) { void setBrightness_ntxio(int value) {
@ -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();
warmthValue = 10 - warmthValue; if (global::deviceID == "n873\n") {
warmthValue = 10 - warmthValue;
}
return warmthValue; return warmthValue;
} }
void setWarmth(int warmthValue) { void setWarmth(int warmthValue) {
// Value 0 gives a warmer lighting than value 10
warmthValue = 10 - warmthValue;
QString warmthValueStr = QString::number(warmthValue);
QString sysfsWarmthPath; QString sysfsWarmthPath;
QString warmthValueStr;
if(global::deviceID == "n873\n") { if(global::deviceID == "n873\n") {
// Value 0 gives a warmer lighting than value 10
warmthValue = 10 - warmthValue;
warmthValueStr = QString::number(warmthValue);
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 {

View file

@ -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;

View file

@ -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();

View file

@ -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;
} }

View file

@ -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;
} }
@ -216,9 +219,12 @@ int main(int argc, char *argv[])
else if(global::deviceID == "n437\n") { else if(global::deviceID == "n437\n") {
global::isN437 = true; global::isN437 = true;
} }
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;
} }

View file

@ -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 {

View file

@ -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") {

View file

@ -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") {

View file

@ -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,14 +69,31 @@ 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();
ui->warmthSlider->setValue(warmthValue); if(warmthValue == 0) {
if(global::isN249 == true) {
ui->warmthValueLabel->setText("0%");
}
else {
ui->warmthValueLabel->setText("0");
}
}
else {
ui->warmthSlider->setValue(warmthValue);
}
} }
} }
else if(global::isN613 == true) { else if(global::isN613 == true) {
@ -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);
} }

View file

@ -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") {

View file

@ -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

View file

@ -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");