diff --git a/src/homeWidget/mainwindow.cpp b/src/homeWidget/mainwindow.cpp
index 5554ee5..4a60cbf 100644
--- a/src/homeWidget/mainwindow.cpp
+++ b/src/homeWidget/mainwindow.cpp
@@ -274,7 +274,7 @@ MainWindow::MainWindow(QWidget *parent)
// Global reading settings
string_checkconfig(".config/16-global_reading_settings/config");
if(checkconfig_str_val == "") {
- checked_box = true;
+ checked_box = false;
writeconfig(".config/16-global_reading_settings/config", "GlobalReadingSettings=");
}
@@ -579,8 +579,15 @@ void MainWindow::on_homeBtn_clicked()
void MainWindow::resetWindow(bool resetStackedWidget) {
// Reset layout
+ bool authorQuote = false;
if(resetStackedWidget == true) {
- ui->homeStackedWidget->setCurrentIndex(2);
+ if(checkconfig(".config/05-quote/config") == false) {
+ authorQuote = true;
+ ui->homeStackedWidget->setCurrentIndex(0);
+ }
+ else {
+ ui->homeStackedWidget->setCurrentIndex(2);
+ }
ui->stackedWidget->setCurrentIndex(0);
}
@@ -616,7 +623,7 @@ void MainWindow::resetWindow(bool resetStackedWidget) {
if(global::mainwindow::tabSwitcher::repaint == true) {
this->repaint();
}
- if(resetStackedWidget == true) {
+ if(resetStackedWidget == true && authorQuote == false) {
setupHomePageWidget();
}
}
@@ -950,7 +957,6 @@ void MainWindow::on_libraryButton_clicked()
log("Launching Online Library", className);
if(testPing() == 0 or global::deviceID == "emu\n") {
// 'Do you want to sync?' dialog
- log("Showing 'Sync required' dialog", className);
bool willSync = false;
QString syncEpochQStr = readFile("/external_root/opt/storage/gutenberg/last_sync");
if(!syncEpochQStr.isEmpty()) {
@@ -966,6 +972,7 @@ void MainWindow::on_libraryButton_clicked()
}
if(willSync == true) {
+ log("Showing 'Sync required' dialog", className);
global::library::librarySyncDialog = true;
generalDialogWindow = new generalDialog(this);
QObject::connect(generalDialogWindow, &generalDialog::syncOnlineLibrary, this, &MainWindow::launchOnlineLibrary);
diff --git a/src/homeWidget/mainwindow.ui b/src/homeWidget/mainwindow.ui
index d0c5a67..1840d71 100644
--- a/src/homeWidget/mainwindow.ui
+++ b/src/homeWidget/mainwindow.ui
@@ -36,7 +36,6 @@
Inter
11
- 75
false
true
@@ -96,7 +95,6 @@
Inter
11
- 50
false
false
@@ -129,7 +127,6 @@
Inter
11
- 75
false
true
@@ -232,7 +229,6 @@
Inter
11
- 75
false
true
@@ -310,7 +306,6 @@
Chivo
11
- 50
true
false
@@ -467,7 +462,6 @@
Inter
11
- 75
false
true
@@ -485,7 +479,6 @@ Library
Inter
11
- 75
false
true
@@ -536,7 +529,6 @@ Reader
Inter
10
- 75
false
true
@@ -570,7 +562,6 @@ Search
Inter
10
- 75
false
true
@@ -604,7 +595,6 @@ Settings
Inter
10
- 75
false
true
@@ -644,7 +634,6 @@ Apps
Inter
10
- 75
false
true
diff --git a/src/reader/reader.cpp b/src/reader/reader.cpp
index 6842857..927dfba 100644
--- a/src/reader/reader.cpp
+++ b/src/reader/reader.cpp
@@ -47,7 +47,6 @@ reader::reader(QWidget *parent) :
global::reader::currentViewportText = "";
ui->setupUi(this);
- ui->brightnessStatus->setFont(QFont("u001"));
ui->fontLabel->setFont(QFont("u001"));
ui->sizeLabel->setFont(QFont("u001"));
ui->sizeValueLabel->setFont(QFont("Inter"));
@@ -63,10 +62,8 @@ reader::reader(QWidget *parent) :
ui->previousBtn->setProperty("type", "borderless");
ui->nextBtn->setProperty("type", "borderless");
ui->optionsBtn->setProperty("type", "borderless");
- ui->brightnessDecBtn->setProperty("type", "borderless");
- ui->brightnessIncBtn->setProperty("type", "borderless");
ui->homeBtn->setProperty("type", "borderless");
- ui->aboutBtn->setProperty("type", "borderless");
+ ui->brightnessBtn->setProperty("type", "borderless");
ui->alignLeftBtn->setProperty("type", "borderless");
ui->alignRightBtn->setProperty("type", "borderless");
ui->alignCenterBtn->setProperty("type", "borderless");
@@ -101,14 +98,10 @@ reader::reader(QWidget *parent) :
ui->previousDefinitionBtn->setIcon(QIcon(":/resources/chevron-left.png"));
ui->nextDefinitionBtn->setText("");
ui->nextDefinitionBtn->setIcon(QIcon(":/resources/chevron-right.png"));
- ui->brightnessDecBtn->setText("");
- ui->brightnessDecBtn->setIcon(QIcon(":/resources/minus.png"));
- ui->brightnessIncBtn->setText("");
- ui->brightnessIncBtn->setIcon(QIcon(":/resources/plus.png"));
ui->homeBtn->setText("");
ui->homeBtn->setIcon(QIcon(":/resources/home.png"));
- ui->aboutBtn->setText("");
- ui->aboutBtn->setIcon(QIcon(":/resources/info.png"));
+ ui->brightnessBtn->setText("");
+ ui->brightnessBtn->setIcon(QIcon(":/resources/frontlight.png"));
ui->searchBtn->setText("");
ui->searchBtn->setIcon(QIcon(":/resources/search.png"));
ui->increaseScaleBtn->setText("");
@@ -309,7 +302,7 @@ reader::reader(QWidget *parent) :
ui->lineSpacingValueLabel->setStyleSheet("font-size: 9pt; font-weight: bold");
ui->marginsValueLabel->setStyleSheet("font-size: 9pt; font-weight: bold");
ui->homeBtn->setStyleSheet("font-size: 9pt; padding: 5px");
- ui->aboutBtn->setStyleSheet("font-size: 9pt; padding: 5px");
+ ui->brightnessBtn->setStyleSheet("font-size: 9pt; padding: 5px");
ui->fontChooser->setStyleSheet("font-size: 9pt");
ui->gotoBtn->setStyleSheet("font-size: 9pt; padding: 9px; font-weight: bold; background: lightGrey");
ui->pageNumberLabel->setFont(QFont("Source Serif Pro"));
@@ -317,7 +310,7 @@ reader::reader(QWidget *parent) :
// Hiding the menubar + definition widget + brightness widget + buttons bar widget
ui->menuWidget->setVisible(false);
- ui->brightnessWidget->setVisible(false);
+ ui->brightnessBtn->setVisible(false);
ui->menuBarWidget->setVisible(false);
ui->buttonsBarWidget->setVisible(false);
ui->pdfScaleWidget->setVisible(false);
@@ -340,20 +333,6 @@ reader::reader(QWidget *parent) :
showTopbarWidget = true;
ui->bookInfoLabel->setFont(crimson);
- // Getting brightness level
- int brightness_value;
- if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
- brightness_value = get_brightness();
- }
- else if(global::isN613 == true) {
- setDefaultWorkDir();
- brightness_value = brightness_checkconfig(".config/03-brightness/config");
- }
- else {
- brightness_value = get_brightness();
- }
- ui->brightnessStatus->setValue(brightness_value);
-
// Defining pixmaps
// Getting the screen's size
float sW = QGuiApplication::screens()[0]->size().width();
@@ -1180,69 +1159,6 @@ void reader::on_optionsBtn_clicked()
}
}
-void reader::on_brightnessDecBtn_clicked()
-{
- int bval;
- if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
- bval = get_brightness();
- }
- else if(global::isN613 == true) {
- setDefaultWorkDir();
- bval = brightness_checkconfig(".config/03-brightness/config");
- }
- else {
- bval = get_brightness();
- }
- int set_bval = bval - 1;
- if(set_bval < 0) {
- set_bval = 0;
- }
- pre_set_brightness(set_bval);
- brightness_writeconfig(set_bval);
-
- ui->brightnessStatus->setValue(set_bval);
-}
-
-void reader::on_brightnessIncBtn_clicked()
-{
- int bval;
- if(global::isN705 == true or global::isN905C == true or global::isKT == true or global::isN873 == true) {
- bval = get_brightness();
- }
- else if(global::isN613 == true) {
- setDefaultWorkDir();
- bval = brightness_checkconfig(".config/03-brightness/config");
- }
- else {
- bval = get_brightness();
- }
- int set_bval = bval + 1;
- if(set_bval > 100) {
- set_bval = 100;
- }
- pre_set_brightness(set_bval);
- brightness_writeconfig(set_bval);
-
- ui->brightnessStatus->setValue(set_bval);
-}
-
-void reader::on_aboutBtn_clicked()
-{
- log("Showing About message box", className);
- if(checkconfig("/opt/inkbox_genuine") == true) {
- QString aboutmsg = "InkBox is an open-source, Qt-based eBook reader. It aims to bring you the latest Qt features while being also fast and responsive.";
- aboutmsg.prepend("");
- string_checkconfig_ro("/external_root/opt/isa/version");
- aboutmsg.append("
InkBox ");
- aboutmsg.append(checkconfig_str_val);
- aboutmsg.append("");
- QMessageBox::information(this, tr("Information"), aboutmsg);
- }
- else {
- QMessageBox::information(this, tr("About"), tr("InkBox is an open-source Qt-based eBook reader. It aims to bring you the latest Qt features while being also fast and responsive."));
- }
-}
-
void reader::on_homeBtn_clicked()
{
log("Returning to Home screen", className);
@@ -1486,7 +1402,7 @@ void reader::menubar_show() {
;
}
else {
- ui->brightnessWidget->setVisible(true);
+ ui->brightnessBtn->setVisible(true);
}
menubar_shown = true;
@@ -1495,11 +1411,11 @@ void reader::menubar_show() {
void reader::menubar_hide() {
log("Hiding menu bar", className);
if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "kt\n") {
- ui->brightnessWidget->setVisible(false);
+ ui->brightnessBtn->setVisible(true);
}
else {
// Safety measure
- ui->brightnessWidget->setVisible(false);
+ ui->brightnessBtn->setVisible(false);
}
if(is_pdf == false && is_image == false) {
@@ -2356,3 +2272,11 @@ void reader::on_marginsSlider_valueChanged(int value)
setTextProperties(global::reader::textAlignment, global::reader::lineSpacing, global::reader::margins, global::reader::font, global::reader::fontSize);
ui->marginsValueLabel->setText(QString::number(value + 1));
}
+
+void reader::on_brightnessBtn_clicked()
+{
+ log("Showing Brightness Dialog", className);
+ brightnessDialogWindow = new brightnessDialog();
+ brightnessDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
+ brightnessDialogWindow->show();
+}
diff --git a/src/reader/reader.h b/src/reader/reader.h
index fd66e87..6587e2b 100644
--- a/src/reader/reader.h
+++ b/src/reader/reader.h
@@ -8,6 +8,7 @@
#include "quit.h"
#include "textdialog.h"
#include "highlightslistdialog.h"
+#include "brightnessdialog.h"
#include
#include
@@ -126,9 +127,6 @@ private slots:
void on_nextBtn_clicked();
void on_previousBtn_clicked();
void on_optionsBtn_clicked();
- void on_brightnessDecBtn_clicked();
- void on_brightnessIncBtn_clicked();
- void on_aboutBtn_clicked();
void on_homeBtn_clicked();
void on_fontChooser_currentIndexChanged(const QString &arg1);
void on_alignLeftBtn_clicked();
@@ -170,6 +168,7 @@ private slots:
void setMargins(int margins, bool write = true);
void on_lineSpacingSlider_valueChanged(int value);
void on_marginsSlider_valueChanged(int value);
+ void on_brightnessBtn_clicked();
signals:
void openBookFile(QString book, bool relativePath);
@@ -183,6 +182,7 @@ private:
textDialog * textDialogWindow;
highlightsListDialog * highlightsListDialogWindow;
QGraphicsScene * graphicsScene;
+ brightnessDialog * brightnessDialogWindow;
};
#endif // READER_H
diff --git a/src/reader/reader.ui b/src/reader/reader.ui
index 7eb3ee7..c251fa5 100644
--- a/src/reader/reader.ui
+++ b/src/reader/reader.ui
@@ -35,7 +35,6 @@
- 75
true
@@ -68,7 +67,6 @@
- 75
true
@@ -81,7 +79,6 @@
- 75
true
@@ -160,7 +157,6 @@
- 75
true
@@ -230,7 +226,6 @@
Inter
- 75
true
@@ -527,50 +522,6 @@
0
- -
-
-
-
- 75
- true
-
-
-
- Battery
-
-
-
- -
-
-
- About
-
-
-
- -
-
-
- Battery Icon
-
-
-
- -
-
-
- Night mode
-
-
-
- -
-
-
- QFrame::Plain
-
-
- Qt::Vertical
-
-
-
-
@@ -584,29 +535,8 @@
- -
-
-
- Quit
-
-
-
- -
-
-
- Home
-
-
-
- -
-
-
- Search
-
-
-
- -
-
+
-
+
QFrame::Plain
@@ -628,8 +558,20 @@
- -
-
+
-
+
+
+
+ true
+
+
+
+ Battery
+
+
+
+ -
+
QFrame::Plain
@@ -638,6 +580,58 @@
+ -
+
+
+ Battery Icon
+
+
+
+ -
+
+
+ Night mode
+
+
+
+ -
+
+
+ Quit
+
+
+
+ -
+
+
+ Home
+
+
+
+ -
+
+
+ QFrame::Plain
+
+
+ Qt::Vertical
+
+
+
+ -
+
+
+ Search
+
+
+
+ -
+
+
+ Brightness
+
+
+
-
@@ -717,7 +711,6 @@
- 75
true
@@ -768,7 +761,6 @@
- 75
true
@@ -815,90 +807,6 @@
- -
-
-
- 0
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- 0
-
-
- 0
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- -
-
-
-
- Chivo
- true
-
-
-
- Brightness
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- 24
-
-
-
-
-
- -
-
-
- QFrame::Plain
-
-
- 2
-
-
- Qt::Horizontal
-
-
-
-
-
-
-
-
-
diff --git a/src/settings/settings.cpp b/src/settings/settings.cpp
index 205facd..26930b4 100644
--- a/src/settings/settings.cpp
+++ b/src/settings/settings.cpp
@@ -366,6 +366,11 @@ settings::settings(QWidget *parent) :
ui->autoCheckUpdatesBox->click();
}
+ // 'Export highlights' button
+ if(!QFile::exists(global::localLibrary::highlightsDatabasePath) or readFile(global::localLibrary::highlightsDatabasePath).isEmpty()) {
+ ui->exportHighlightsBtn->setEnabled(false);
+ }
+
if(readFile(".config/12-lockscreen/background") == "blank") {
ui->lockscreenBackgroundComboBox->setCurrentIndex(0);
}