Commit 55593f27 authored by Volker Krause's avatar Volker Krause
Browse files

Add access to attribution information

parent b543e3a2
Pipeline #47352 passed with stage
in 19 seconds
/*
SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.13
import QtQuick.Layouts 1.11
import QtQuick.Controls 2.1 as QQC2
import org.kde.kirigami 2.4 as Kirigami
Kirigami.ScrollablePage {
id: root
title: "Data Sources"
property var publicTransportManager
Component {
id: attributionDelegate
Kirigami.AbstractListItem {
width: ListView.view.width
highlighted: false
ColumnLayout {
QQC2.Label {
Layout.fillWidth: true
wrapMode: Text.WordWrap
text: "<a href=\"" + modelData.url + "\">" + modelData.name + "</a>"
onLinkActivated: Qt.openUrlExternally(link)
}
QQC2.Label {
Layout.fillWidth: true
text: "License: <a href=\"" + modelData.liceseUrl + "\">" + (modelData.license != "" ? modelData.license : modelData.licenseUrl) + "</a>"
onLinkActivated: Qt.openUrlExternally(link)
visible: modelData.hasLicense
wrapMode: Text.WordWrap
}
}
}
}
ListView {
model: publicTransportManager.attributions
delegate: attributionDelegate
}
}
......@@ -8,7 +8,7 @@ import QtQuick 2.12
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1 as QQC2
import Qt.labs.platform 1.0 as QPlatform
import org.kde.kirigami 2.0 as Kirigami
import org.kde.kirigami 2.6 as Kirigami
import org.kde.kpublictransport 1.0 as PublicTransport
import org.kde.kosmindoormap 1.0
import org.kde.kosmindoormap.kpublictransport 1.0
......@@ -34,6 +34,17 @@ Kirigami.ApplicationWindow {
page.map.styleSheet = "";
page.map.styleSheet = s;
}
},
Kirigami.Action { separator: true },
Kirigami.Action {
text: "Data Sources"
icon.name: "about-help"
onTriggered: function() { applicationWindow().pageStack.push(attributionPage); }
},
Kirigami.Action {
id: aboutAction
text: "About"
onTriggered: function() { applicationWindow().pageStack.push(aboutPage); }
}
]
}
......@@ -278,4 +289,34 @@ Kirigami.ApplicationWindow {
locationQuery.request.types = PublicTransport.Location.RentedVehicleStation | PublicTransport.Location.RentedVehicle | PublicTransport.Location.Equipment;
}
}
Component {
id: attributionPage
AttributionPage {
publicTransportManager: ptMgr
}
}
Component {
id: aboutPage
Kirigami.AboutPage {
aboutData: {
"displayName": "KDE OSM Indoor Map",
"productName": "org.kde.kosmindoormap",
"componentName": "org.kde.kosmindoormap",
"shortDescription": "OSM Indoor Map Demo",
"homepage": "https://kde.org/",
"bugAddress": "submit@bugs.kde.org",
"version": "21.04",
"licenses": [
{
"name": "LGPL 2.0 or later",
"spdx": "LGPL-2.0-or-later"
}
],
"copyrightStatement": "© 2020-2021 The KDE Team",
"desktopFileName": "kosmindoormap"
}
}
}
}
......@@ -5,6 +5,7 @@
<RCC>
<qresource prefix="/">
<file>indoormap.qml</file>
<file>AttributionPage.qml</file>
<file>ExampleLocationModel.qml</file>
<file>IndoorMapPage.qml</file>
<file>SelectLocationSheet.qml</file>
......
Markdown is supported
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