mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 07:21:25 +12:00
Qt: move compat_status to game_compatibility.h
This commit is contained in:
parent
5492e0eae1
commit
c10e195dba
4 changed files with 19 additions and 19 deletions
|
@ -70,13 +70,13 @@ void game_compatibility::RequestCompatibility(bool online)
|
||||||
QJsonObject json_result = json_results[key].toObject();
|
QJsonObject json_result = json_results[key].toObject();
|
||||||
|
|
||||||
// Retrieve compatibility information from json
|
// Retrieve compatibility information from json
|
||||||
Compat_Status compat_status = Status_Data.at(json_result.value("status").toString("NoResult"));
|
compat_status status = Status_Data.at(json_result.value("status").toString("NoResult"));
|
||||||
|
|
||||||
// Add date if possible
|
// Add date if possible
|
||||||
compat_status.date = json_result.value("date").toString();
|
status.date = json_result.value("date").toString();
|
||||||
|
|
||||||
// Add status to map
|
// Add status to map
|
||||||
m_compat_database.emplace(std::pair<std::string, Compat_Status>(sstr(key), compat_status));
|
m_compat_database.emplace(std::pair<std::string, compat_status>(sstr(key), status));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -220,7 +220,7 @@ void game_compatibility::RequestCompatibility(bool online)
|
||||||
Q_EMIT DownloadStarted();
|
Q_EMIT DownloadStarted();
|
||||||
}
|
}
|
||||||
|
|
||||||
Compat_Status game_compatibility::GetCompatibility(const std::string& title_id)
|
compat_status game_compatibility::GetCompatibility(const std::string& title_id)
|
||||||
{
|
{
|
||||||
if (m_compat_database.empty())
|
if (m_compat_database.empty())
|
||||||
{
|
{
|
||||||
|
@ -234,7 +234,7 @@ Compat_Status game_compatibility::GetCompatibility(const std::string& title_id)
|
||||||
return Status_Data.at("NoResult");
|
return Status_Data.at("NoResult");
|
||||||
}
|
}
|
||||||
|
|
||||||
Compat_Status game_compatibility::GetStatusData(const QString& status)
|
compat_status game_compatibility::GetStatusData(const QString& status)
|
||||||
{
|
{
|
||||||
return Status_Data.at(status);
|
return Status_Data.at(status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,20 @@
|
||||||
|
|
||||||
#include "gui_settings.h"
|
#include "gui_settings.h"
|
||||||
|
|
||||||
|
struct compat_status
|
||||||
|
{
|
||||||
|
int index;
|
||||||
|
QString date;
|
||||||
|
QString color;
|
||||||
|
QString text;
|
||||||
|
QString tooltip;
|
||||||
|
};
|
||||||
|
|
||||||
class game_compatibility : public QObject
|
class game_compatibility : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
const std::map<QString, Compat_Status> Status_Data =
|
const std::map<QString, compat_status> Status_Data =
|
||||||
{
|
{
|
||||||
{ "Playable", { 0, "", "#1ebc61", QObject::tr("Playable"), QObject::tr("Games that can be properly played from start to finish") } },
|
{ "Playable", { 0, "", "#1ebc61", QObject::tr("Playable"), QObject::tr("Games that can be properly played from start to finish") } },
|
||||||
{ "Ingame", { 1, "", "#f9b32f", QObject::tr("Ingame"), QObject::tr("Games that either can't be finished, have serious glitches or have insufficient performance") } },
|
{ "Ingame", { 1, "", "#f9b32f", QObject::tr("Ingame"), QObject::tr("Games that either can't be finished, have serious glitches or have insufficient performance") } },
|
||||||
|
@ -38,7 +47,7 @@ class game_compatibility : public QObject
|
||||||
std::unique_ptr<QTimer> m_progress_timer;
|
std::unique_ptr<QTimer> m_progress_timer;
|
||||||
std::unique_ptr<QProgressDialog> m_progress_dialog;
|
std::unique_ptr<QProgressDialog> m_progress_dialog;
|
||||||
std::unique_ptr<QNetworkAccessManager> m_network_access_manager;
|
std::unique_ptr<QNetworkAccessManager> m_network_access_manager;
|
||||||
std::map<std::string, Compat_Status> m_compat_database;
|
std::map<std::string, compat_status> m_compat_database;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Handles reads, writes and downloads for the compatibility database */
|
/** Handles reads, writes and downloads for the compatibility database */
|
||||||
|
@ -48,10 +57,10 @@ public:
|
||||||
void RequestCompatibility(bool online = false);
|
void RequestCompatibility(bool online = false);
|
||||||
|
|
||||||
/** Returns the compatibility status for the requested title */
|
/** Returns the compatibility status for the requested title */
|
||||||
Compat_Status GetCompatibility(const std::string& title_id);
|
compat_status GetCompatibility(const std::string& title_id);
|
||||||
|
|
||||||
/** Returns the data for the requested status */
|
/** Returns the data for the requested status */
|
||||||
Compat_Status GetStatusData(const QString& status);
|
compat_status GetStatusData(const QString& status);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void DownloadStarted();
|
void DownloadStarted();
|
||||||
|
|
|
@ -163,7 +163,7 @@ namespace sound
|
||||||
struct GUI_GameInfo
|
struct GUI_GameInfo
|
||||||
{
|
{
|
||||||
GameInfo info;
|
GameInfo info;
|
||||||
Compat_Status compat;
|
compat_status compat;
|
||||||
QImage icon;
|
QImage icon;
|
||||||
QPixmap pxmap;
|
QPixmap pxmap;
|
||||||
bool bootable;
|
bool bootable;
|
||||||
|
|
|
@ -10,15 +10,6 @@
|
||||||
#include <QBitmap>
|
#include <QBitmap>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
struct Compat_Status
|
|
||||||
{
|
|
||||||
int index;
|
|
||||||
QString date;
|
|
||||||
QString color;
|
|
||||||
QString text;
|
|
||||||
QString tooltip;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct gui_save
|
struct gui_save
|
||||||
{
|
{
|
||||||
QString key;
|
QString key;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue