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

Allow sharing the app URL

BUG: 458464
parent 4f850659
Pipeline #225763 passed with stage
in 1 minute and 31 seconds
......@@ -25,6 +25,7 @@ Dependencies:
'frameworks/kwidgetsaddons': '@latest'
'frameworks/kwindowsystem': '@latest'
'frameworks/kxmlgui': '@latest'
'frameworks/purpose': '@latest'
'libraries/kuserfeedback': '@stable'
Options:
require-passing-tests-on: [ 'Linux', 'FreeBSD']
......@@ -26,7 +26,7 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS
find_package(PkgConfig REQUIRED)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED CoreAddons Config Crash DBusAddons I18n Archive XmlGui KIO Declarative KCMUtils IdleTime Notifications)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED CoreAddons Config Crash DBusAddons I18n Archive XmlGui KIO Declarative KCMUtils IdleTime Notifications Purpose)
find_package(KF5Kirigami2 2.7.0)
find_package(packagekitqt5 1.0.1 CONFIG)
......
......@@ -12,6 +12,7 @@ import QtQuick.Layouts 1.15
import org.kde.discover 2.0
import org.kde.discover.app 1.0
import org.kde.kirigami 2.20 as Kirigami
import org.kde.purpose 1.0 as Purpose
import "navigation.js" as Navigation
DiscoverPage {
......@@ -513,9 +514,11 @@ DiscoverPage {
readonly property int visibleButtons: (helpButton.visible ? 1 : 0)
+ (homepageButton.visible ? 1: 0)
+ (addonsButton.visible ? 1 : 0)
+ (shareButton.visible ? 1 : 0)
readonly property int buttonWidth: Math.round(textualContentLayout.width / visibleButtons)
readonly property int tallestButtonHeight: Math.max(helpButton.implicitHeight,
homepageButton.implicitHeight,
shareButton.implicitHeight,
addonsButton.implicitHeight)
Layout.fillWidth: true
......@@ -579,6 +582,48 @@ DiscoverPage {
}
}
}
ApplicationResourceButton {
id: shareButton
Layout.fillWidth: true
Layout.maximumWidth: externalResourcesLayout.buttonWidth
Layout.minimumHeight: externalResourcesLayout.tallestButtonHeight
buttonIcon: "document-share"
title: i18nc("Exports the application's URL to an external service", "Share")
subtitle: i18n("Send a link to the application")
tooltipText: application.url.toString()
visible: tooltipText.length > 0
Kirigami.PromptDialog {
id: shareSheet
parent: applicationWindow().overlay
title: shareButton.title
standardButtons: Kirigami.Dialog.None
Purpose.AlternativesView {
id: alts
implicitWidth: Kirigami.Units.gridUnit
pluginType: "ShareUrl"
inputData: {
"urls": [ application.url.toString() ],
"title": i18nc("The subject line for an email. %1 is the name of an application", "Check out the %1 app!", application.name)
}
onFinished: {
shareSheet.close()
if (error !== 0) {
console.error("job finished with error", error, message)
}
alts.reset()
}
}
}
onClicked: {
shareSheet.open();
}
}
}
Kirigami.Heading {
......@@ -772,8 +817,6 @@ DiscoverPage {
ListView {
id: listview
implicitWidth: Kirigami.Units.gridUnit
model: appInfo.application.licenses
delegate: Kirigami.BasicListItem {
......
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