Commit 761e3195 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Display "Use" as a label to adopt KNS resources

BUG: 390320
parent acf66dd1
......@@ -133,7 +133,7 @@ DiscoverPage {
Button {
Layout.rightMargin: Kirigami.Units.smallSpacing
visible: application.isInstalled && application.canExecute
text: i18n("Launch")
text: application.executeLabel
onClicked: application.invokeApplication()
}
}
......
......@@ -22,6 +22,7 @@
#include "KNSBackend.h"
#include <KNSCore/Engine>
#include <KShell>
#include <KLocalizedString>
#include <QProcess>
#include <QRegularExpression>
#include <knewstuff_version.h>
......@@ -223,3 +224,8 @@ void KNSResource::invokeApplication() const
qWarning() << "cannot execute" << packageName();
}
}
QString KNSResource::executeLabel() const
{
return i18n("Use");
}
......@@ -64,6 +64,7 @@ public:
void invokeApplication() const override;
QUrl url() const override;
QString executeLabel() const override;
private:
const QStringList m_categories;
......
......@@ -245,3 +245,8 @@ QString AbstractResource::displayOrigin() const
{
return i18nc("origin (backend name)", "%1 (%2)", origin(), backend()->displayName());
}
QString AbstractResource::executeLabel() const
{
return i18n("Launch");
}
......@@ -76,6 +76,7 @@ class DISCOVERCOMMON_EXPORT AbstractResource : public QObject
Q_PROPERTY(QString appstreamId READ appstreamId CONSTANT)
Q_PROPERTY(QString categoryDisplay READ categoryDisplay CONSTANT)
Q_PROPERTY(QUrl url READ url CONSTANT)
Q_PROPERTY(QString executeLabel READ executeLabel CONSTANT)
public:
/**
* This describes the state of the resource
......@@ -198,6 +199,8 @@ class DISCOVERCOMMON_EXPORT AbstractResource : public QObject
*/
virtual QUrl url() const;
virtual QString executeLabel() const;
public Q_SLOTS:
virtual void fetchScreenshots();
virtual void fetchChangelog() = 0;
......
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