2021-11-23 15:34:23 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QCheckBox>
|
2022-08-15 11:14:37 -04:00
|
|
|
#include <QComboBox>
|
2022-04-10 17:43:05 -04:00
|
|
|
#include <QFormLayout>
|
2022-08-15 11:14:37 -04:00
|
|
|
#include <QGridLayout>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QPushButton>
|
2022-04-17 21:17:58 -04:00
|
|
|
#include <QScrollArea>
|
2022-08-15 11:14:37 -04:00
|
|
|
#include <QTreeWidget>
|
2021-11-23 15:34:23 -05:00
|
|
|
|
2022-03-10 10:03:17 -05:00
|
|
|
#include "headline.h"
|
2022-08-15 11:14:37 -04:00
|
|
|
#include "launchercore.h"
|
2021-11-23 15:34:23 -05:00
|
|
|
|
|
|
|
class LauncherWindow : public QMainWindow {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-10-13 13:20:09 -04:00
|
|
|
explicit LauncherWindow(LauncherCore& new_headline, QWidget* parent = nullptr);
|
2021-11-23 15:34:23 -05:00
|
|
|
|
|
|
|
ProfileSettings& currentProfile();
|
|
|
|
|
2022-09-05 17:26:26 -04:00
|
|
|
void openPath(const QString& path);
|
2022-02-24 09:28:11 -05:00
|
|
|
|
2021-11-23 15:34:23 -05:00
|
|
|
public slots:
|
|
|
|
void reloadControls();
|
|
|
|
|
|
|
|
private:
|
2022-04-17 21:17:58 -04:00
|
|
|
void reloadNews();
|
|
|
|
|
2021-11-23 15:34:23 -05:00
|
|
|
LauncherCore& core;
|
|
|
|
|
2022-03-10 10:03:17 -05:00
|
|
|
Headline headline;
|
|
|
|
|
2021-11-23 15:34:23 -05:00
|
|
|
bool currentlyReloadingControls = false;
|
|
|
|
|
2022-04-10 16:58:29 -04:00
|
|
|
QGridLayout* layout;
|
2022-04-10 17:43:05 -04:00
|
|
|
QFormLayout* loginLayout;
|
2022-04-10 16:58:29 -04:00
|
|
|
|
2022-04-17 21:17:58 -04:00
|
|
|
QScrollArea* bannerScrollArea;
|
|
|
|
QWidget* bannerParentWidget;
|
|
|
|
QHBoxLayout* bannerLayout;
|
2022-03-10 10:03:17 -05:00
|
|
|
QTreeWidget* newsListView;
|
2022-04-17 21:17:58 -04:00
|
|
|
QTimer* bannerTimer = nullptr;
|
|
|
|
int currentBanner = 0;
|
|
|
|
|
|
|
|
std::vector<QLabel*> bannerWidgets;
|
2022-03-10 10:03:17 -05:00
|
|
|
|
2022-04-09 16:56:17 -04:00
|
|
|
QAction* launchOfficial;
|
|
|
|
QAction* launchSysInfo;
|
|
|
|
QAction* launchCfgBackup;
|
|
|
|
QAction* openGameDir;
|
|
|
|
|
2021-11-23 15:34:23 -05:00
|
|
|
QComboBox* profileSelect;
|
2022-08-15 11:14:37 -04:00
|
|
|
QLineEdit *usernameEdit, *passwordEdit;
|
2021-11-23 15:34:23 -05:00
|
|
|
QLineEdit* otpEdit;
|
2022-08-15 11:14:37 -04:00
|
|
|
QCheckBox *rememberUsernameBox, *rememberPasswordBox;
|
|
|
|
QPushButton *loginButton, *registerButton;
|
2022-04-09 17:28:24 -04:00
|
|
|
|
|
|
|
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
|
|
|
|
QAction* wineCfg;
|
|
|
|
#endif
|
2021-11-23 15:34:23 -05:00
|
|
|
};
|