Commit 3125c8c7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Make it possible to open discover from the plasmoid

BUG: 392797
parent 9bcc529a
......@@ -54,7 +54,12 @@ void DiscoverNotifier::configurationChanged()
m_verbose = notifyTypeGroup.readEntry("Verbose", false);
}
void DiscoverNotifier::showMuon()
void DiscoverNotifier::showDiscover()
{
KRun::runCommand(QStringLiteral("plasma-discover"), nullptr);
}
void DiscoverNotifier::showDiscoverUpdates()
{
KRun::runCommand(QStringLiteral("plasma-discover --mode update"), nullptr);
}
......@@ -70,7 +75,7 @@ void DiscoverNotifier::showUpdatesNotification()
const QString name = i18n("Update");
e->setDefaultAction(name);
e->setActions({name});
connect(e, QOverload<unsigned int>::of(&KNotification::activated), this, &DiscoverNotifier::showMuon);
connect(e, QOverload<unsigned int>::of(&KNotification::activated), this, &DiscoverNotifier::showDiscover);
}
void DiscoverNotifier::updateStatusNotifier()
......
......@@ -63,7 +63,8 @@ public:
public Q_SLOTS:
void configurationChanged();
void recheckSystemUpdateNeeded();
void showMuon();
void showDiscover();
void showDiscoverUpdates();
Q_SIGNALS:
void updatesChanged();
......
......@@ -38,10 +38,14 @@ Item
}
Component.onCompleted: {
plasmoid.setAction("discover", i18n("Open Software Center..."), "plasma-discover");
plasmoid.setAction("update", i18n("See Updates..."), "system-software-update");
}
function action_discover() {
DiscoverNotifier.showDiscover();
}
function action_update() {
DiscoverNotifier.showMuon();
DiscoverNotifier.showDiscoverUpdates();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment