Qt: Update Game List

This commit is contained in:
Xphalnos 2024-08-31 17:30:19 +02:00
parent 4182740384
commit fb5c7c5062
4 changed files with 10 additions and 19 deletions

View file

@ -41,7 +41,6 @@ public:
: fw.left(3).insert(1, '.'); : fw.left(3).insert(1, '.');
game.fw = (fw_int == 0) ? "0.00" : fw_.toStdString(); game.fw = (fw_int == 0) ? "0.00" : fw_.toStdString();
game.version = psf.GetString("APP_VER"); game.version = psf.GetString("APP_VER");
game.category = psf.GetString("CATEGORY");
} }
return game; return game;
} }

View file

@ -23,14 +23,13 @@ GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get, QWidg
this->horizontalHeader()->setSortIndicatorShown(true); this->horizontalHeader()->setSortIndicatorShown(true);
this->horizontalHeader()->setStretchLastSection(true); this->horizontalHeader()->setStretchLastSection(true);
this->setContextMenuPolicy(Qt::CustomContextMenu); this->setContextMenuPolicy(Qt::CustomContextMenu);
this->setColumnCount(9); this->setColumnCount(8);
this->setColumnWidth(1, 250); this->setColumnWidth(1, 300); // Name
this->setColumnWidth(2, 110); this->setColumnWidth(2, 120); // Serial
this->setColumnWidth(3, 80); this->setColumnWidth(3, 90); // Region
this->setColumnWidth(4, 90); this->setColumnWidth(4, 90); // Firmware
this->setColumnWidth(5, 80); this->setColumnWidth(5, 90); // Size
this->setColumnWidth(6, 80); this->setColumnWidth(6, 90); // Version
this->setColumnWidth(7, 80);
QStringList headers; QStringList headers;
headers << "Icon" headers << "Icon"
<< "Name" << "Name"
@ -39,7 +38,6 @@ GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get, QWidg
<< "Firmware" << "Firmware"
<< "Size" << "Size"
<< "Version" << "Version"
<< "Category"
<< "Path"; << "Path";
this->setHorizontalHeaderLabels(headers); this->setHorizontalHeaderLabels(headers);
this->horizontalHeader()->setSortIndicatorShown(true); this->horizontalHeader()->setSortIndicatorShown(true);
@ -87,8 +85,7 @@ void GameListFrame::PopulateGameList() {
SetTableItem(i, 4, QString::fromStdString(m_game_info->m_games[i].fw)); SetTableItem(i, 4, QString::fromStdString(m_game_info->m_games[i].fw));
SetTableItem(i, 5, QString::fromStdString(m_game_info->m_games[i].size)); SetTableItem(i, 5, QString::fromStdString(m_game_info->m_games[i].size));
SetTableItem(i, 6, QString::fromStdString(m_game_info->m_games[i].version)); SetTableItem(i, 6, QString::fromStdString(m_game_info->m_games[i].version));
SetTableItem(i, 7, QString::fromStdString(m_game_info->m_games[i].category)); SetTableItem(i, 7, QString::fromStdString(m_game_info->m_games[i].path));
SetTableItem(i, 8, QString::fromStdString(m_game_info->m_games[i].path));
} }
} }
@ -168,7 +165,7 @@ void GameListFrame::SetTableItem(int row, int column, QString itemStr) {
QVBoxLayout* layout = new QVBoxLayout(widget); QVBoxLayout* layout = new QVBoxLayout(widget);
QLabel* label = new QLabel(itemStr, widget); QLabel* label = new QLabel(itemStr, widget);
label->setStyleSheet("color: white; font-size: 15px; font-weight: bold;"); label->setStyleSheet("color: white; font-size: 16px; font-weight: bold;");
// Create shadow effect // Create shadow effect
QGraphicsDropShadowEffect* shadowEffect = new QGraphicsDropShadowEffect(); QGraphicsDropShadowEffect* shadowEffect = new QGraphicsDropShadowEffect();

View file

@ -14,7 +14,6 @@ struct GameInfo {
std::string serial = "Unknown"; std::string serial = "Unknown";
std::string version = "Unknown"; std::string version = "Unknown";
std::string region = "Unknown"; std::string region = "Unknown";
std::string category = "Unknown";
std::string fw = "Unknown"; std::string fw = "Unknown";
}; };

View file

@ -7,8 +7,6 @@
#include <QPushButton> #include <QPushButton>
#include <QToolBar> #include <QToolBar>
QT_BEGIN_NAMESPACE
class Ui_MainWindow { class Ui_MainWindow {
public: public:
QAction* bootInstallPkgAct; QAction* bootInstallPkgAct;
@ -354,6 +352,4 @@ public:
namespace Ui { namespace Ui {
class MainWindow : public Ui_MainWindow {}; class MainWindow : public Ui_MainWindow {};
} // namespace Ui } // namespace Ui
QT_END_NAMESPACE