2017-12-06 03:31:43 +00:00
|
|
|
#ifndef MAINWINDOW_HPP
|
|
|
|
#define MAINWINDOW_HPP
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QProcess>
|
2018-01-03 23:53:01 +00:00
|
|
|
#include <QTextCursor>
|
2017-12-06 03:31:43 +00:00
|
|
|
#include <memory>
|
2017-12-26 04:27:18 +00:00
|
|
|
#include "DownloadManager.hpp"
|
2018-01-10 06:19:48 +00:00
|
|
|
#include "LaunchMenu.hpp"
|
2017-12-27 00:48:34 +00:00
|
|
|
#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;
|
2017-12-27 00:48:34 +00:00
|
|
|
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;
|
2018-01-02 00:58:38 +00:00
|
|
|
QString m_urdePath;
|
|
|
|
QString m_heclPath;
|
2017-12-06 03:31:43 +00:00
|
|
|
QProcess m_heclProc;
|
2017-12-26 04:27:18 +00:00
|
|
|
DownloadManager m_dlManager;
|
2018-01-10 06:19:48 +00:00
|
|
|
LaunchMenu m_launchMenu;
|
2017-12-27 00:48:34 +00:00
|
|
|
QSettings m_settings;
|
|
|
|
URDEVersion m_recommendedVersion;
|
|
|
|
QPushButton* m_updateURDEButton;
|
2018-01-02 00:58:38 +00:00
|
|
|
bool m_inContinueNote = false;
|
2017-12-06 03:31:43 +00:00
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
|
|
~MainWindow();
|
2018-01-02 00:58:38 +00:00
|
|
|
void setTextTermFormatting(const QString& text);
|
|
|
|
void insertContinueNote(const QString& text);
|
2017-12-06 03:31:43 +00:00
|
|
|
private slots:
|
|
|
|
void onExtract();
|
2018-01-02 00:58:38 +00:00
|
|
|
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();
|
2017-12-27 00:48:34 +00:00
|
|
|
void onDownloadPressed();
|
|
|
|
void onUpdateURDEPressed();
|
2017-12-06 03:31:43 +00:00
|
|
|
private:
|
2018-01-02 00:58:38 +00:00
|
|
|
bool checkDownloadedBinary();
|
2017-12-27 00:48:34 +00:00
|
|
|
void setPath(const QString& path);
|
2017-12-06 03:31:43 +00:00
|
|
|
void initSlots();
|
2017-12-26 04:27:18 +00:00
|
|
|
void onIndexDownloaded(const QStringList& index);
|
2018-01-10 06:19:48 +00:00
|
|
|
void onBinaryDownloaded(QuaZip& file);
|
|
|
|
void onBinaryFailed();
|
2018-01-02 00:58:38 +00:00
|
|
|
void disableOperations();
|
|
|
|
void enableOperations();
|
2018-01-14 06:42:13 +00:00
|
|
|
bool isPackageComplete() const;
|
2017-12-06 03:31:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_HPP
|