2020-05-30 04:37:06 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2020-06-01 03:39:08 +00:00
|
|
|
#include <memory>
|
2020-06-01 03:58:19 +00:00
|
|
|
#include "timer.h"
|
2020-06-03 03:35:01 +00:00
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
|
|
|
#include "../../Analyser/Static/StaticAnalyser.hpp"
|
|
|
|
#include "../../Machines/Utility/MachineForTarget.hpp"
|
2020-05-30 04:37:06 +00:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
namespace Ui { class MainWindow; }
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2020-06-01 03:39:08 +00:00
|
|
|
class MainWindow : public QMainWindow {
|
|
|
|
Q_OBJECT
|
2020-05-30 04:37:06 +00:00
|
|
|
|
2020-06-01 03:39:08 +00:00
|
|
|
void createActions();
|
2020-05-30 04:37:06 +00:00
|
|
|
|
2020-06-01 03:39:08 +00:00
|
|
|
public:
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<Ui::MainWindow> ui;
|
2020-06-01 03:58:19 +00:00
|
|
|
std::unique_ptr<QTimer> qTimer;
|
|
|
|
std::unique_ptr<QThread> timerThread;
|
|
|
|
std::unique_ptr<Timer> timer;
|
|
|
|
|
2020-06-03 03:35:01 +00:00
|
|
|
// Initial setup stuff.
|
|
|
|
Analyser::Static::TargetList targets;
|
|
|
|
enum class UIPhase {
|
|
|
|
NoFileSelected, RequestingROMs, RunningMachine
|
|
|
|
} uiPhase = UIPhase::NoFileSelected;
|
|
|
|
void launchMachine();
|
|
|
|
|
|
|
|
QString romRequestBaseText;
|
|
|
|
std::vector<ROMMachine::ROM> missingRoms;
|
|
|
|
|
|
|
|
// File drag and drop is supported.
|
|
|
|
void dragEnterEvent(QDragEnterEvent* event) override;
|
|
|
|
void dropEvent(QDropEvent* event) override;
|
2020-06-01 03:39:08 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void open();
|
2020-05-30 04:37:06 +00:00
|
|
|
};
|
2020-06-01 03:39:08 +00:00
|
|
|
|
2020-05-30 04:37:06 +00:00
|
|
|
#endif // MAINWINDOW_H
|