metaforce/hecl-gui/MainWindow.hpp

67 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;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
2018-01-10 06:19:48 +00:00
hecl::Runtime::FileStoreManager m_fileMgr;
hecl::CVarManager m_cvarManager;
hecl::CVarCommons m_cvarCommons;
2017-12-06 03:31:43 +00:00
Ui::MainWindow* m_ui;
2018-01-03 23:53:01 +00:00
QTextCursor m_cursor;
2017-12-06 03:31:43 +00:00
QString m_path;
QString m_urdePath;
QString m_heclPath;
2017-12-06 03:31:43 +00:00
QProcess m_heclProc;
DownloadManager m_dlManager;
2018-01-10 06:19:48 +00:00
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:
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:
void onExtract();
void onExtractFinished(int exitCode);
void onPackage();
void onPackageFinished(int exitCode);
void onLaunch();
void onLaunchFinished(int exitCode);
void doHECLTerminate();
2017-12-06 03:31:43 +00:00
void onReturnPressed();
void onDownloadPressed();
void onUpdateURDEPressed();
2017-12-06 03:31:43 +00:00
private:
bool checkDownloadedBinary();
void setPath(const QString& path);
2017-12-06 03:31:43 +00:00
void initSlots();
void onIndexDownloaded(const QStringList& index);
2018-01-10 06:19:48 +00:00
void onBinaryDownloaded(QuaZip& file);
void onBinaryFailed();
void disableOperations();
void enableOperations();
bool isPackageComplete() const;
2017-12-06 03:31:43 +00:00
};