metaforce/hecl-gui/MainWindow.hpp

69 lines
1.7 KiB
C++
Raw Normal View History

2018-10-07 03:41:18 +00:00
#pragma once
2017-12-06 03:31:43 +00:00
#include <QMainWindow>
#include <QProcess>
2018-01-03 23:53:01 +00:00
#include <QTextCursor>
2017-12-06 03:31:43 +00:00
#include <memory>
#include "DownloadManager.hpp"
2018-01-10 06:19:48 +00:00
#include "LaunchMenu.hpp"
#include "Common.hpp"
2018-01-10 06:19:48 +00:00
#include "hecl/Runtime.hpp"
#include "hecl/CVarCommons.hpp"
2017-12-06 03:31:43 +00:00
class QTextEdit;
class QTextCharFormat;
class QPushButton;
2018-01-10 06:19:48 +00:00
class QuaZip;
2017-12-06 03:31:43 +00:00
namespace Ui {
class MainWindow;
}
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
hecl::Runtime::FileStoreManager m_fileMgr;
hecl::CVarManager m_cvarManager;
hecl::CVarCommons m_cvarCommons;
Ui::MainWindow* m_ui;
QTextCursor m_cursor;
QString m_path;
QString m_urdePath;
QString m_heclPath;
QProcess m_heclProc;
DownloadManager m_dlManager;
LaunchMenu m_launchMenu;
QSettings m_settings;
URDEVersion m_recommendedVersion;
QPushButton* m_updateURDEButton;
bool m_inContinueNote = false;
2017-12-06 03:31:43 +00:00
public:
2018-12-08 05:19:40 +00:00
explicit MainWindow(QWidget* parent = 0);
~MainWindow();
void setTextTermFormatting(const QString& text);
void insertContinueNote(const QString& text);
2017-12-06 03:31:43 +00:00
private slots:
2018-12-08 05:19:40 +00:00
void onExtract();
void onExtractFinished(int exitCode);
void onPackage();
void onPackageFinished(int exitCode);
void onLaunch();
void onLaunchFinished(int exitCode);
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;
2017-12-06 03:31:43 +00:00
};