Duckstation/src/duckstation-qt/gamepropertiesdialog.h

69 lines
1.8 KiB
C
Raw Normal View History

2020-05-16 10:02:44 +00:00
#pragma once
#include "frontend-common/game_settings.h"
2020-05-16 10:02:44 +00:00
#include "ui_gamepropertiesdialog.h"
#include <QtWidgets/QDialog>
#include <array>
2020-05-16 10:02:44 +00:00
struct GameListEntry;
struct GameListCompatibilityEntry;
2020-05-16 10:02:44 +00:00
class QtHostInterface;
class GamePropertiesDialog final : public QDialog
{
Q_OBJECT
public:
GamePropertiesDialog(QtHostInterface* host_interface, QWidget* parent = nullptr);
~GamePropertiesDialog();
2020-08-29 12:42:28 +00:00
static void showForEntry(QtHostInterface* host_interface, const GameListEntry* ge, QWidget* parent);
2020-05-16 10:02:44 +00:00
public Q_SLOTS:
void clear();
void populate(const GameListEntry* ge);
protected:
void closeEvent(QCloseEvent* ev);
void resizeEvent(QResizeEvent* ev);
private Q_SLOTS:
void saveCompatibilityInfo();
void saveCompatibilityInfoIfChanged();
void setCompatibilityInfoChanged();
void onSetVersionTestedToCurrentClicked();
void onComputeHashClicked();
void onVerifyDumpClicked();
void onExportCompatibilityInfoClicked();
void updateCPUClockSpeedLabel();
2020-05-16 10:02:44 +00:00
private:
void setupAdditionalUi();
void connectUi();
void populateCompatibilityInfo(const std::string& game_code);
void populateTracksInfo(const std::string& image_path);
void populateGameSettings();
void populateBooleanUserSetting(QCheckBox* cb, const std::optional<bool>& value);
void connectBooleanUserSetting(QCheckBox* cb, std::optional<bool>* value);
void saveGameSettings();
void fillEntryFromUi(GameListCompatibilityEntry* entry);
void computeTrackHashes();
2020-05-16 10:02:44 +00:00
void onResize();
2021-04-29 16:48:48 +00:00
void onUserAspectRatioChanged();
2020-05-16 10:02:44 +00:00
Ui::GamePropertiesDialog m_ui;
std::array<QCheckBox*, static_cast<u32>(GameSettings::Trait::Count)> m_trait_checkboxes{};
2020-05-16 10:02:44 +00:00
QtHostInterface* m_host_interface;
std::string m_path;
std::string m_game_code;
std::string m_game_title;
GameSettings::Entry m_game_settings;
2020-05-16 10:02:44 +00:00
bool m_compatibility_info_changed = false;
bool m_tracks_hashed = false;
2020-05-16 10:02:44 +00:00
};