Changeset View
Changeset View
Standalone View
Standalone View
src/qtquick/qml/NewStuffDownloadItemsSheet.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2019 Dan Leinir Turthra Jensen <admin@leinir.dk> | ||||
3 | * | ||||
4 | * This library is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU Lesser General Public | ||||
6 | * License as published by the Free Software Foundation; either | ||||
7 | * version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | * later version accepted by the membership of KDE e.V. (or its | ||||
9 | * successor approved by the membership of KDE e.V.), which shall | ||||
10 | * act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | * | ||||
12 | * This library is distributed in the hope that it will be useful, | ||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | * Lesser General Public License for more details. | ||||
16 | * | ||||
17 | * You should have received a copy of the GNU Lesser General Public | ||||
18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | * | ||||
20 | */ | ||||
21 | | ||||
22 | import QtQuick 2.2 | ||||
23 | import QtQuick.Controls 2.5 as QtControls | ||||
24 | import QtQuick.Layouts 1.12 as QtLayouts | ||||
25 | import org.kde.kirigami 2.7 as Kirigami | ||||
26 | | ||||
27 | /** | ||||
28 | * @brief An overlay sheet for showing a list of download options for one entry | ||||
29 | * | ||||
30 | * This is used by the NewStuffPage componet | ||||
31 | */ | ||||
32 | | ||||
33 | Kirigami.OverlaySheet { | ||||
34 | id: component | ||||
35 | | ||||
36 | property string entryId | ||||
37 | property alias downloadLinks: itemsView.model | ||||
38 | signal itemPicked(string entryId, int downloadItemId, string downloadName) | ||||
39 | | ||||
40 | showCloseButton: true | ||||
41 | header: QtLayouts.ColumnLayout { | ||||
42 | spacing: Kirigami.Units.largeSpacing | ||||
43 | Kirigami.Heading { | ||||
44 | QtLayouts.Layout.fillWidth: true | ||||
45 | text: i18n("Pick Your Installation Option") | ||||
46 | elide: Text.ElideRight | ||||
47 | } | ||||
48 | Kirigami.AbstractCard { | ||||
49 | QtLayouts.Layout.leftMargin: Kirigami.Units.iconSizes.smallMedium | ||||
50 | contentItem: QtControls.Label { | ||||
51 | text: i18n("Please select the option you wish to install from the list of downloadable items below. If it is unclear which you should chose out of the available options, please contact the author of this item and ask that they clarify this through the naming of the items.") | ||||
52 | wrapMode: Text.Wrap | ||||
53 | } | ||||
54 | } | ||||
55 | } | ||||
56 | ListView { | ||||
57 | id: itemsView | ||||
58 | delegate: Kirigami.BasicListItem { | ||||
59 | text: modelData.name | ||||
60 | icon: "download" | ||||
61 | QtControls.ToolButton { | ||||
62 | text: i18n("Install") | ||||
63 | icon.name: "install" | ||||
64 | QtLayouts.Layout.alignment: Qt.AlignRight | ||||
65 | onClicked: { | ||||
66 | component.close(); | ||||
67 | component.itemPicked(component.entryId, modelData.id, modelData.name); | ||||
68 | } | ||||
69 | } | ||||
70 | } | ||||
71 | } | ||||
72 | } |