mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
Local library: Bugfixes
This commit is contained in:
parent
8708246065
commit
8eea1d0df5
15 changed files with 258 additions and 63 deletions
|
@ -122,6 +122,7 @@ void bookInfoDialog::waitForBookFetch() {
|
|||
QString function = __func__; log(function + ": Download successful", className);
|
||||
emit showToast("Download successful");
|
||||
QFile::remove("/inkbox/gutenberg/getBookDone");
|
||||
QFile::remove(global::localLibrary::databasePath);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
|
1
eink.qrc
1
eink.qrc
|
@ -76,5 +76,6 @@
|
|||
<file>resources/tzlist</file>
|
||||
<file>resources/edit.png</file>
|
||||
<file>resources/save.png</file>
|
||||
<file>resources/book_inverted.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -58,6 +58,8 @@ namespace global {
|
|||
inline bool settingsChooserWidgetSelected;
|
||||
inline bool libraryWidgetCreated;
|
||||
inline bool libraryWidgetSelected;
|
||||
inline bool localLibraryWidgetCreated;
|
||||
inline bool localLibraryWidgetSelected;
|
||||
}
|
||||
inline bool updateDialog;
|
||||
inline bool lowBatteryDialog;
|
||||
|
@ -122,6 +124,10 @@ namespace global {
|
|||
inline bool librarySearchDialog;
|
||||
inline bool libraryResults;
|
||||
}
|
||||
namespace localLibrary {
|
||||
static inline QString rawDatabasePath = "/inkbox/LocalLibrary.db.raw";
|
||||
static inline QString databasePath = "/mnt/onboard/onboard/.inkbox/LocalLibrary.db";
|
||||
}
|
||||
namespace localStorage {
|
||||
inline QStringList searchResultsPaths;
|
||||
}
|
||||
|
|
|
@ -703,7 +703,7 @@ void generalDialog::syncGutenbergCatalog() {
|
|||
|
||||
string_writeconfig("/opt/ibxd", "gutenberg_sync\n");
|
||||
QTimer * syncCheckTimer = new QTimer(this);
|
||||
syncCheckTimer->setInterval(100);
|
||||
syncCheckTimer->setInterval(500);
|
||||
connect(syncCheckTimer, &QTimer::timeout, [&]() {
|
||||
if(QFile::exists("/inkbox/gutenbergSyncDone") == true) {
|
||||
if(checkconfig("/inkbox/gutenbergSyncDone") == true) {
|
||||
|
|
|
@ -254,7 +254,7 @@ void libraryWidget::syncCatalog() {
|
|||
|
||||
string_writeconfig("/opt/ibxd", "gutenberg_sync\n");
|
||||
QTimer * syncCheckTimer = new QTimer(this);
|
||||
syncCheckTimer->setInterval(100);
|
||||
syncCheckTimer->setInterval(500);
|
||||
connect(syncCheckTimer, &QTimer::timeout, [&]() {
|
||||
if(syncDone == false) {
|
||||
if(QFile::exists("/inkbox/gutenbergSyncDone") == true) {
|
||||
|
|
|
@ -411,19 +411,6 @@
|
|||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="recentlyAddedLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Recently added books on Gutenberg</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
@ -437,19 +424,12 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="previousBtn">
|
||||
<property name="text">
|
||||
<string>Previous</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
@ -462,7 +442,27 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="pageLabel">
|
||||
<property name="text">
|
||||
<string>1 of 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QPushButton" name="nextBtn">
|
||||
<property name="text">
|
||||
<string>Next</string>
|
||||
|
@ -470,14 +470,30 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="pageLabel">
|
||||
<widget class="QPushButton" name="previousBtn">
|
||||
<property name="text">
|
||||
<string>1 of 2</string>
|
||||
<string>Previous</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="recentlyAddedLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Inter</family>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>75</weight>
|
||||
<italic>false</italic>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Project Gutenberg's latest books</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
|
|
|
@ -62,8 +62,8 @@ localLibraryWidget::localLibraryWidget(QWidget *parent) :
|
|||
stdIconWidth = sH / stdIconHeightDivider;
|
||||
}
|
||||
else if(global::deviceID == "n437\n") {
|
||||
stdIconWidthDivider = 7.5;
|
||||
stdIconHeightDivider = 7.5;
|
||||
stdIconWidthDivider = 8;
|
||||
stdIconHeightDivider = 8;
|
||||
stdIconWidth = sW / stdIconWidthDivider;
|
||||
stdIconHeight = sH / stdIconHeightDivider;
|
||||
}
|
||||
|
@ -110,8 +110,16 @@ localLibraryWidget::localLibraryWidget(QWidget *parent) :
|
|||
}
|
||||
}
|
||||
setupDatabase();
|
||||
if(noBooksInDatabase == false) {
|
||||
setupBooksList(currentPageNumber);
|
||||
}
|
||||
else {
|
||||
ui->previousPageBtn->setEnabled(false);
|
||||
ui->nextPageBtn->setEnabled(false);
|
||||
ui->pageNumberLabel->setText("1 <i>of</i> 1");
|
||||
ui->stackedWidget->setCurrentIndex(1);
|
||||
}
|
||||
}
|
||||
|
||||
localLibraryWidget::~localLibraryWidget()
|
||||
{
|
||||
|
@ -119,10 +127,8 @@ localLibraryWidget::~localLibraryWidget()
|
|||
}
|
||||
|
||||
void localLibraryWidget::setupDatabase() {
|
||||
QString localLibraryDatabasePathRaw = "/inkbox/LocalLibrary.db.raw";
|
||||
QString localLibraryDatabasePath = "/mnt/onboard/onboard/.inkbox/LocalLibrary.db";
|
||||
setDefaultWorkDir();
|
||||
if(!QFile::exists(localLibraryDatabasePath)) {
|
||||
if(!QFile::exists(global::localLibrary::databasePath)) {
|
||||
log("Generating database", className);
|
||||
QStringList booksList;
|
||||
QDir dir("/mnt/onboard/onboard");
|
||||
|
@ -144,17 +150,17 @@ void localLibraryWidget::setupDatabase() {
|
|||
QProcess *proc = new QProcess();
|
||||
proc->start(prog, args);
|
||||
proc->waitForFinished();
|
||||
QJsonDocument jsonDocument = QJsonDocument::fromJson(readFile(localLibraryDatabasePathRaw).toUtf8());
|
||||
QFile::remove(localLibraryDatabasePathRaw);
|
||||
QJsonDocument jsonDocument = QJsonDocument::fromJson(readFile(global::localLibrary::rawDatabasePath).toUtf8());
|
||||
QFile::remove(global::localLibrary::rawDatabasePath);
|
||||
proc->deleteLater();
|
||||
|
||||
// Write database in compressed form, encoded in Base64 format
|
||||
writeFile(localLibraryDatabasePath, qCompress(jsonDocument.toJson()).toBase64());
|
||||
writeFile(global::localLibrary::databasePath, qCompress(jsonDocument.toJson()).toBase64());
|
||||
}
|
||||
|
||||
// Read library database from file
|
||||
log("Reading database", className);
|
||||
QFile database(localLibraryDatabasePath);
|
||||
QFile database(global::localLibrary::databasePath);
|
||||
QByteArray data;
|
||||
if(database.open(QIODevice::ReadOnly)) {
|
||||
data = database.readAll();
|
||||
|
@ -172,10 +178,17 @@ void localLibraryWidget::setupDatabase() {
|
|||
// Determine maximum page number
|
||||
booksNumber = databaseJsonArrayList.size();
|
||||
pagesNumber = std::ceil((double)booksNumber / buttonsNumber);
|
||||
if(databaseJsonArrayList.isEmpty()) {
|
||||
log("Database is empty", className);
|
||||
noBooksInDatabase = true;
|
||||
}
|
||||
else {
|
||||
noBooksInDatabase = false;
|
||||
if(pagesNumber == 1) {
|
||||
ui->nextPageBtn->setEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void localLibraryWidget::setupBooksList(int pageNumber) {
|
||||
idList.clear();
|
||||
|
@ -201,7 +214,7 @@ void localLibraryWidget::setupBooksList(int pageNumber) {
|
|||
}
|
||||
else {
|
||||
QPixmap pixmap(":/resources/cover_unavailable.png");
|
||||
bookIconArray[in]->setPixmap(pixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio));
|
||||
bookIconArray[in]->setPixmap(pixmap.scaled(stdIconWidth, stdIconHeight));
|
||||
}
|
||||
|
||||
// Display book title
|
||||
|
@ -232,13 +245,12 @@ void localLibraryWidget::setupBooksList(int pageNumber) {
|
|||
}
|
||||
}
|
||||
}
|
||||
ui->pageNumberLabel->setText("Page " + QString::number(pageNumber) + " <i>of</i> " + QString::number(pagesNumber));
|
||||
ui->pageNumberLabel->setText(QString::number(pageNumber) + " <i>of</i> " + QString::number(pagesNumber));
|
||||
// NOTICE: Memory leak?
|
||||
// Do it twice, otherwise the layout doesn't show as intended
|
||||
for(int i = 0; i <= 1; i++) {
|
||||
ui->verticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
|
||||
}
|
||||
QTimer::singleShot(100, this, SLOT(refreshScreenNative()));
|
||||
}
|
||||
|
||||
void localLibraryWidget::on_previousPageBtn_clicked()
|
||||
|
@ -249,6 +261,12 @@ void localLibraryWidget::on_previousPageBtn_clicked()
|
|||
ui->nextPageBtn->setEnabled(true);
|
||||
}
|
||||
setupBooksList(currentPageNumber);
|
||||
|
||||
pagesTurned = pagesTurned + 1;
|
||||
if(pagesTurned >= 3) {
|
||||
emit refreshScreen();
|
||||
pagesTurned = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -260,6 +278,12 @@ void localLibraryWidget::on_nextPageBtn_clicked()
|
|||
ui->nextPageBtn->setEnabled(false);
|
||||
}
|
||||
setupBooksList(currentPageNumber);
|
||||
|
||||
pagesTurned = pagesTurned + 1;
|
||||
if(pagesTurned >= 3) {
|
||||
emit refreshScreen();
|
||||
pagesTurned = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void localLibraryWidget::openBook(int bookID) {
|
||||
|
|
|
@ -32,9 +32,11 @@ public:
|
|||
QJsonArray databaseJsonArrayList;
|
||||
int currentPageNumber = 1;
|
||||
int pagesNumber;
|
||||
int pagesTurned = 0;
|
||||
int booksNumber;
|
||||
int bookTitleTruncateThreshold;
|
||||
QVector<int> idList;
|
||||
bool noBooksInDatabase = true;
|
||||
|
||||
private slots:
|
||||
void setupDatabase();
|
||||
|
|
|
@ -18,7 +18,10 @@
|
|||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Inter</family>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>75</weight>
|
||||
<italic>false</italic>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
@ -40,15 +43,44 @@
|
|||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="3">
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="pageNumberLabel">
|
||||
<property name="text">
|
||||
<string>Page</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QPushButton" name="nextPageBtn">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="localLibraryLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><b>Local library</b></string>
|
||||
</property>
|
||||
|
@ -61,11 +93,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Maximum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
|
@ -74,15 +109,43 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="nextPageBtn">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<item row="0" column="5">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Maximum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="booksVerticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
|
@ -92,6 +155,53 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="noBooksInLibraryLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Chivo</family>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>50</weight>
|
||||
<italic>true</italic>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>There are no books in your eReader yet.
|
||||
Add some via USB or explore the Online Library.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
@ -313,7 +313,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
ui->homeStackedWidget->setCurrentIndex(0);
|
||||
}
|
||||
else {
|
||||
setupLocalLibraryWidget();
|
||||
setupHomePageWidget();
|
||||
}
|
||||
|
||||
// Check if it's the first boot since an update and confirm that it installed successfully
|
||||
|
@ -507,7 +507,23 @@ void MainWindow::on_appsBtn_clicked()
|
|||
|
||||
void MainWindow::on_pushButton_clicked()
|
||||
{
|
||||
openReaderFramework();
|
||||
resetFullWindowException = true;
|
||||
resetWindow(false);
|
||||
if(global::mainwindow::tabSwitcher::localLibraryWidgetSelected != true) {
|
||||
ui->pushButton->setStyleSheet("background: black; color: white");
|
||||
ui->pushButton->setIcon(QIcon(":/resources/book_inverted.png"));
|
||||
|
||||
// Create widget
|
||||
setupLocalLibraryWidget();
|
||||
global::mainwindow::tabSwitcher::localLibraryWidgetCreated = true;
|
||||
|
||||
// Switch tab
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
global::mainwindow::tabSwitcher::localLibraryWidgetSelected = true;
|
||||
|
||||
// Repaint
|
||||
this->repaint();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_searchBtn_clicked()
|
||||
|
@ -543,6 +559,7 @@ void MainWindow::on_homeBtn_clicked()
|
|||
void MainWindow::resetWindow(bool resetStackedWidget) {
|
||||
// Reset layout
|
||||
if(resetStackedWidget == true) {
|
||||
ui->homeStackedWidget->setCurrentIndex(2);
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
|
@ -556,6 +573,9 @@ void MainWindow::resetWindow(bool resetStackedWidget) {
|
|||
if(global::mainwindow::tabSwitcher::libraryWidgetCreated == true) {
|
||||
libraryWidgetWindow->deleteLater();
|
||||
}
|
||||
if(global::mainwindow::tabSwitcher::localLibraryWidgetCreated == true) {
|
||||
localLibraryWidgetWindow->deleteLater();
|
||||
}
|
||||
|
||||
global::mainwindow::tabSwitcher::appsWidgetCreated = false;
|
||||
global::mainwindow::tabSwitcher::settingsChooserWidgetCreated = false;
|
||||
|
@ -563,12 +583,17 @@ void MainWindow::resetWindow(bool resetStackedWidget) {
|
|||
global::mainwindow::tabSwitcher::settingsChooserWidgetSelected = false;
|
||||
global::mainwindow::tabSwitcher::libraryWidgetCreated = false;
|
||||
global::mainwindow::tabSwitcher::libraryWidgetSelected = false;
|
||||
global::mainwindow::tabSwitcher::localLibraryWidgetCreated = false;
|
||||
global::mainwindow::tabSwitcher::localLibraryWidgetSelected = false;
|
||||
|
||||
resetIcons();
|
||||
setBatteryIcon();
|
||||
if(global::mainwindow::tabSwitcher::repaint == true) {
|
||||
this->repaint();
|
||||
}
|
||||
if(resetStackedWidget == true) {
|
||||
setupHomePageWidget();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::resetIcons() {
|
||||
|
@ -579,6 +604,8 @@ void MainWindow::resetIcons() {
|
|||
ui->settingsBtn->setIcon(QIcon(":/resources/settings.png"));
|
||||
ui->libraryButton->setStyleSheet("background: white");
|
||||
ui->libraryButton->setIcon(QIcon(":/resources/online-library.png"));
|
||||
ui->pushButton->setStyleSheet("background: white");
|
||||
ui->pushButton->setIcon(QIcon(":/resources/book.png"));
|
||||
}
|
||||
|
||||
void MainWindow::setBatteryIcon() {
|
||||
|
@ -927,7 +954,7 @@ void MainWindow::on_libraryButton_clicked()
|
|||
{
|
||||
log("Launching Online Library", className);
|
||||
if(testPing(true) == 0 or global::deviceID == "emu\n") {
|
||||
resetFullWindowException = false;
|
||||
resetFullWindowException = true;
|
||||
resetWindow(false);
|
||||
if(global::mainwindow::tabSwitcher::libraryWidgetSelected != true) {
|
||||
ui->libraryButton->setStyleSheet("background: black; color: white");
|
||||
|
@ -984,10 +1011,14 @@ void MainWindow::resetWifiIconClickedWhileReconnecting() {
|
|||
}
|
||||
|
||||
void MainWindow::setupLocalLibraryWidget() {
|
||||
localLibraryWidget * localLibraryWidgetWindow = new localLibraryWidget();
|
||||
localLibraryWidgetWindow = new localLibraryWidget(this);
|
||||
connect(localLibraryWidgetWindow, SIGNAL(openBookSignal(QString, bool)), SLOT(openBookFile(QString, bool)));
|
||||
connect(localLibraryWidgetWindow, SIGNAL(refreshScreen()), SLOT(refreshScreen()));
|
||||
localLibraryWidgetWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||
ui->homeStackedWidget->insertWidget(1, localLibraryWidgetWindow);
|
||||
ui->homeStackedWidget->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void MainWindow::setupHomePageWidget() {
|
||||
ui->homeStackedWidget->setCurrentIndex(2);
|
||||
}
|
||||
|
|
|
@ -96,6 +96,7 @@ private slots:
|
|||
void resetFullWindow();
|
||||
void resetWifiIconClickedWhileReconnecting();
|
||||
void setupLocalLibraryWidget();
|
||||
void setupHomePageWidget();
|
||||
|
||||
private:
|
||||
Ui::MainWindow * ui;
|
||||
|
|
|
@ -386,6 +386,7 @@
|
|||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_7"/>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -20,11 +20,11 @@ otaManager::otaManager(QWidget *parent) :
|
|||
connect(otaCheckTimer, &QTimer::timeout, [&]() {
|
||||
if(QFile::exists("/run/can_ota_update") == true) {
|
||||
if(checkconfig("/run/can_ota_update") == true) {
|
||||
log("OTA update is available!", className);
|
||||
log("OTA update is available", className);
|
||||
emit canOtaUpdate(true);
|
||||
}
|
||||
else {
|
||||
log("No OTA update available.", className);
|
||||
log("No OTA update available", className);
|
||||
emit canOtaUpdate(false);
|
||||
}
|
||||
unsigned long currentEpoch = QDateTime::currentSecsSinceEpoch();
|
||||
|
@ -44,12 +44,12 @@ otaManager::otaManager(QWidget *parent) :
|
|||
connect(otaDownloadTimer, &QTimer::timeout, [&]() {
|
||||
if(QFile::exists("/run/can_install_ota_update") == true) {
|
||||
if(checkconfig("/run/can_install_ota_update") == true) {
|
||||
log("Download succeeded.", className);
|
||||
log("Download succeeded", className);
|
||||
emit downloadedOtaUpdate(true);
|
||||
global::otaUpdate::downloadOta = false;
|
||||
}
|
||||
else {
|
||||
log("Download failed.", className);
|
||||
log("Download failed", className);
|
||||
emit downloadedOtaUpdate(false);
|
||||
global::otaUpdate::downloadOta = false;
|
||||
}
|
||||
|
|
BIN
resources/book_inverted.png
Normal file
BIN
resources/book_inverted.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
|
@ -216,6 +216,8 @@ void usbms_splash::restartServices() {
|
|||
}
|
||||
}
|
||||
}
|
||||
// Re-generate local library on next launch
|
||||
QFile::remove(global::localLibrary::databasePath);
|
||||
|
||||
quit_restart();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue