diff --git a/src/apps/userapps.cpp b/src/apps/userapps.cpp index 7559fd3..70f7ca3 100644 --- a/src/apps/userapps.cpp +++ b/src/apps/userapps.cpp @@ -161,7 +161,8 @@ void userapps::on_launchBtn_clicked() message.append("'"); log(message, className); // Tell the OS that we're not running anymore - string_writeconfig("/tmp/inkbox_running", "false"); + writeFile("/tmp/inkbox_running", "false"); + writeFile("/tmp/currentlyRunningUserApplication", appName); QProcess process; QStringList args; diff --git a/src/homeWidget/homepagewidget.cpp b/src/homeWidget/homepagewidget.cpp index 592f5ec..bde1676 100644 --- a/src/homeWidget/homepagewidget.cpp +++ b/src/homeWidget/homepagewidget.cpp @@ -10,21 +10,26 @@ homePageWidget::homePageWidget(QWidget *parent) : ui(new Ui::homePageWidget) { ui->setupUi(this); + + // Getting the screen's size + sW = QGuiApplication::screens()[0]->size().width(); + sH = QGuiApplication::screens()[0]->size().height(); + if(global::deviceID == "n705\n") { - stdIconWidth = sW / 52; - stdIconHeight = sH / 52; + stdIconWidth = sW / 23; + stdIconHeight = sH / 23; } else if(global::deviceID == "n905\n" or global::deviceID == "kt\n") { - stdIconWidth = sW / 54; - stdIconHeight = sH / 54; + stdIconWidth = sW / 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") { - stdIconWidth = sW / 52.5; - stdIconHeight = sH / 52.5; + stdIconWidth = sW / 23.5; + stdIconHeight = sH / 23.5; } else { - stdIconWidth = sW / 54; - stdIconHeight = sH / 54; + stdIconWidth = sW / 25; + stdIconHeight = sH / 25; } ui->recentBooksIconLabel->setPixmap(QPixmap(":/resources/file-text.png").scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation)); ui->pinnedBooksIconLabel->setPixmap(QPixmap(":/resources/pin.png").scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation)); @@ -48,10 +53,6 @@ homePageWidget::homePageWidget(QWidget *parent) : bookTitleTruncateThreshold = 25; } - // Getting the screen's size - sW = QGuiApplication::screens()[0]->size().width(); - sH = QGuiApplication::screens()[0]->size().height(); - if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") { stdIconWidthDivider = 8; stdIconHeightDivider = 8; @@ -205,7 +206,7 @@ void homePageWidget::setupDisplay(bool databaseGenerated) { bookBtnArray[i]->setPixmap(QPixmap(bookIcon).scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio)); } else { - bookBtnArray[i]->setPixmap(QPixmap(":/resources/cover_unavailable").scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio)); + bookBtnArray[i]->setPixmap(QPixmap(":/resources/cover_unavailable.png").scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation)); } verticalLayoutArray[i]->addWidget(bookBtnArray[i]); @@ -321,7 +322,7 @@ void homePageWidget::setupDisplay(bool databaseGenerated) { pinnedBooksBtnArray[i]->setPixmap(QPixmap(bookIcon).scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio)); } else { - pinnedBooksBtnArray[i]->setPixmap(QPixmap(":/resources/cover_unavailable").scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio)); + pinnedBooksBtnArray[i]->setPixmap(QPixmap(":/resources/cover_unavailable.png").scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation)); } pinnedBooksVerticalLayoutArray[i]->addWidget(pinnedBooksBtnArray[i]); diff --git a/src/localLibrary/locallibrarywidget.cpp b/src/localLibrary/locallibrarywidget.cpp index ae87124..43b27bf 100644 --- a/src/localLibrary/locallibrarywidget.cpp +++ b/src/localLibrary/locallibrarywidget.cpp @@ -220,7 +220,7 @@ void localLibraryWidget::setupBooksList(int pageNumber) { } else { QPixmap pixmap(":/resources/cover_unavailable.png"); - bookIconArray[in]->setPixmap(pixmap.scaled(stdIconWidth, stdIconHeight)); + bookIconArray[in]->setPixmap(pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation)); } // Display book title diff --git a/src/main.cpp b/src/main.cpp index 6f88706..04f07fe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -57,6 +57,10 @@ int main(int argc, char *argv[]) global::device::isWifiAble = false; } + if(QFile::exists("/tmp/currentlyRunningUserApplication")) { + QFile::remove("/tmp/currentlyRunningUserApplication"); + } + if(QFile::exists("/tmp/rescan_userapps")) { QFile::remove("/tmp/rescan_userapps"); log("Re-scanning user applications from explicit request", "main"); diff --git a/src/widgets/dialogs/library/bookinfodialog.cpp b/src/widgets/dialogs/library/bookinfodialog.cpp index 238b11c..b13e5fb 100644 --- a/src/widgets/dialogs/library/bookinfodialog.cpp +++ b/src/widgets/dialogs/library/bookinfodialog.cpp @@ -68,7 +68,7 @@ bookInfoDialog::bookInfoDialog(QWidget *parent) : } else { QPixmap coverPixmap(":/resources/cover_unavailable.png"); - QPixmap scaledCoverPixmap = coverPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + QPixmap scaledCoverPixmap = coverPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); ui->bookCoverLabel->setPixmap(scaledCoverPixmap); QFile::remove("/inkbox/gutenberg/getCoverDone"); break;