Skip to content

Commit

Permalink
Add hardcoded categories
Browse files Browse the repository at this point in the history
  • Loading branch information
samamou committed Feb 6, 2025
1 parent d35bd75 commit bcc8422
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ std::optional<Package> Package::fromJson(const QJsonObject& obj) noexcept
{"long", [&](QJsonValue v) { add.longDescription = v.toString(); }},
{"small", [&](QJsonValue v) { add.smallImagePath = v.toString(); }},
{"large", [&](QJsonValue v) { add.largeImagePath = v.toString(); }},
{"category", [&](QJsonValue v) { add.category = v.toString(); }},
{"size", [&](QJsonValue v) { add.size = v.toString(); }},
{"key", [&](QJsonValue v) {
add.key = UuidKey<score::Addon>::fromString(v.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct Package
std::vector<QUrl> files; // URL to a file containing the current version.
QMap<QString, std::vector<QUrl>> arch_files; // if there are per-architecture files
QString url; // Link to the homepage of the package if any

QString category;
QString shortDescription;
QString longDescription;
QString smallImagePath;
Expand Down
14 changes: 14 additions & 0 deletions src/plugins/score-plugin-packagemanager/PackageManager/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <QApplication>
#include <QBuffer>
#include <QComboBox>
#include <QDesktopServices>
#include <QDir>
#include <QFile>
Expand All @@ -17,6 +18,7 @@
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QLabel>
#include <QMessageBox>
#include <QNetworkReply>
#include <QNetworkRequest>
Expand Down Expand Up @@ -109,10 +111,22 @@ PluginSettingsView::PluginSettingsView()
auto vlay = new QVBoxLayout{side_widget};
grid->addWidget(side_widget, 0, 1, 2, 1);

auto categoryLabel = new QLabel("Select Category:");
vlay->addWidget(categoryLabel);

auto categoryComboBox = new QComboBox;
categoryComboBox->addItem("All");
categoryComboBox->addItem("Media");
categoryComboBox->addItem("AI Models");
vlay->addWidget(categoryComboBox);
vlay->addSpacing(20);

vlay->addWidget(m_link);
vlay->addWidget(m_uninstall);
m_install->setVisible(false);
vlay->addWidget(m_install);
vlay->addSpacing(20);

vlay->addWidget(m_update);
vlay->addWidget(m_updateAll);
vlay->addStretch();
Expand Down

0 comments on commit bcc8422

Please sign in to comment.