Duckstation/src/duckstation-qt/mainwindow.h

74 lines
2.1 KiB
C
Raw Normal View History

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"
class QLabel;
2019-12-31 06:17:17 +00:00
class GameListWidget;
class QtHostInterface;
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:
void reportError(QString message);
void reportMessage(QString message);
2019-12-31 06:17:17 +00:00
void onEmulationStarting();
void onEmulationStarted();
void onEmulationStopped();
void onEmulationPaused(bool paused);
2020-01-06 06:27:39 +00:00
void toggleFullscreen();
2020-01-24 04:49:51 +00:00
void recreateDisplayWidget(bool create_device_context);
void onSystemPerformanceCountersUpdated(float speed, float fps, float vps, float average_frame_time,
float worst_frame_time);
void onRunningGameChanged(QString filename, QString game_code, QString game_title);
2019-12-31 06:17:17 +00:00
void onStartDiscActionTriggered();
2020-01-24 04:50:40 +00:00
void onChangeDiscFromFileActionTriggered();
void onChangeDiscFromGameListActionTriggered();
2019-12-31 06:17:17 +00:00
void onStartBiosActionTriggered();
void onGitHubRepositoryActionTriggered();
void onIssueTrackerActionTriggered();
void onAboutActionTriggered();
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();
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();
2020-01-24 04:50:42 +00:00
void populateLoadSaveStateMenus(QString game_code);
2019-12-31 06:17:17 +00:00
Ui::MainWindow m_ui;
QtHostInterface* m_host_interface = nullptr;
GameListWidget* m_game_list_widget = nullptr;
QWidget* m_display_widget = nullptr;
2019-12-31 06:17:17 +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;
};