From 0b4b1f51e1cd1d3cd9a8e80defe85455b21ed90d Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Sat, 5 Mar 2022 19:26:27 -0500 Subject: [PATCH] N705: Fix Reader framework bug and improve reset dialog On this device, the Quit button makes the UI go beyond the limits of the screen when the menu bar is shown. Thus, the user will have to resort on the default Quit button found in MainWindow. --- generaldialog.cpp | 7 ++++++- reader.cpp | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/generaldialog.cpp b/generaldialog.cpp index 51fc6ee..eae3bc6 100644 --- a/generaldialog.cpp +++ b/generaldialog.cpp @@ -77,7 +77,12 @@ generalDialog::generalDialog(QWidget *parent) : resetDialog = true; ui->okBtn->setText("Proceed"); ui->cancelBtn->setText("Go back"); - ui->bodyLabel->setText("This will erase any books you have stored on the deivce.\nSettings will be reset."); + if(readFile("/opt/inkbox_device") != "n705\n") { + ui->bodyLabel->setText("This will erase any books you have stored on the device.\nSettings will be reset."); + } + else { + ui->bodyLabel->setText("This will erase any books\nyou have stored on the device.\nSettings will be reset."); + } ui->headerLabel->setText("Warning"); QTimer::singleShot(50, this, SLOT(adjust_size())); string_writeconfig("/inkbox/resetDialog", "false"); diff --git a/reader.cpp b/reader.cpp index 3855a40..69be8cb 100644 --- a/reader.cpp +++ b/reader.cpp @@ -102,6 +102,14 @@ reader::reader(QWidget *parent) : ui->quitBtn->setText(""); ui->quitBtn->setIcon(QIcon(":/resources/power.png")); + // On the Mini with QT_FONT_DPI set to 187 (default for this device), quitBtn makes the UI go beyond the limits of the screen when the menu bar is shown + if(readFile("/opt/inkbox_device") == "n705\n") { + ui->quitBtn->hide(); + ui->quitBtn->deleteLater(); + ui->line_19->hide(); + ui->line_19->deleteLater(); + } + // Style misc. ui->bookInfoLabel->setStyleSheet("font-style: italic");