mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
Qt: add version update hint to game list
This commit is contained in:
parent
40142420c1
commit
ec2d882199
3 changed files with 15 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
#include "game_compatibility.h"
|
#include "game_compatibility.h"
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
@ -73,6 +73,9 @@ bool game_compatibility::ReadJSON(const QJsonObject& json_data, bool after_downl
|
||||||
// Add date if possible
|
// Add date if possible
|
||||||
status.date = json_result.value("date").toString();
|
status.date = json_result.value("date").toString();
|
||||||
|
|
||||||
|
// Add version if possible
|
||||||
|
status.version = json_result.value("update").toString();
|
||||||
|
|
||||||
// Add status to map
|
// Add status to map
|
||||||
m_compat_database.emplace(std::pair<std::string, compat_status>(sstr(key), status));
|
m_compat_database.emplace(std::pair<std::string, compat_status>(sstr(key), status));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ struct compat_status
|
||||||
QString color;
|
QString color;
|
||||||
QString text;
|
QString text;
|
||||||
QString tooltip;
|
QString tooltip;
|
||||||
|
QString version;
|
||||||
};
|
};
|
||||||
|
|
||||||
class game_compatibility : public QObject
|
class game_compatibility : public QObject
|
||||||
|
|
|
@ -1300,11 +1300,19 @@ int game_list_frame::PopulateGameList()
|
||||||
compat_item->setData(Qt::DecorationRole, compat_pixmap(game->compat.color));
|
compat_item->setData(Qt::DecorationRole, compat_pixmap(game->compat.color));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Version
|
||||||
|
QString app_version = qstr(game->info.app_ver);
|
||||||
|
|
||||||
|
if (!game->compat.version.isEmpty() && (app_version == category::unknown || game->compat.version.toDouble() > app_version.toDouble()))
|
||||||
|
{
|
||||||
|
app_version = tr("%0 (Update available: %1)").arg(app_version, game->compat.version);
|
||||||
|
}
|
||||||
|
|
||||||
m_gameList->setItem(row, gui::column_icon, icon_item);
|
m_gameList->setItem(row, gui::column_icon, icon_item);
|
||||||
m_gameList->setItem(row, gui::column_name, title_item);
|
m_gameList->setItem(row, gui::column_name, title_item);
|
||||||
m_gameList->setItem(row, gui::column_serial, serial_item);
|
m_gameList->setItem(row, gui::column_serial, serial_item);
|
||||||
m_gameList->setItem(row, gui::column_firmware, new custom_table_widget_item(game->info.fw));
|
m_gameList->setItem(row, gui::column_firmware, new custom_table_widget_item(game->info.fw));
|
||||||
m_gameList->setItem(row, gui::column_version, new custom_table_widget_item(game->info.app_ver));
|
m_gameList->setItem(row, gui::column_version, new custom_table_widget_item(app_version));
|
||||||
m_gameList->setItem(row, gui::column_category, new custom_table_widget_item(game->info.category));
|
m_gameList->setItem(row, gui::column_category, new custom_table_widget_item(game->info.category));
|
||||||
m_gameList->setItem(row, gui::column_path, new custom_table_widget_item(game->info.path));
|
m_gameList->setItem(row, gui::column_path, new custom_table_widget_item(game->info.path));
|
||||||
m_gameList->setItem(row, gui::column_move, new custom_table_widget_item(sstr(supports_move ? tr("Supported") : tr("Not Supported")), Qt::UserRole, !supports_move));
|
m_gameList->setItem(row, gui::column_move, new custom_table_widget_item(sstr(supports_move ? tr("Supported") : tr("Not Supported")), Qt::UserRole, !supports_move));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue