8import QtQuick.Controls 2.11 as QtControls
9import QtQuick.Layouts 1.11 as QtLayouts
11import org.kde.kcmutils as KCM
12import org.kde.kirigami 2.7 as Kirigami
14import org.kde.newstuff as NewStuff
20 property string useLabel
21 property string uninstallLabel
23 property var entry: model.entry
26 text: component.useLabel
27 icon.name:
"dialog-ok-apply"
28 onTriggered: { newStuffModel.engine.adoptEntry(entry); }
29 enabled: (entry.status ==
NewStuff.Entry.Installed || entry.status ==
NewStuff.Entry.Updateable) && newStuffEngine.hasAdoptionCommand
33 text: model.downloadLinks.length === 1 ?
i18ndc(
"knewstuff6",
"Request installation of this item, available when there is exactly one downloadable item",
"Install") :
i18ndc(
"knewstuff6",
"Show installation options, where there is more than one downloadable item",
"Install…");
36 if (model.downloadLinks.length === 1) {
37 newStuffModel.engine.install(entry,
NewStuff.Entry.FirstLinkId);
39 downloadItemsSheet.downloadLinks = model.downloadLinks;
40 downloadItemsSheet.entry = entry;
41 downloadItemsSheet.open();
44 enabled: entry.status ==
NewStuff.Entry.Downloadable || entry.status ==
NewStuff.Entry.Deleted
48 text:
i18ndc(
"knewstuff6",
"Request updating of this item",
"Update");
49 icon.name:
"update-none"
50 onTriggered: { newStuffModel.engine.install(entry,
NewStuff.ItemsModel.AutoDetectLinkId); }
51 enabled: entry.status ==
NewStuff.Entry.Updateable
55 text: component.uninstallLabel
56 icon.name:
"edit-delete"
57 onTriggered: { newStuffModel.engine.uninstall(entry); }
58 enabled: entry.status ==
NewStuff.Entry.Installed || entry.status ==
NewStuff.Entry.Updateable
62 thumbnailAvailable: model.previewsSmall.length > 0
66 margins:
Kirigami.Units.smallSpacing;
69 fillMode: Image.PreserveAspectFit;
70 source: thumbnailAvailable ? model.previewsSmall[0] :
"";
73 opacity: (entry.status ==
NewStuff.Entry.Updateable) ? 1 : 0;
78 margins: -
Kirigami.Units.smallSpacing;
80 height:
Kirigami.Units.iconSizes.smallMedium;
82 source:
"package-installed-outdated";
86 opacity: (entry.status ==
NewStuff.Entry.Installed) ? 1 : 0;
91 margins: -
Kirigami.Units.smallSpacing;
93 height:
Kirigami.Units.iconSizes.smallMedium;
95 source:
"package-installed-updated";
99 newStuffModel: component.GridView.view.model
102 anchors.fill: parent;
103 cursorShape:
Qt.PointingHandCursor;
105 newStuffModel: component.GridView.view.model,
QString i18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...)
QTextStream & right(QTextStream &stream)