mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 23:57:22 -08:00
N236 support
This commit is contained in:
parent
e1c788d5d9
commit
48f97fa5e6
9 changed files with 48 additions and 20 deletions
|
@ -117,6 +117,7 @@ namespace global {
|
|||
inline bool isN905C;
|
||||
inline bool isN613;
|
||||
inline bool isN873;
|
||||
inline bool isN236;
|
||||
inline bool runningInstanceIsReaderOnly;
|
||||
}
|
||||
|
||||
|
@ -537,7 +538,7 @@ namespace {
|
|||
defaultEpubPageHeight = 425;
|
||||
defaultEpubPageWidth = 425;
|
||||
}
|
||||
if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "emu\n") {
|
||||
if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n" or checkconfig_str_val == "emu\n") {
|
||||
defaultEpubPageHeight = 450;
|
||||
defaultEpubPageWidth = 450;
|
||||
}
|
||||
|
@ -552,7 +553,7 @@ namespace {
|
|||
defaultPdfPageHeight = 750;
|
||||
defaultPdfPageWidth = 550;
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "emu\n") {
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n" or checkconfig_str_val == "emu\n") {
|
||||
defaultPdfPageHeight = 974;
|
||||
defaultPdfPageWidth = 708;
|
||||
}
|
||||
|
@ -565,7 +566,7 @@ namespace {
|
|||
void pre_set_brightness(int brightnessValue) {
|
||||
string_checkconfig_ro("/opt/inkbox_device");
|
||||
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n" or checkconfig_str_val == "n873\n" or checkconfig_str_val == "n236\n") {
|
||||
set_brightness(brightnessValue);
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
|
|
|
@ -101,7 +101,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
|||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||
dpiSetting = "125";
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
dpiSetting = "175";
|
||||
}
|
||||
else if(checkconfig_str_val == "n873\n") {
|
||||
|
@ -131,8 +131,9 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
|||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||
dpiSetting = "175";
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n")
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
dpiSetting = "225";
|
||||
}
|
||||
else if(checkconfig_str_val == "n873\n") {
|
||||
dpiSetting = "300";
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ koboxSettings::koboxSettings(QWidget *parent) :
|
|||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||
dpiSetting = "125";
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
dpiSetting = "175";
|
||||
}
|
||||
else if(checkconfig_str_val == "n873\n") {
|
||||
|
|
|
@ -207,6 +207,7 @@ void libraryWidget::syncCatalog() {
|
|||
qDebug() << "Gutenberg sync encountered an error";
|
||||
toastWindow->close();
|
||||
showToast("Error");
|
||||
QFile::remove("/external_root/opt/storage/gutenberg/last_sync");
|
||||
QTimer::singleShot(5000, this, SLOT(close()));
|
||||
}
|
||||
QFile::remove("/inkbox/gutenbergSyncDone");
|
||||
|
|
25
main.cpp
25
main.cpp
|
@ -103,24 +103,35 @@ int main(int argc, char *argv[])
|
|||
global::isN905C = false;
|
||||
global::isN613 = false;
|
||||
global::isN873 = false;
|
||||
global::isN236 = false;
|
||||
}
|
||||
else if(checkconfig_str_val == "n905\n") {
|
||||
global::isN705 = false;
|
||||
global::isN905C = true;
|
||||
global::isN613 = false;
|
||||
global::isN873 = false;
|
||||
global::isN236 = false;
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
global::isN705 = false;
|
||||
global::isN905C = false;
|
||||
global::isN613 = true;
|
||||
global::isN873 = false;
|
||||
global::isN236 = false;
|
||||
}
|
||||
else if(checkconfig_str_val == "n873\n") {
|
||||
global::isN705 = false;
|
||||
global::isN905C = false;
|
||||
global::isN613 = false;
|
||||
global::isN873 = true;
|
||||
global::isN236 = false;
|
||||
}
|
||||
else if(checkconfig_str_val == "n236\n") {
|
||||
global::isN705 = false;
|
||||
global::isN905C = false;
|
||||
global::isN613 = false;
|
||||
global::isN873 = false;
|
||||
global::isN236 = true;
|
||||
}
|
||||
else {
|
||||
;
|
||||
|
@ -157,22 +168,36 @@ int main(int argc, char *argv[])
|
|||
global::isN705 = true;
|
||||
global::isN905C = false;
|
||||
global::isN613 = false;
|
||||
global::isN873 = false;
|
||||
global::isN236 = false;
|
||||
}
|
||||
else if(checkconfig_str_val == "n905\n") {
|
||||
global::isN705 = false;
|
||||
global::isN905C = true;
|
||||
global::isN613 = false;
|
||||
global::isN873 = false;
|
||||
global::isN236 = false;
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
global::isN705 = false;
|
||||
global::isN905C = false;
|
||||
global::isN613 = true;
|
||||
global::isN873 = false;
|
||||
global::isN236 = false;
|
||||
}
|
||||
else if(checkconfig_str_val == "n873\n") {
|
||||
global::isN705 = false;
|
||||
global::isN905C = false;
|
||||
global::isN613 = false;
|
||||
global::isN873 = true;
|
||||
global::isN236 = false;
|
||||
}
|
||||
else if(checkconfig_str_val == "n236\n") {
|
||||
global::isN705 = false;
|
||||
global::isN905C = false;
|
||||
global::isN613 = false;
|
||||
global::isN873 = false;
|
||||
global::isN236 = true;
|
||||
}
|
||||
else {
|
||||
;
|
||||
|
|
|
@ -89,7 +89,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
wifiIconWidth = sW / 22.5;
|
||||
wifiIconHeight = sH / 22.5;
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "emu\n") {
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n" or checkconfig_str_val == "emu\n") {
|
||||
stdIconWidth = sW / 12.5;
|
||||
stdIconHeight = sH / 12.5;
|
||||
brightnessIconWidth = sW / 24.5;
|
||||
|
@ -157,7 +157,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||
ui->batteryIcon->setStyleSheet("font-size: 5pt; padding-bottom: 0px; padding-top: 0px; padding-left: 1px; padding-right: 1px;");
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n" or checkconfig_str_val == "emu\n") {
|
||||
ui->batteryIcon->setStyleSheet("font-size: 5pt; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px;");
|
||||
}
|
||||
else if(checkconfig_str_val == "n873\n") {
|
||||
|
@ -768,8 +768,8 @@ void MainWindow::resetIcons() {
|
|||
void MainWindow::setBatteryIcon() {
|
||||
// Battery
|
||||
string_checkconfig_ro("/opt/inkbox_device");
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n" or checkconfig_str_val == "n873\n") {
|
||||
// Hide brightness controls; they won't be very useful there anyway (for anything but the Glo) ...
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n" or checkconfig_str_val == "n873\n" or checkconfig_str_val == "n236\n") {
|
||||
// Hide brightness controls; they won't be very useful there anyway (for anything but the Glo/Libra/Aura 2) ...
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
|
||||
ui->brightnessBtn->hide();
|
||||
ui->line_7->hide();
|
||||
|
@ -1093,7 +1093,7 @@ void MainWindow::setRecentBooksLabelsTruncateTreshold() {
|
|||
if(readFile("/opt/inkbox_device") == "n705\n" or readFile("/opt/inkbox_device") == "n905b\n" or readFile("/opt/inkbox_device") == "n905c\n") {
|
||||
truncateTreshold = 12;
|
||||
}
|
||||
else if(readFile("/opt/inkbox_device") == "n613\n" or readFile("/opt/inkbox_device") == "n873\n"){
|
||||
else if(readFile("/opt/inkbox_device") == "n613\n" or readFile("/opt/inkbox_device") == "n873\n" or readFile("/opt/inkbox_device") == "n236\n"){
|
||||
truncateTreshold = 20;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -242,7 +242,7 @@ reader::reader(QWidget *parent) :
|
|||
}
|
||||
// Night mode
|
||||
string_checkconfig_ro("/opt/inkbox_device");
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n") {
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
if(checkconfig(".config/10-dark_mode/config") == true) {
|
||||
string_writeconfig("/tmp/invertScreen", "y");
|
||||
ui->nightModeBtn->setText("");
|
||||
|
@ -322,7 +322,7 @@ reader::reader(QWidget *parent) :
|
|||
// Defining what the icons' size will be
|
||||
if(checkconfig("/opt/inkbox_genuine") == true) {
|
||||
string_checkconfig_ro("/opt/inkbox_device");
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n" or checkconfig_str_val == "emu\n") {
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n" or checkconfig_str_val == "emu\n") {
|
||||
float stdIconWidth = sW / 16;
|
||||
float stdIconHeight = sW / 16;
|
||||
QPixmap chargingPixmap(":/resources/battery_charging.png");
|
||||
|
|
12
settings.cpp
12
settings.cpp
|
@ -87,7 +87,7 @@ settings::settings(QWidget *parent) :
|
|||
}
|
||||
|
||||
string_checkconfig_ro("/opt/inkbox_device");
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n") {
|
||||
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n" or checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
if(checkconfig(".config/10-dark_mode/config") == true) {
|
||||
ui->darkModeCheckBox->click();
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ settings::settings(QWidget *parent) :
|
|||
ui->uiScalingSlider->setValue(2);
|
||||
}
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
if(dpi_number == 195) {
|
||||
ui->uiScalingSlider->setValue(0);
|
||||
}
|
||||
|
@ -572,7 +572,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
|
|||
if(checkconfig_str_val == "n905\n") {
|
||||
string_writeconfig(".config/09-dpi/config", "160");
|
||||
}
|
||||
if(checkconfig_str_val == "n613\n") {
|
||||
if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
string_writeconfig(".config/09-dpi/config", "195");
|
||||
}
|
||||
if(checkconfig_str_val == "n873\n") {
|
||||
|
@ -587,7 +587,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
|
|||
if(checkconfig_str_val == "n905\n") {
|
||||
string_writeconfig(".config/09-dpi/config", "187");
|
||||
}
|
||||
if(checkconfig_str_val == "n613\n") {
|
||||
if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
string_writeconfig(".config/09-dpi/config", "210");
|
||||
}
|
||||
if(checkconfig_str_val == "n873\n") {
|
||||
|
@ -602,7 +602,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
|
|||
if(checkconfig_str_val == "n905\n") {
|
||||
string_writeconfig(".config/09-dpi/config", "200");
|
||||
}
|
||||
if(checkconfig_str_val == "n613\n") {
|
||||
if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
string_writeconfig(".config/09-dpi/config", "225");
|
||||
}
|
||||
if(checkconfig_str_val == "n873\n") {
|
||||
|
@ -706,7 +706,7 @@ void settings::on_enableUiScalingCheckBox_toggled(bool checked)
|
|||
else if(checkconfig_str_val == "n905\n") {
|
||||
string_writeconfig(".config/09-dpi/config", "160");
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
string_writeconfig(".config/09-dpi/config", "195");
|
||||
}
|
||||
else if(checkconfig_str_val == "n873\n") {
|
||||
|
|
|
@ -46,7 +46,7 @@ settingsChooser::settingsChooser(QWidget *parent) :
|
|||
ui->inkboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
|
||||
ui->koboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
|
||||
}
|
||||
else if(checkconfig_str_val == "n613\n") {
|
||||
else if(checkconfig_str_val == "n613\n" or checkconfig_str_val == "n236\n") {
|
||||
ui->inkboxSettingsBtn->setStyleSheet("padding: 25px; Text-align: left");
|
||||
ui->koboxSettingsBtn->setStyleSheet("padding:25px; Text-align: left");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue