2018-10-06 20:41:18 -07:00
|
|
|
#pragma once
|
2017-12-05 19:31:43 -08:00
|
|
|
|
2019-08-25 17:50:17 -07:00
|
|
|
#include <memory>
|
|
|
|
|
2017-12-05 19:31:43 -08:00
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QProcess>
|
2018-01-03 15:53:01 -08:00
|
|
|
#include <QTextCursor>
|
2020-04-18 03:08:11 -07:00
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QRadioButton>
|
2019-08-25 17:50:17 -07:00
|
|
|
|
|
|
|
#include "Common.hpp"
|
2017-12-25 20:27:18 -08:00
|
|
|
#include "DownloadManager.hpp"
|
2019-08-25 17:50:17 -07:00
|
|
|
|
|
|
|
#include <hecl/CVarCommons.hpp>
|
|
|
|
#include <hecl/Runtime.hpp>
|
|
|
|
|
2017-12-26 16:48:34 -08:00
|
|
|
class QPushButton;
|
2019-08-25 17:50:17 -07:00
|
|
|
class QTextCharFormat;
|
|
|
|
class QTextEdit;
|
2018-01-09 22:19:48 -08:00
|
|
|
class QuaZip;
|
2017-12-05 19:31:43 -08:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
2020-04-18 03:08:11 -07:00
|
|
|
} // namespace Ui
|
2017-12-05 19:31:43 -08:00
|
|
|
|
2018-12-07 21:19:40 -08:00
|
|
|
class MainWindow : public QMainWindow {
|
2019-06-29 11:02:33 -07:00
|
|
|
static const QStringList skUpdateTracks;
|
2018-12-07 21:19:40 -08:00
|
|
|
Q_OBJECT
|
2019-08-25 17:50:17 -07:00
|
|
|
std::unique_ptr<Ui::MainWindow> m_ui;
|
2018-12-07 21:19:40 -08: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;
|
2021-02-27 18:35:15 -08:00
|
|
|
QStringList m_warpSettings;
|
2018-12-07 21:19:40 -08:00
|
|
|
QSettings m_settings;
|
|
|
|
URDEVersion m_recommendedVersion;
|
|
|
|
bool m_inContinueNote = false;
|
2020-04-18 14:16:08 -07:00
|
|
|
QStringListModel m_launchOptionsModel;
|
2018-12-07 21:19:40 -08:00
|
|
|
|
2017-12-05 19:31:43 -08:00
|
|
|
public:
|
2019-08-25 17:50:17 -07:00
|
|
|
explicit MainWindow(QWidget* parent = nullptr);
|
2019-08-30 00:40:25 -07:00
|
|
|
~MainWindow() override;
|
|
|
|
|
2018-12-07 21:19:40 -08:00
|
|
|
void setTextTermFormatting(const QString& text);
|
|
|
|
void insertContinueNote(const QString& text);
|
2019-08-30 00:40:25 -07:00
|
|
|
|
2017-12-05 19:31:43 -08:00
|
|
|
private slots:
|
2018-12-07 21:19:40 -08:00
|
|
|
void onExtract();
|
2019-08-25 20:19:55 -07:00
|
|
|
void onExtractFinished(int exitCode, QProcess::ExitStatus);
|
2018-12-07 21:19:40 -08:00
|
|
|
void onPackage();
|
2019-08-25 20:19:55 -07:00
|
|
|
void onPackageFinished(int exitCode, QProcess::ExitStatus);
|
2018-12-07 21:19:40 -08:00
|
|
|
void onLaunch();
|
2019-08-25 20:19:55 -07:00
|
|
|
void onLaunchFinished(int exitCode, QProcess::ExitStatus);
|
2018-12-07 21:19:40 -08:00
|
|
|
void doHECLTerminate();
|
|
|
|
void onReturnPressed();
|
|
|
|
void onDownloadPressed();
|
2021-03-18 21:31:34 -07:00
|
|
|
// void onUpdateURDEPressed();
|
2019-06-29 11:02:33 -07:00
|
|
|
void onUpdateTrackChanged(int index);
|
2018-12-07 21:19:40 -08:00
|
|
|
|
2017-12-05 19:31:43 -08:00
|
|
|
private:
|
2018-12-07 21:19:40 -08: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 03:08:11 -07: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-05 19:31:43 -08:00
|
|
|
};
|