2018-10-07 03:41:18 +00:00
|
|
|
#pragma once
|
2017-12-06 03:31:43 +00:00
|
|
|
|
2019-08-26 00:50:17 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2017-12-06 03:31:43 +00:00
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QProcess>
|
2018-01-03 23:53:01 +00:00
|
|
|
#include <QTextCursor>
|
2020-04-18 10:08:11 +00:00
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QRadioButton>
|
2019-08-26 00:50:17 +00:00
|
|
|
|
|
|
|
#include "Common.hpp"
|
2017-12-26 04:27:18 +00:00
|
|
|
#include "DownloadManager.hpp"
|
2019-08-26 00:50:17 +00:00
|
|
|
|
|
|
|
#include <hecl/CVarCommons.hpp>
|
|
|
|
#include <hecl/Runtime.hpp>
|
|
|
|
|
2017-12-27 00:48:34 +00:00
|
|
|
class QPushButton;
|
2019-08-26 00:50:17 +00:00
|
|
|
class QTextCharFormat;
|
|
|
|
class QTextEdit;
|
2018-01-10 06:19:48 +00:00
|
|
|
class QuaZip;
|
2017-12-06 03:31:43 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
2020-04-18 10:08:11 +00:00
|
|
|
} // namespace Ui
|
2017-12-06 03:31:43 +00:00
|
|
|
|
2018-12-08 05:19:40 +00:00
|
|
|
class MainWindow : public QMainWindow {
|
2019-06-29 18:02:33 +00:00
|
|
|
static const QStringList skUpdateTracks;
|
2018-12-08 05:19:40 +00:00
|
|
|
Q_OBJECT
|
2019-08-26 00:50:17 +00:00
|
|
|
std::unique_ptr<Ui::MainWindow> m_ui;
|
2018-12-08 05:19:40 +00:00
|
|
|
hecl::Runtime::FileStoreManager m_fileMgr;
|
|
|
|
hecl::CVarManager m_cvarManager;
|
|
|
|
hecl::CVarCommons m_cvarCommons;
|
|
|
|
QTextCursor m_cursor;
|
|
|
|
QString m_path;
|
|
|
|
QString m_urdePath;
|
|
|
|
QString m_heclPath;
|
|
|
|
QProcess m_heclProc;
|
|
|
|
DownloadManager m_dlManager;
|
|
|
|
QSettings m_settings;
|
|
|
|
URDEVersion m_recommendedVersion;
|
|
|
|
QPushButton* m_updateURDEButton;
|
|
|
|
bool m_inContinueNote = false;
|
2020-04-18 21:16:08 +00:00
|
|
|
QStringListModel m_launchOptionsModel;
|
2018-12-08 05:19:40 +00:00
|
|
|
|
2017-12-06 03:31:43 +00:00
|
|
|
public:
|
2019-08-26 00:50:17 +00:00
|
|
|
explicit MainWindow(QWidget* parent = nullptr);
|
2019-08-30 07:40:25 +00:00
|
|
|
~MainWindow() override;
|
|
|
|
|
2018-12-08 05:19:40 +00:00
|
|
|
void setTextTermFormatting(const QString& text);
|
|
|
|
void insertContinueNote(const QString& text);
|
2019-08-30 07:40:25 +00:00
|
|
|
|
2017-12-06 03:31:43 +00:00
|
|
|
private slots:
|
2018-12-08 05:19:40 +00:00
|
|
|
void onExtract();
|
2019-08-26 03:19:55 +00:00
|
|
|
void onExtractFinished(int exitCode, QProcess::ExitStatus);
|
2018-12-08 05:19:40 +00:00
|
|
|
void onPackage();
|
2019-08-26 03:19:55 +00:00
|
|
|
void onPackageFinished(int exitCode, QProcess::ExitStatus);
|
2018-12-08 05:19:40 +00:00
|
|
|
void onLaunch();
|
2019-08-26 03:19:55 +00:00
|
|
|
void onLaunchFinished(int exitCode, QProcess::ExitStatus);
|
2018-12-08 05:19:40 +00:00
|
|
|
void doHECLTerminate();
|
|
|
|
void onReturnPressed();
|
|
|
|
void onDownloadPressed();
|
|
|
|
void onUpdateURDEPressed();
|
2019-06-29 18:02:33 +00:00
|
|
|
void onUpdateTrackChanged(int index);
|
2018-12-08 05:19:40 +00:00
|
|
|
|
2017-12-06 03:31:43 +00:00
|
|
|
private:
|
2018-12-08 05:19:40 +00:00
|
|
|
bool checkDownloadedBinary();
|
|
|
|
void setPath(const QString& path);
|
|
|
|
void initSlots();
|
|
|
|
void onIndexDownloaded(const QStringList& index);
|
|
|
|
void onBinaryDownloaded(QuaZip& file);
|
|
|
|
void onBinaryFailed();
|
|
|
|
void disableOperations();
|
|
|
|
void enableOperations();
|
|
|
|
bool isPackageComplete() const;
|
2020-04-18 10:08:11 +00:00
|
|
|
void initOptions();
|
|
|
|
void initGraphicsApiOption(QRadioButton* action, bool hidden, bool isDefault);
|
|
|
|
void initNumberComboOption(QComboBox* action, hecl::CVar* cvar);
|
|
|
|
void initCheckboxOption(QCheckBox* action, hecl::CVar* cvar);
|
2017-12-06 03:31:43 +00:00
|
|
|
};
|