KNewStuff

DownloadItemsSheet.qml
1 /*
2  SPDX-FileCopyrightText: 2019 Dan Leinir Turthra Jensen <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 import QtQuick 2.11
8 import QtQuick.Controls 2.11 as QtControls
9 import QtQuick.Layouts 1.11 as QtLayouts
10 
11 import org.kde.kirigami 2.7 as Kirigami
12 
13 import org.kde.newstuff 1.62 as NewStuff
14 
22 Kirigami.OverlaySheet {
23  id: component
24 
25  property string entryId
26  property alias downloadLinks: itemsView.model
27  signal itemPicked(string entryId, int downloadItemId, string downloadName)
28 
29  showCloseButton: true
30  header: Kirigami.Heading {
31  text: i18nd("knewstuff5", "Pick Your Installation Option")
32  elide: Text.ElideRight
33  }
34  contentItem: ListView {
35  id: itemsView
36 
37  header: QtControls.Label {
38  leftPadding: Kirigami.Units.largeSpacing
39  rightPadding: Kirigami.Units.largeSpacing
40  bottomPadding: Kirigami.Units.smallSpacing
41  width: parent.width
42  text: i18nd("knewstuff5", "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.")
43  wrapMode: Text.Wrap
44  }
45 
46  delegate: Kirigami.BasicListItem {
47  text: modelData.name
48  icon: "download"
49  QtControls.ToolButton {
50  text: i18nd("knewstuff5", "Install")
51  icon.name: "install"
52  QtLayouts.Layout.alignment: Qt.AlignRight
53  onClicked: {
54  component.close();
55  component.itemPicked(component.entryId, modelData.id, modelData.name);
56  }
57  }
58  }
59  }
60 }
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 11 2020 22:43:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.