mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-14 22:53:15 +00:00
wip: added status column for compat data (#1668)
* wip: added basic gui for compat data * data is currently pulled directly from github API, awaiting server infra * removed unused initalizer * fixes * fix cmake * wip: add some testing date / version * add tooltip * fix nested QJsonObject * fix tooltip color * fix clang-format * Edit style * Add clickable status * formatting * import order * typo * fix clang format 2 --------- Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
This commit is contained in:
parent
b0b74243af
commit
f2a989b9da
9 changed files with 488 additions and 36 deletions
|
@ -3,9 +3,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QPainter>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "background_music_player.h"
|
||||
#include "compatibility_info.h"
|
||||
#include "game_info.h"
|
||||
#include "game_list_utils.h"
|
||||
#include "gui_context_menus.h"
|
||||
|
@ -13,7 +18,9 @@
|
|||
class GameListFrame : public QTableWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GameListFrame(std::shared_ptr<GameInfoClass> game_info_get, QWidget* parent = nullptr);
|
||||
explicit GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
|
||||
std::shared_ptr<CompatibilityInfoClass> compat_info_get,
|
||||
QWidget* parent = nullptr);
|
||||
Q_SIGNALS:
|
||||
void GameListFrameClosed();
|
||||
|
||||
|
@ -29,6 +36,7 @@ public Q_SLOTS:
|
|||
private:
|
||||
void SetTableItem(int row, int column, QString itemStr);
|
||||
void SetRegionFlag(int row, int column, QString itemStr);
|
||||
void SetCompatibilityItem(int row, int column, CompatibilityEntry entry);
|
||||
QString GetPlayTime(const std::string& serial);
|
||||
QList<QAction*> m_columnActs;
|
||||
GameInfoClass* game_inf_get = nullptr;
|
||||
|
@ -42,6 +50,7 @@ public:
|
|||
GameListUtils m_game_list_utils;
|
||||
GuiContextMenus m_gui_context_menus;
|
||||
std::shared_ptr<GameInfoClass> m_game_info;
|
||||
std::shared_ptr<CompatibilityInfoClass> m_compat_info;
|
||||
|
||||
int icon_size;
|
||||
|
||||
|
@ -59,18 +68,20 @@ public:
|
|||
case 1:
|
||||
return a.name < b.name;
|
||||
case 2:
|
||||
return a.serial.substr(4) < b.serial.substr(4);
|
||||
return a.compatibility.status < b.compatibility.status;
|
||||
case 3:
|
||||
return a.region < b.region;
|
||||
return a.serial.substr(4) < b.serial.substr(4);
|
||||
case 4:
|
||||
return parseAsFloat(a.fw, 0) < parseAsFloat(b.fw, 0);
|
||||
return a.region < b.region;
|
||||
case 5:
|
||||
return parseSizeMB(b.size) < parseSizeMB(a.size);
|
||||
return parseAsFloat(a.fw, 0) < parseAsFloat(b.fw, 0);
|
||||
case 6:
|
||||
return a.version < b.version;
|
||||
return parseSizeMB(b.size) < parseSizeMB(a.size);
|
||||
case 7:
|
||||
return a.play_time < b.play_time;
|
||||
return a.version < b.version;
|
||||
case 8:
|
||||
return a.play_time < b.play_time;
|
||||
case 9:
|
||||
return a.path < b.path;
|
||||
default:
|
||||
return false;
|
||||
|
@ -82,18 +93,20 @@ public:
|
|||
case 1:
|
||||
return a.name > b.name;
|
||||
case 2:
|
||||
return a.serial.substr(4) > b.serial.substr(4);
|
||||
return a.compatibility.status > b.compatibility.status;
|
||||
case 3:
|
||||
return a.region > b.region;
|
||||
return a.serial.substr(4) > b.serial.substr(4);
|
||||
case 4:
|
||||
return parseAsFloat(a.fw, 0) > parseAsFloat(b.fw, 0);
|
||||
return a.region > b.region;
|
||||
case 5:
|
||||
return parseSizeMB(b.size) > parseSizeMB(a.size);
|
||||
return parseAsFloat(a.fw, 0) > parseAsFloat(b.fw, 0);
|
||||
case 6:
|
||||
return a.version > b.version;
|
||||
return parseSizeMB(b.size) > parseSizeMB(a.size);
|
||||
case 7:
|
||||
return a.play_time > b.play_time;
|
||||
return a.version > b.version;
|
||||
case 8:
|
||||
return a.play_time > b.play_time;
|
||||
case 9:
|
||||
return a.path > b.path;
|
||||
default:
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue