2021-03-25 05:00:19 -07:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include "settings.h"
|
2021-04-24 09:44:57 -07:00
|
|
|
#include "settingschooser.h"
|
2021-03-25 05:00:19 -07:00
|
|
|
#include "apps.h"
|
|
|
|
#include "reader.h"
|
|
|
|
#include "quit.h"
|
|
|
|
#include "alert.h"
|
2021-03-29 05:04:46 -07:00
|
|
|
#include "usbms_splash.h"
|
2021-03-29 18:47:21 -07:00
|
|
|
#include "brightnessdialog.h"
|
2021-03-31 05:38:59 -07:00
|
|
|
#include "generaldialog.h"
|
2021-04-27 05:40:08 -07:00
|
|
|
#include "koboxsettings.h"
|
2021-04-29 20:36:25 -07:00
|
|
|
#include "koboxappsdialog.h"
|
2021-06-08 04:49:52 -07:00
|
|
|
#include "textwidget.h"
|
2021-07-05 10:45:35 -07:00
|
|
|
#include "virtualkeypad.h"
|
2021-07-13 22:24:30 -07:00
|
|
|
#include "toast.h"
|
2021-07-20 20:27:32 -07:00
|
|
|
#include "otamanager.h"
|
2021-12-26 05:36:29 -08:00
|
|
|
#include "librarywidget.h"
|
2022-06-23 08:10:38 -07:00
|
|
|
#include "locallibrarywidget.h"
|
2022-06-28 23:15:13 -07:00
|
|
|
#include "homepagewidget.h"
|
2021-04-23 19:23:24 -07:00
|
|
|
|
2021-03-25 05:00:19 -07:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
namespace Ui { class MainWindow; }
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-04-04 21:47:15 -07:00
|
|
|
QString className = this->metaObject()->className();
|
2021-03-25 05:00:19 -07:00
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
2021-04-23 19:23:24 -07:00
|
|
|
|
|
|
|
float stdIconWidth;
|
|
|
|
float stdIconHeight;
|
|
|
|
float brightnessIconWidth;
|
|
|
|
float brightnessIconHeight;
|
|
|
|
float homeIconWidth;
|
|
|
|
float homeIconHeight;
|
2021-07-13 12:18:59 -07:00
|
|
|
float wifiIconWidth;
|
|
|
|
float wifiIconHeight;
|
2021-04-23 19:23:24 -07:00
|
|
|
float sW;
|
|
|
|
float sH;
|
2022-04-03 19:44:46 -07:00
|
|
|
int truncateThreshold;
|
2021-04-23 19:23:24 -07:00
|
|
|
|
2021-03-25 05:00:19 -07:00
|
|
|
bool existing_recent_books = false;
|
2021-03-27 12:13:37 -07:00
|
|
|
bool reboot_after_update = false;
|
2022-01-27 21:44:23 -08:00
|
|
|
bool resetFullWindowException;
|
2022-03-11 17:44:26 -08:00
|
|
|
bool wifiIconClickedWhileReconnecting;
|
2022-04-02 07:27:44 -07:00
|
|
|
int lastWifiState;
|
2021-04-01 05:58:37 -07:00
|
|
|
int timerTime = 0;
|
2021-03-25 05:00:19 -07:00
|
|
|
QString relative_path;
|
2021-06-29 07:19:21 -07:00
|
|
|
QString usbmsStatus;
|
2021-04-23 05:47:05 -07:00
|
|
|
|
|
|
|
void openLowBatteryDialog();
|
|
|
|
void openCriticalBatteryAlertWindow();
|
2021-05-09 11:07:05 -07:00
|
|
|
void openUsbmsDialog();
|
2021-04-23 19:23:24 -07:00
|
|
|
void resetIcons();
|
2021-06-23 08:26:00 -07:00
|
|
|
void setBatteryIcon();
|
2021-07-13 12:18:59 -07:00
|
|
|
bool checkWifiState();
|
2021-04-23 05:47:05 -07:00
|
|
|
|
2021-03-25 05:00:19 -07:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_settingsBtn_clicked();
|
|
|
|
void on_appsBtn_clicked();
|
|
|
|
void on_pushButton_clicked();
|
|
|
|
void on_searchBtn_clicked();
|
|
|
|
void on_quitBtn_clicked();
|
2021-03-29 18:47:21 -07:00
|
|
|
void on_brightnessBtn_clicked();
|
2021-04-01 05:58:37 -07:00
|
|
|
void openUpdateDialog();
|
2021-07-13 22:24:30 -07:00
|
|
|
void openWifiDialog();
|
2021-06-28 16:57:40 -07:00
|
|
|
void setInitialBrightness();
|
2021-04-23 19:23:24 -07:00
|
|
|
void on_homeBtn_clicked();
|
2021-07-05 13:01:32 -07:00
|
|
|
void refreshScreen();
|
2021-07-05 19:21:20 -07:00
|
|
|
void setupSearchDialog();
|
2021-07-13 12:18:59 -07:00
|
|
|
void setWifiIcon();
|
2021-07-13 22:24:30 -07:00
|
|
|
void on_wifiBtn_clicked();
|
|
|
|
void updateWifiIcon(int mode);
|
|
|
|
void hello(int testNumber);
|
2021-07-14 15:23:54 -07:00
|
|
|
void showToast(QString messageToDisplay);
|
|
|
|
void closeIndefiniteToast();
|
2021-07-20 20:27:32 -07:00
|
|
|
void openUpdateDialogOTA(bool open);
|
2021-08-19 08:11:16 -07:00
|
|
|
void launchOtaUpdater();
|
2021-09-05 06:37:07 -07:00
|
|
|
void openBookFile(QString book, bool relativePath);
|
2021-09-05 08:47:09 -07:00
|
|
|
void openReaderFramework();
|
2021-09-26 13:46:25 -07:00
|
|
|
void checkForUpdate();
|
2022-02-18 08:06:09 -08:00
|
|
|
void checkForOtaUpdate();
|
2021-12-31 12:50:59 -08:00
|
|
|
void openEncfsRepackDialog();
|
2021-12-26 05:36:29 -08:00
|
|
|
void on_libraryButton_clicked();
|
2022-01-04 16:06:47 -08:00
|
|
|
void resetWindow(bool resetStackedWidget);
|
|
|
|
void resetFullWindow();
|
2022-03-11 17:44:26 -08:00
|
|
|
void resetWifiIconClickedWhileReconnecting();
|
2022-06-23 08:10:38 -07:00
|
|
|
void setupLocalLibraryWidget();
|
2022-06-27 15:14:20 -07:00
|
|
|
void setupHomePageWidget();
|
2021-12-26 05:36:29 -08:00
|
|
|
|
2021-03-25 05:00:19 -07:00
|
|
|
private:
|
2021-12-26 05:36:29 -08:00
|
|
|
Ui::MainWindow * ui;
|
|
|
|
settingsChooser * settingsChooserWindow;
|
|
|
|
apps * appsWindow;
|
|
|
|
reader * readerWindow;
|
|
|
|
quit * quitWindow;
|
|
|
|
alert * alertWindow;
|
|
|
|
usbms_splash * usbmsWindow;
|
|
|
|
brightnessDialog * brightnessDialogWindow;
|
|
|
|
generalDialog * generalDialogWindow;
|
|
|
|
koboxSettings * koboxSettingsWindow;
|
|
|
|
koboxAppsDialog * koboxAppsDialogWindow;
|
|
|
|
textwidget * textwidgetWindow;
|
|
|
|
virtualkeypad * keypadWidget;
|
|
|
|
toast * toastWindow;
|
|
|
|
otaManager * otaManagerWindow;
|
|
|
|
libraryWidget * libraryWidgetWindow;
|
2022-06-23 08:10:38 -07:00
|
|
|
localLibraryWidget * localLibraryWidgetWindow;
|
2022-06-28 23:15:13 -07:00
|
|
|
homePageWidget * homePageWidgetWindow;
|
2021-03-25 05:00:19 -07:00
|
|
|
};
|
2021-06-28 13:13:44 -07:00
|
|
|
|
2021-03-25 05:00:19 -07:00
|
|
|
#endif // MAINWINDOW_H
|