Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve package manager UX #1710

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
31 changes: 28 additions & 3 deletions src/plugins/score-plugin-packagemanager/PackageManager/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

#include <score/application/GUIApplicationContext.hpp>
#include <score/widgets/MessageBox.hpp>
#include <score/widgets/SetIcons.hpp>

#include <core/application/ApplicationInterface.hpp>

#include <QApplication>
#include <QBuffer>
#include <QComboBox>
#include <QDesktopServices>
#include <QDir>
#include <QFile>
Expand All @@ -17,6 +19,7 @@
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QLabel>
#include <QMessageBox>
#include <QNetworkReply>
#include <QNetworkRequest>
Expand Down Expand Up @@ -93,7 +96,7 @@ PluginSettingsView::PluginSettingsView()
local_widget->setLayout(local_layout);
local_layout->addWidget(m_addonsOnSystem);

tab_widget->addTab(local_widget, tr("Local"));
tab_widget->addTab(local_widget, tr("Local packages"));
}

{
Expand All @@ -102,17 +105,38 @@ PluginSettingsView::PluginSettingsView()
remote_widget->setLayout(remote_layout);
remote_layout->addWidget(m_remoteAddons);

tab_widget->addTab(remote_widget, tr("Browse"));
tab_widget->addTab(remote_widget, tr("Available packages"));
}

auto side_widget = new QWidget;
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);

m_link->setToolTip(tr("Open external package link in default browser."));
auto icon = makeIcons(
QStringLiteral(":/icons/undock_on.png"), QStringLiteral(":/icons/undock_off.png"),
QStringLiteral(":/icons/undock_off.png"));
m_link->setIcon(icon);

vlay->addWidget(m_link);

vlay->addSpacing(20);

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 Expand Up @@ -222,7 +246,8 @@ void PluginSettingsView::refresh()
if(qEnvironmentVariableIsSet("SCORE_SANITIZE_SKIP_CHECKS"))
return;
QNetworkRequest rqst{
QUrl("https://raw.githubusercontent.com/ossia/score-addons/master/addons.json")};
QUrl("https://raw.githubusercontent.com/ossia/score-addons/refs/heads/"
Copy link
Contributor Author

@samamou samamou Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • TODO: Change back when this branch is merged with main

"add-ai-models/addons.json")};
mgr.get(rqst);
}

Expand Down
Loading