mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
qt_gui: Made compatibility status translatable
This commit is contained in:
parent
c4bfaa6031
commit
c7032df464
@ -260,3 +260,22 @@ void CompatibilityInfoClass::ExtractCompatibilityInfo(QByteArray response) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const QString CompatibilityInfoClass::GetCompatStatusString(const CompatibilityStatus status) {
|
||||
switch (status) {
|
||||
case CompatibilityStatus::Unknown:
|
||||
return tr("Unknown");
|
||||
case CompatibilityStatus::Nothing:
|
||||
return tr("Nothing");
|
||||
case CompatibilityStatus::Boots:
|
||||
return tr("Boots");
|
||||
case CompatibilityStatus::Menus:
|
||||
return tr("Menus");
|
||||
case CompatibilityStatus::Ingame:
|
||||
return tr("Ingame");
|
||||
case CompatibilityStatus::Playable:
|
||||
return tr("Playable");
|
||||
default:
|
||||
return tr("Unknown");
|
||||
}
|
||||
}
|
@ -69,13 +69,6 @@ public:
|
||||
{QStringLiteral("os-windows"), OSType::Win32},
|
||||
};
|
||||
|
||||
inline static const std::unordered_map<CompatibilityStatus, QString> CompatStatusToString = {
|
||||
{CompatibilityStatus::Unknown, QStringLiteral("Unknown")},
|
||||
{CompatibilityStatus::Nothing, QStringLiteral("Nothing")},
|
||||
{CompatibilityStatus::Boots, QStringLiteral("Boots")},
|
||||
{CompatibilityStatus::Menus, QStringLiteral("Menus")},
|
||||
{CompatibilityStatus::Ingame, QStringLiteral("Ingame")},
|
||||
{CompatibilityStatus::Playable, QStringLiteral("Playable")}};
|
||||
inline static const std::unordered_map<OSType, QString> OSTypeToString = {
|
||||
{OSType::Linux, QStringLiteral("os-linux")},
|
||||
{OSType::macOS, QStringLiteral("os-macOS")},
|
||||
@ -87,6 +80,7 @@ public:
|
||||
void UpdateCompatibilityDatabase(QWidget* parent = nullptr, bool forced = false);
|
||||
bool LoadCompatibilityFile();
|
||||
CompatibilityEntry GetCompatibilityInfo(const std::string& serial);
|
||||
const QString GetCompatStatusString(const CompatibilityStatus status);
|
||||
void ExtractCompatibilityInfo(QByteArray response);
|
||||
static bool WaitForReply(QNetworkReply* reply);
|
||||
QNetworkReply* FetchPage(int page_num);
|
||||
|
@ -289,7 +289,7 @@ void GameListFrame::SetCompatibilityItem(int row, int column, CompatibilityEntry
|
||||
QLabel* dotLabel = new QLabel("", widget);
|
||||
dotLabel->setPixmap(circle_pixmap);
|
||||
|
||||
QLabel* label = new QLabel(m_compat_info->CompatStatusToString.at(entry.status), widget);
|
||||
QLabel* label = new QLabel(m_compat_info->GetCompatStatusString(entry.status), widget);
|
||||
|
||||
label->setStyleSheet("color: white; font-size: 16px; font-weight: bold;");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user