quill/mainwindow.h
Nicolas Mailloux 6155e9344e Fix MainWindow tabSwitcher bug
When an user would click another button-tab (e.g. Settings or Apps)
after launching libraryWidget, InkBox would reset the window entirely
and get back to the Home widget. The user would then have had to re-
click on the button-tab he wanted to pick to get the appropriate
content.

This commit fixes this issue by requiring a resetFullWindowException
boolean variable to be set to false (meaning that the user didn't click
on any button-tab before leaving libraryWidget) for the
resetWindow(true) function to occur as described in resetFullWindow(),
when libraryWidget is destroyed.
2022-01-28 00:44:23 -05:00

118 lines
3 KiB
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "settings.h"
#include "settingschooser.h"
#include "apps.h"
#include "reader.h"
#include "quit.h"
#include "alert.h"
#include "usbms_splash.h"
#include "brightnessdialog.h"
#include "generaldialog.h"
#include "koboxsettings.h"
#include "koboxappsdialog.h"
#include "textwidget.h"
#include "virtualkeypad.h"
#include "toast.h"
#include "otamanager.h"
#include "librarywidget.h"
using namespace std;
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
float stdIconWidth;
float stdIconHeight;
float brightnessIconWidth;
float brightnessIconHeight;
float homeIconWidth;
float homeIconHeight;
float wifiIconWidth;
float wifiIconHeight;
float sW;
float sH;
int truncateTreshold;
bool existing_recent_books = false;
bool reboot_after_update = false;
bool resetFullWindowException;
int timerTime = 0;
QString relative_path;
QString usbmsStatus;
void openLowBatteryDialog();
void openCriticalBatteryAlertWindow();
void openUsbmsDialog();
void resetIcons();
void setBatteryIcon();
int testPing();
bool checkWifiState();
public slots:
private slots:
void on_settingsBtn_clicked();
void on_appsBtn_clicked();
void on_pushButton_clicked();
void on_searchBtn_clicked();
void on_quitBtn_clicked();
void on_book1Btn_clicked();
void on_book2Btn_clicked();
void on_book3Btn_clicked();
void on_book4Btn_clicked();
void on_brightnessBtn_clicked();
void openUpdateDialog();
void openWifiDialog();
void setInitialBrightness();
void on_homeBtn_clicked();
void refreshScreen();
void setupSearchDialog();
void setWifiIcon();
void on_wifiBtn_clicked();
void updateWifiIcon(int mode);
void hello(int testNumber);
void showToast(QString messageToDisplay);
void closeIndefiniteToast();
void openUpdateDialogOTA(bool open);
void launchOtaUpdater();
void openBookFile(QString book, bool relativePath);
void openReaderFramework();
void checkForUpdate();
void openEncfsRepackDialog();
void on_libraryButton_clicked();
void resetWindow(bool resetStackedWidget);
void resetFullWindow();
void setRecentBooksLabelsTruncateTreshold();
private:
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;
};
#endif // MAINWINDOW_H