2019-12-31 06:17:17 +00:00
|
|
|
#pragma once
|
|
|
|
#include <QtCore/QThread>
|
|
|
|
#include <QtWidgets/QLabel>
|
|
|
|
#include <QtWidgets/QMainWindow>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "settingsdialog.h"
|
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
2020-01-24 04:49:47 +00:00
|
|
|
class QLabel;
|
2020-02-15 15:14:28 +00:00
|
|
|
class QThread;
|
2020-01-24 04:49:47 +00:00
|
|
|
|
2019-12-31 06:17:17 +00:00
|
|
|
class GameListWidget;
|
|
|
|
class QtHostInterface;
|
|
|
|
|
2020-03-02 01:08:16 +00:00
|
|
|
struct GameListEntry;
|
|
|
|
|
2020-01-24 04:50:56 +00:00
|
|
|
class MainWindow final : public QMainWindow
|
2019-12-31 06:17:17 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QtHostInterface* host_interface);
|
|
|
|
~MainWindow();
|
|
|
|
|
2020-01-06 06:27:39 +00:00
|
|
|
private Q_SLOTS:
|
2020-02-15 15:14:30 +00:00
|
|
|
void reportError(const QString& message);
|
|
|
|
void reportMessage(const QString& message);
|
2020-02-26 09:25:57 +00:00
|
|
|
bool confirmMessage(const QString& message);
|
2020-02-15 15:14:28 +00:00
|
|
|
void createDisplayWindow(QThread* worker_thread, bool use_debug_device);
|
|
|
|
void destroyDisplayWindow();
|
2020-02-26 09:25:51 +00:00
|
|
|
void setFullscreen(bool fullscreen);
|
2020-02-15 15:14:28 +00:00
|
|
|
void toggleFullscreen();
|
2020-02-26 09:26:14 +00:00
|
|
|
void focusDisplayWidget();
|
2019-12-31 06:17:17 +00:00
|
|
|
void onEmulationStarted();
|
|
|
|
void onEmulationStopped();
|
|
|
|
void onEmulationPaused(bool paused);
|
2020-02-15 15:15:18 +00:00
|
|
|
void onStateSaved(const QString& game_code, bool global, qint32 slot);
|
2020-02-09 13:16:25 +00:00
|
|
|
void onSystemPerformanceCountersUpdated(float speed, float fps, float vps, float average_frame_time,
|
|
|
|
float worst_frame_time);
|
2020-02-15 15:14:30 +00:00
|
|
|
void onRunningGameChanged(const QString& filename, const QString& game_code, const QString& game_title);
|
2019-12-31 06:17:17 +00:00
|
|
|
|
|
|
|
void onStartDiscActionTriggered();
|
2020-03-02 01:08:16 +00:00
|
|
|
void onStartBIOSActionTriggered();
|
2020-01-24 04:50:40 +00:00
|
|
|
void onChangeDiscFromFileActionTriggered();
|
|
|
|
void onChangeDiscFromGameListActionTriggered();
|
2019-12-31 06:17:17 +00:00
|
|
|
void onGitHubRepositoryActionTriggered();
|
|
|
|
void onIssueTrackerActionTriggered();
|
|
|
|
void onAboutActionTriggered();
|
|
|
|
|
2020-03-02 01:08:16 +00:00
|
|
|
void onGameListEntrySelected(const GameListEntry* entry);
|
|
|
|
void onGameListEntryDoubleClicked(const GameListEntry* entry);
|
|
|
|
void onGameListContextMenuRequested(const QPoint& point, const GameListEntry* entry);
|
|
|
|
|
2020-01-24 04:50:56 +00:00
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent* event) override;
|
|
|
|
|
2019-12-31 06:17:17 +00:00
|
|
|
private:
|
|
|
|
void setupAdditionalUi();
|
|
|
|
void connectSignals();
|
|
|
|
void updateEmulationActions(bool starting, bool running);
|
|
|
|
void switchToGameListView();
|
|
|
|
void switchToEmulationView();
|
2020-01-24 04:50:53 +00:00
|
|
|
SettingsDialog* getSettingsDialog();
|
2019-12-31 06:17:17 +00:00
|
|
|
void doSettings(SettingsDialog::Category category = SettingsDialog::Category::Count);
|
2020-02-05 08:43:25 +00:00
|
|
|
void updateDebugMenuCPUExecutionMode();
|
2020-01-24 04:49:51 +00:00
|
|
|
void updateDebugMenuGPURenderer();
|
2019-12-31 06:17:17 +00:00
|
|
|
|
|
|
|
Ui::MainWindow m_ui;
|
|
|
|
|
|
|
|
QtHostInterface* m_host_interface = nullptr;
|
|
|
|
|
|
|
|
GameListWidget* m_game_list_widget = nullptr;
|
2020-01-06 04:08:00 +00:00
|
|
|
QWidget* m_display_widget = nullptr;
|
2019-12-31 06:17:17 +00:00
|
|
|
|
2020-01-24 04:49:47 +00:00
|
|
|
QLabel* m_status_speed_widget = nullptr;
|
|
|
|
QLabel* m_status_fps_widget = nullptr;
|
|
|
|
QLabel* m_status_frame_time_widget = nullptr;
|
|
|
|
|
2019-12-31 06:17:17 +00:00
|
|
|
SettingsDialog* m_settings_dialog = nullptr;
|
|
|
|
|
|
|
|
bool m_emulation_running = false;
|
|
|
|
};
|