2020-05-16 10:02:44 +00:00
|
|
|
#pragma once
|
2020-09-01 02:29:22 +00:00
|
|
|
#include "frontend-common/game_settings.h"
|
2020-05-16 10:02:44 +00:00
|
|
|
#include "ui_gamepropertiesdialog.h"
|
|
|
|
#include <QtWidgets/QDialog>
|
2020-08-20 11:30:11 +00:00
|
|
|
#include <array>
|
2020-05-16 10:02:44 +00:00
|
|
|
|
|
|
|
struct GameListEntry;
|
2020-05-16 10:24:41 +00:00
|
|
|
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();
|
2020-09-30 13:47:01 +00:00
|
|
|
void updateCPUClockSpeedLabel();
|
2020-05-16 10:02:44 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void setupAdditionalUi();
|
|
|
|
void connectUi();
|
|
|
|
void populateCompatibilityInfo(const std::string& game_code);
|
2020-06-07 15:19:54 +00:00
|
|
|
void populateTracksInfo(const std::string& image_path);
|
2020-08-20 11:30:11 +00:00
|
|
|
void populateGameSettings();
|
2020-09-01 14:00:48 +00:00
|
|
|
void populateBooleanUserSetting(QCheckBox* cb, const std::optional<bool>& value);
|
|
|
|
void connectBooleanUserSetting(QCheckBox* cb, std::optional<bool>* value);
|
2020-08-20 11:30:11 +00:00
|
|
|
void saveGameSettings();
|
2020-05-16 10:24:41 +00:00
|
|
|
void fillEntryFromUi(GameListCompatibilityEntry* entry);
|
2020-06-07 15:19:54 +00:00
|
|
|
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;
|
2020-08-20 11:30:11 +00:00
|
|
|
std::array<QCheckBox*, static_cast<u32>(GameSettings::Trait::Count)> m_trait_checkboxes{};
|
2020-05-16 10:02:44 +00:00
|
|
|
|
|
|
|
QtHostInterface* m_host_interface;
|
|
|
|
|
2020-08-20 11:30:11 +00:00
|
|
|
std::string m_path;
|
|
|
|
std::string m_game_code;
|
|
|
|
std::string m_game_title;
|
|
|
|
|
|
|
|
GameSettings::Entry m_game_settings;
|
2020-06-07 15:19:54 +00:00
|
|
|
|
2020-05-16 10:02:44 +00:00
|
|
|
bool m_compatibility_info_changed = false;
|
2020-06-07 15:19:54 +00:00
|
|
|
bool m_tracks_hashed = false;
|
2020-05-16 10:02:44 +00:00
|
|
|
};
|