Kindle Touch (KT) support

This commit is contained in:
Nicolas Mailloux 2022-05-22 15:38:02 -04:00
parent c328761bc5
commit 04ef2d132c
11 changed files with 64 additions and 137 deletions

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) { if(global::isN705 == true or global::isN905C == true or global::isN613 == true or global::isKT == true) {
ui->warmthSlider->hide(); ui->warmthSlider->hide();
ui->warmthDecBtn->hide(); ui->warmthDecBtn->hide();
ui->warmthIncBtn->hide(); ui->warmthIncBtn->hide();
@ -72,7 +72,7 @@ brightnessDialog::brightnessDialog(QWidget *parent) :
// I know, Mini and Touch don't have frontlights but that's a template to include others later... // 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::isN873 == true) { if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
value = get_brightness(); value = get_brightness();
if(global::isN873 == true) { if(global::isN873 == true) {
warmthValue = get_warmth(); warmthValue = get_warmth();
@ -109,7 +109,7 @@ brightnessDialog::brightnessDialog(QWidget *parent) :
ui->brightnessLabel->setFont(QFont(crimson_bold)); ui->brightnessLabel->setFont(QFont(crimson_bold));
// 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::isN873 == true) { if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
oldValue = get_brightness(); oldValue = get_brightness();
if(global::isN873 == true) { if(global::isN873 == true) {
oldWarmthValue = get_warmth(); oldWarmthValue = get_warmth();
@ -189,7 +189,7 @@ void brightnessDialog::on_okBtn_clicked()
} }
void brightnessDialog::pre_set_brightness(int brightnessValue) { void brightnessDialog::pre_set_brightness(int brightnessValue) {
if(global::isN705 == true or global::isN905C == true or global::isN873 == true) { if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
set_brightness(brightnessValue); set_brightness(brightnessValue);
} }
else if(global::isN613 == true) { else if(global::isN613 == true) {

View file

@ -124,13 +124,14 @@ namespace global {
} }
inline QString systemInfoText; inline QString systemInfoText;
inline bool forbidOpenSearchDialog; inline bool forbidOpenSearchDialog;
inline bool isN705; inline bool isN705 = false;
inline bool isN905C; inline bool isN905C = false;
inline bool isN613; inline bool isN613 = false;
inline bool isN873; inline bool isN873 = false;
inline bool isN236; inline bool isN236 = false;
inline bool isN437; inline bool isN437 = false;
inline bool isN306; inline bool isN306 = false;
inline bool isKT = false;
inline bool runningInstanceIsReaderOnly; inline bool runningInstanceIsReaderOnly;
inline QString deviceID; inline QString deviceID;
} }
@ -584,7 +585,7 @@ namespace {
defaultEpubPageHeight = 365; defaultEpubPageHeight = 365;
defaultEpubPageWidth = 365; defaultEpubPageWidth = 365;
} }
else if(global::deviceID == "n905\n") { else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
defaultEpubPageHeight = 425; defaultEpubPageHeight = 425;
defaultEpubPageWidth = 425; defaultEpubPageWidth = 425;
} }
@ -601,7 +602,7 @@ namespace {
log(function + ": Defined default ePUB page width to " + QString::number(defaultEpubPageWidth), "functions"); log(function + ": Defined default ePUB page width to " + QString::number(defaultEpubPageWidth), "functions");
} }
else if(fileType == 1) { else if(fileType == 1) {
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
if(global::reader::pdfOrientation == 0) { if(global::reader::pdfOrientation == 0) {
defaultPdfPageHeight = 750; defaultPdfPageHeight = 750;
defaultPdfPageWidth = 550; defaultPdfPageWidth = 550;
@ -647,7 +648,7 @@ namespace {
} }
} }
void pre_set_brightness(int brightnessValue) { void pre_set_brightness(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") { 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") {
set_brightness(brightnessValue); set_brightness(brightnessValue);
} }
else if(global::deviceID == "n613\n") { else if(global::deviceID == "n613\n") {
@ -663,7 +664,7 @@ namespace {
* 1: Bring DOWN brightness * 1: Bring DOWN brightness
* 2: Auto; smooth brightness transition between two brightness levels * 2: Auto; smooth brightness transition between two brightness levels
*/ */
if(global::deviceID != "n705\n" && global::deviceID != "n905\n") { if(global::deviceID != "n705\n" && global::deviceID != "n905\n" && global::deviceID != "kt\n") {
QString function = __func__; log(function + ": Setting brightness to " + QString::number(value), "functions"); QString function = __func__; log(function + ": Setting brightness to " + QString::number(value), "functions");
} }
if(mode == 0) { if(mode == 0) {
@ -766,6 +767,7 @@ namespace {
return checkconfig("/external_root/run/encfs_mounted"); return checkconfig("/external_root/run/encfs_mounted");
} }
bool isUsbPluggedIn() { bool isUsbPluggedIn() {
if(global::deviceID != "kt\n") {
// Thanks to https://github.com/koreader/KoboUSBMS/blob/2efdf9d920c68752b2933f21c664dc1afb28fc2e/usbms.c#L148-L158 // Thanks to https://github.com/koreader/KoboUSBMS/blob/2efdf9d920c68752b2933f21c664dc1afb28fc2e/usbms.c#L148-L158
int ntxfd; int ntxfd;
if((ntxfd = open("/dev/ntx_io", O_RDWR)) == -1) { if((ntxfd = open("/dev/ntx_io", O_RDWR)) == -1) {
@ -776,6 +778,7 @@ namespace {
close(ntxfd); close(ntxfd);
return !!ptr; return !!ptr;
} }
}
int testPing(bool blocking) { int testPing(bool blocking) {
QProcess *pingProcess = new QProcess(); QProcess *pingProcess = new QProcess();
if(blocking == true) { if(blocking == true) {

View file

@ -97,7 +97,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
// DPI setting // DPI setting
string_checkconfig(".config/00-kobox/dpiSetting"); string_checkconfig(".config/00-kobox/dpiSetting");
if(checkconfig_str_val == "") { if(checkconfig_str_val == "") {
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
dpiSetting = "125"; dpiSetting = "125";
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") {
@ -131,7 +131,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
log("Launching KoBox app: KTerm", className); log("Launching KoBox app: KTerm", className);
string_writeconfig("/external_root/tmp/X_program", "/usr/local/bin/kterm -l /usr/local/share/kterm/layouts/keyboard-kt.xml -k 1"); string_writeconfig("/external_root/tmp/X_program", "/usr/local/bin/kterm -l /usr/local/share/kterm/layouts/keyboard-kt.xml -k 1");
dpModeSetting = "fullscreen"; dpModeSetting = "fullscreen";
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
dpiSetting = "175"; dpiSetting = "175";
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") {

View file

@ -42,7 +42,7 @@ koboxSettings::koboxSettings(QWidget *parent) :
QString dpiSetting; QString dpiSetting;
string_checkconfig(".config/00-kobox/dpiSetting"); string_checkconfig(".config/00-kobox/dpiSetting");
if(checkconfig_str_val == "") { if(checkconfig_str_val == "") {
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
dpiSetting = "125"; dpiSetting = "125";
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") {

View file

@ -34,7 +34,7 @@ libraryWidget::libraryWidget(QWidget *parent) :
} }
QFont crimson(family); QFont crimson(family);
if(global::deviceID != "n905\n") { if(global::deviceID != "n905\n" and global::deviceID != "kt\n") {
ui->previousBtn->setText(""); ui->previousBtn->setText("");
ui->previousBtn->setProperty("type", "borderless"); ui->previousBtn->setProperty("type", "borderless");
ui->nextBtn->setText(""); ui->nextBtn->setText("");
@ -62,7 +62,7 @@ libraryWidget::libraryWidget(QWidget *parent) :
ui->book6Btn->setText(""); ui->book6Btn->setText("");
ui->book7Btn->setText(""); ui->book7Btn->setText("");
ui->book8Btn->setText(""); ui->book8Btn->setText("");
if(global::deviceID != "n905\n") { if(global::deviceID != "n905\n" and global::deviceID != "kt\n") {
ui->book9Btn->setText(""); ui->book9Btn->setText("");
ui->book10Btn->setText(""); ui->book10Btn->setText("");
ui->book11Btn->setText(""); ui->book11Btn->setText("");
@ -98,7 +98,7 @@ libraryWidget::libraryWidget(QWidget *parent) :
ui->book6Label->setStyleSheet("font-size: 8.5pt; font-style: italic"); ui->book6Label->setStyleSheet("font-size: 8.5pt; font-style: italic");
ui->book7Label->setStyleSheet("font-size: 8.5pt; font-style: italic"); ui->book7Label->setStyleSheet("font-size: 8.5pt; font-style: italic");
ui->book8Label->setStyleSheet("font-size: 8.5pt; font-style: italic"); ui->book8Label->setStyleSheet("font-size: 8.5pt; font-style: italic");
if(global::deviceID != "n905\n") { if(global::deviceID != "n905\n" and global::deviceID != "kt\n") {
ui->book9Label->setStyleSheet("font-size: 8.5pt; font-style: italic"); ui->book9Label->setStyleSheet("font-size: 8.5pt; font-style: italic");
ui->book10Label->setStyleSheet("font-size: 8.5pt; font-style: italic"); ui->book10Label->setStyleSheet("font-size: 8.5pt; font-style: italic");
ui->book11Label->setStyleSheet("font-size: 8.5pt; font-style: italic"); ui->book11Label->setStyleSheet("font-size: 8.5pt; font-style: italic");
@ -134,7 +134,7 @@ libraryWidget::libraryWidget(QWidget *parent) :
ui->book6Label->setFont(crimson); ui->book6Label->setFont(crimson);
ui->book7Label->setFont(crimson); ui->book7Label->setFont(crimson);
ui->book8Label->setFont(crimson); ui->book8Label->setFont(crimson);
if(global::deviceID != "n905\n") { if(global::deviceID != "n905\n" and global::deviceID != "kt\n") {
ui->book9Label->setFont(crimson); ui->book9Label->setFont(crimson);
ui->book10Label->setFont(crimson); ui->book10Label->setFont(crimson);
ui->book11Label->setFont(crimson); ui->book11Label->setFont(crimson);
@ -186,7 +186,7 @@ void libraryWidget::setupView() {
ui->book6Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/6/title")); ui->book6Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/6/title"));
ui->book7Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/7/title")); ui->book7Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/7/title"));
ui->book8Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/8/title")); ui->book8Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/8/title"));
if(global::deviceID != "n905\n") { if(global::deviceID != "n905\n" and global::deviceID != "kt\n") {
ui->book9Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/9/title")); ui->book9Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/9/title"));
ui->book10Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/10/title")); ui->book10Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/10/title"));
ui->book11Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/11/title")); ui->book11Label->setText(readFile("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/11/title"));
@ -213,7 +213,7 @@ void libraryWidget::setupView() {
ui->book7Btn->setIconSize(QSize(stdIconWidth, stdIconHeight)); ui->book7Btn->setIconSize(QSize(stdIconWidth, stdIconHeight));
ui->book8Btn->setIcon(QIcon("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/8/cover.jpg")); ui->book8Btn->setIcon(QIcon("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/8/cover.jpg"));
ui->book8Btn->setIconSize(QSize(stdIconWidth, stdIconHeight)); ui->book8Btn->setIconSize(QSize(stdIconWidth, stdIconHeight));
if(global::deviceID != "n905\n") { if(global::deviceID != "n905\n" and global::deviceID != "kt\n") {
ui->book9Btn->setIcon(QIcon("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/9/cover.jpg")); ui->book9Btn->setIcon(QIcon("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/9/cover.jpg"));
ui->book9Btn->setIconSize(QSize(stdIconWidth, stdIconHeight)); ui->book9Btn->setIconSize(QSize(stdIconWidth, stdIconHeight));
ui->book10Btn->setIcon(QIcon("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/10/cover.jpg")); ui->book10Btn->setIcon(QIcon("/mnt/onboard/onboard/.inkbox/gutenberg-data/latest-books/10/cover.jpg"));

View file

@ -114,65 +114,28 @@ int main(int argc, char *argv[])
string_writeconfig("/inkbox/skip_opendialog", "true"); string_writeconfig("/inkbox/skip_opendialog", "true");
if(global::deviceID == "n705\n") { if(global::deviceID == "n705\n") {
global::isN705 = true; global::isN705 = true;
global::isN905C = false;
global::isN613 = false;
global::isN873 = false;
global::isN236 = false;
global::isN437 = false;
global::isN306 = false;
} }
else if(global::deviceID == "n905\n") { else if(global::deviceID == "n905\n") {
global::isN705 = false;
global::isN905C = true; global::isN905C = true;
global::isN613 = false;
global::isN873 = false;
global::isN236 = false;
global::isN437 = false;
global::isN306 = false;
} }
else if(global::deviceID == "n613\n") { else if(global::deviceID == "n613\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = true; global::isN613 = true;
global::isN873 = false;
global::isN236 = false;
global::isN437 = false;
} }
else if(global::deviceID == "n873\n") { else if(global::deviceID == "n873\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = false;
global::isN873 = true; global::isN873 = true;
global::isN236 = false;
global::isN437 = false;
} }
else if(global::deviceID == "n236\n") { else if(global::deviceID == "n236\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = false;
global::isN873 = false;
global::isN236 = true; global::isN236 = true;
global::isN437 = false;
global::isN306 = false;
} }
else if(global::deviceID == "n437\n") { else if(global::deviceID == "n437\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = false;
global::isN873 = false;
global::isN236 = false;
global::isN437 = true; global::isN437 = true;
global::isN306 = false;
} }
else if(global::deviceID == "n306\n") { else if(global::deviceID == "n306\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = false;
global::isN873 = false;
global::isN236 = false;
global::isN437 = false;
global::isN306 = true; global::isN306 = true;
} }
else if(global::deviceID == "kt\n") {
global::isKT = true;
}
else { else {
; ;
} }
@ -200,67 +163,28 @@ int main(int argc, char *argv[])
if(global::deviceID == "n705\n") { if(global::deviceID == "n705\n") {
global::isN705 = true; global::isN705 = true;
global::isN905C = false;
global::isN613 = false;
global::isN873 = false;
global::isN236 = false;
global::isN437 = false;
global::isN306 = false;
} }
else if(global::deviceID == "n905\n") { else if(global::deviceID == "n905\n") {
global::isN705 = false;
global::isN905C = true; global::isN905C = true;
global::isN613 = false;
global::isN873 = false;
global::isN236 = false;
global::isN437 = false;
global::isN306 = false;
} }
else if(global::deviceID == "n613\n") { else if(global::deviceID == "n613\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = true; global::isN613 = true;
global::isN873 = false;
global::isN236 = false;
global::isN437 = false;
global::isN306 = false;
} }
else if(global::deviceID == "n873\n") { else if(global::deviceID == "n873\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = false;
global::isN873 = true; global::isN873 = true;
global::isN236 = false;
global::isN437 = false;
global::isN306 = false;
} }
else if(global::deviceID == "n236\n") { else if(global::deviceID == "n236\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = false;
global::isN873 = false;
global::isN236 = true; global::isN236 = true;
global::isN437 = false;
global::isN306 = false;
} }
else if(global::deviceID == "n437\n") { else if(global::deviceID == "n437\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = false;
global::isN873 = false;
global::isN236 = false;
global::isN437 = true; global::isN437 = true;
global::isN306 = false;
} }
else if(global::deviceID == "n306\n") { else if(global::deviceID == "n306\n") {
global::isN705 = false;
global::isN905C = false;
global::isN613 = false;
global::isN873 = false;
global::isN236 = false;
global::isN437 = false;
global::isN306 = true; global::isN306 = true;
} }
else if(global::deviceID == "kt\n") {
global::isKT = true;
}
else { else {
; ;
} }

View file

@ -83,7 +83,7 @@ MainWindow::MainWindow(QWidget *parent)
wifiIconWidth = sW / 20.5; wifiIconWidth = sW / 20.5;
wifiIconHeight = sH / 20.5; wifiIconHeight = sH / 20.5;
} }
else if(global::deviceID == "n905\n") { else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
stdIconWidth = sW / 14; stdIconWidth = sW / 14;
stdIconHeight = sH / 14; stdIconHeight = sH / 14;
brightnessIconWidth = sW / 26; brightnessIconWidth = sW / 26;
@ -157,7 +157,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->wifiBtn->setStyleSheet("font-size: 9pt; padding-bottom: 0px; padding-top: 0px; padding-left: 8px; padding-right: 8px"); ui->wifiBtn->setStyleSheet("font-size: 9pt; padding-bottom: 0px; padding-top: 0px; padding-left: 8px; padding-right: 8px");
// Checking if we have a Mini or Touch there // Checking if we have a Mini or Touch there
if(global::deviceID == "n705\n" or global::deviceID == "n905\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 == "emu\n") {
@ -794,9 +794,9 @@ 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") { 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") {
// 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") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
ui->brightnessBtn->hide(); ui->brightnessBtn->hide();
ui->line_7->hide(); ui->line_7->hide();
} }
@ -876,7 +876,7 @@ void MainWindow::setInitialBrightness() {
set_warmth(warmth); set_warmth(warmth);
} }
int brightness_value = brightness_checkconfig(".config/03-brightness/config"); int brightness_value = brightness_checkconfig(".config/03-brightness/config");
if(global::deviceID != "n705\n" and global::deviceID != "n905\n") { if(global::deviceID != "n705\n" and global::deviceID != "n905\n" and global::deviceID != "kt\n") {
log("Setting initial brightness to " + QString::number(brightness_value), className); log("Setting initial brightness to " + QString::number(brightness_value), className);
} }
if(checkconfig("/tmp/oobe-inkbox_completed") == true) { if(checkconfig("/tmp/oobe-inkbox_completed") == true) {
@ -1174,7 +1174,7 @@ void MainWindow::resetFullWindow() {
} }
void MainWindow::setRecentBooksLabelsTruncateThreshold() { void MainWindow::setRecentBooksLabelsTruncateThreshold() {
if(global::deviceID == "n705\n" or global::deviceID == "n905b\n" or global::deviceID == "n905c\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905b\n" or global::deviceID == "n905c\n" or global::deviceID == "kt\n") {
truncateThreshold = 12; truncateThreshold = 12;
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n"){ else if(global::deviceID == "n613\n" or global::deviceID == "n873\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n"){

View file

@ -248,7 +248,7 @@ reader::reader(QWidget *parent) :
// Custom settings // Custom settings
// Brightness // Brightness
if(global::reader::globalReadingSettings == false) { if(global::reader::globalReadingSettings == false) {
if(global::deviceID != "n705\n" and global::deviceID != "n905\n") { if(global::deviceID != "n705\n" and global::deviceID != "n905\n" and global::deviceID != "kt\n") {
int brightness_value = brightness_checkconfig(".config/03-brightness/config"); int brightness_value = brightness_checkconfig(".config/03-brightness/config");
log("Local Reading Settings: Setting brightness to " + QString::number(brightness_value), className); log("Local Reading Settings: Setting brightness to " + QString::number(brightness_value), className);
cinematicBrightness(brightness_value, 2); cinematicBrightness(brightness_value, 2);
@ -344,7 +344,7 @@ reader::reader(QWidget *parent) :
// Getting brightness level // Getting brightness level
int brightness_value; int brightness_value;
if(global::isN705 == true or global::isN905C == true or global::isN873 == true) { if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
brightness_value = get_brightness(); brightness_value = get_brightness();
} }
else if(global::isN613 == true) { else if(global::isN613 == true) {
@ -362,7 +362,7 @@ reader::reader(QWidget *parent) :
float sH = QGuiApplication::screens()[0]->size().height(); float sH = QGuiApplication::screens()[0]->size().height();
// Defining what the icons' size will be // Defining what the icons' size will be
if(checkconfig("/opt/inkbox_genuine") == true) { if(checkconfig("/opt/inkbox_genuine") == true) {
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 == "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 == "kt\n" or global::deviceID == "emu\n") {
float stdIconWidth = sW / 16; float stdIconWidth = sW / 16;
float stdIconHeight = sW / 16; float stdIconHeight = sW / 16;
QPixmap chargingPixmap(":/resources/battery_charging.png"); QPixmap chargingPixmap(":/resources/battery_charging.png");
@ -589,7 +589,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") { 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") {
infoLabelDefinedLength = 50; infoLabelDefinedLength = 50;
} }
else { else {
@ -618,7 +618,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") { 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") {
infoLabelDefinedLength = 50; infoLabelDefinedLength = 50;
} }
else { else {
@ -1183,7 +1183,7 @@ void reader::on_optionsBtn_clicked()
void reader::on_brightnessDecBtn_clicked() void reader::on_brightnessDecBtn_clicked()
{ {
int bval; int bval;
if(global::isN705 == true or global::isN905C == true or global::isN873 == true) { if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
bval = get_brightness(); bval = get_brightness();
} }
else if(global::isN613 == true) { else if(global::isN613 == true) {
@ -1206,7 +1206,7 @@ void reader::on_brightnessDecBtn_clicked()
void reader::on_brightnessIncBtn_clicked() void reader::on_brightnessIncBtn_clicked()
{ {
int bval; int bval;
if(global::isN705 == true or global::isN905C == true or global::isN873 == true) { if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
bval = get_brightness(); bval = get_brightness();
} }
else if(global::isN613 == true) { else if(global::isN613 == true) {
@ -1458,7 +1458,7 @@ void reader::menubar_show() {
ui->pageWidget->setVisible(true); ui->pageWidget->setVisible(true);
} }
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
; ;
} }
else { else {
@ -1470,7 +1470,7 @@ void reader::menubar_show() {
void reader::menubar_hide() { void reader::menubar_hide() {
log("Hiding menu bar", className); log("Hiding menu bar", className);
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
ui->brightnessWidget->setVisible(false); ui->brightnessWidget->setVisible(false);
} }
else { else {
@ -1615,7 +1615,7 @@ void reader::on_sizeSlider_valueChanged(int value)
ui->sizeValueLabel->setText("5"); ui->sizeValueLabel->setText("5");
} }
} }
if(global::deviceID == "n905\n") { if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
if(value == 0) { if(value == 0) {
ui->text->setStyleSheet("font-size: 6pt"); ui->text->setStyleSheet("font-size: 6pt");
ui->sizeValueLabel->setText("1"); ui->sizeValueLabel->setText("1");

View file

@ -175,7 +175,7 @@ settings::settings(QWidget *parent) :
ui->uiScalingSlider->setValue(2); ui->uiScalingSlider->setValue(2);
} }
} }
else if(global::deviceID == "n905\n") { else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
if(dpi_number == 160) { if(dpi_number == 160) {
ui->uiScalingSlider->setValue(0); ui->uiScalingSlider->setValue(0);
} }
@ -620,7 +620,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
if(global::deviceID == "n705\n") { if(global::deviceID == "n705\n") {
string_writeconfig(".config/09-dpi/config", "187"); string_writeconfig(".config/09-dpi/config", "187");
} }
if(global::deviceID == "n905\n") { if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "160"); string_writeconfig(".config/09-dpi/config", "160");
} }
if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") {
@ -637,7 +637,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
if(global::deviceID == "n705\n") { if(global::deviceID == "n705\n") {
string_writeconfig(".config/09-dpi/config", "214"); string_writeconfig(".config/09-dpi/config", "214");
} }
if(global::deviceID == "n905\n") { if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "187"); string_writeconfig(".config/09-dpi/config", "187");
} }
if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") {
@ -654,7 +654,7 @@ void settings::on_uiScalingSlider_valueChanged(int value)
if(global::deviceID == "n705\n") { if(global::deviceID == "n705\n") {
string_writeconfig(".config/09-dpi/config", "227"); string_writeconfig(".config/09-dpi/config", "227");
} }
if(global::deviceID == "n905\n") { if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "200"); string_writeconfig(".config/09-dpi/config", "200");
} }
if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") {
@ -772,7 +772,7 @@ void settings::on_enableUiScalingCheckBox_toggled(bool checked)
if(global::deviceID == "n705\n") { if(global::deviceID == "n705\n") {
string_writeconfig(".config/09-dpi/config", "187"); string_writeconfig(".config/09-dpi/config", "187");
} }
else if(global::deviceID == "n905\n") { else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
string_writeconfig(".config/09-dpi/config", "160"); string_writeconfig(".config/09-dpi/config", "160");
} }
else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") { else if(global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n306\n") {

View file

@ -40,7 +40,7 @@ settingsChooser::settingsChooser(QWidget *parent) :
ui->inkboxSettingsBtn->setProperty("type", "borderless"); ui->inkboxSettingsBtn->setProperty("type", "borderless");
ui->koboxSettingsBtn->setProperty("type", "borderless"); ui->koboxSettingsBtn->setProperty("type", "borderless");
if(global::deviceID == "n705\n" or global::deviceID == "n905\n") { if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
ui->inkboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left"); ui->inkboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
ui->koboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left"); ui->koboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
} }

View file

@ -34,7 +34,7 @@ usbms_splash::usbms_splash(QWidget *parent) :
ui->label->setText("Launching KoBox subsystem"); ui->label->setText("Launching KoBox subsystem");
ui->label->setStyleSheet("font-size: 14pt; font-weight: bold"); ui->label->setStyleSheet("font-size: 14pt; font-weight: bold");
ui->label_3->setText("Please wait, this could take a while."); ui->label_3->setText("Please wait, this could take a while.");
if(global::deviceID == "n905\n") { if(global::deviceID == "n905\n" or global::deviceID == "kt\n") {
ui->label_3->setStyleSheet("font-size: 11pt"); ui->label_3->setStyleSheet("font-size: 11pt");
} }
else { else {