Warning, /frameworks/knewstuff/src/qtquick/qml/private/entrygriddelegates/FeedbackOverlay.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2019 Dan Leinir Turthra Jensen <admin@leinir.dk>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 import QtQuick 2.11
0008 import QtQuick.Controls 2.11 as QtControls
0009 
0010 import org.kde.kirigami 2.7 as Kirigami
0011 
0012 import org.kde.newstuff as NewStuff
0013 
0014 Item {
0015     property QtObject newStuffModel
0016     visible: opacity > 0
0017     opacity: (model.entry.status == NewStuff.Entry.Installing || model.entry.status == NewStuff.Entry.Updating) ? 1 : 0
0018     Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration; } }
0019     Rectangle {
0020         anchors.fill: parent
0021         color: Kirigami.Theme.backgroundColor
0022         opacity: 0.9;
0023     }
0024     QtControls.BusyIndicator {
0025         anchors {
0026             horizontalCenter: parent.horizontalCenter
0027             bottom: parent.verticalCenter
0028             bottomMargin: Kirigami.Units.smallSpacing
0029         }
0030         running: parent.visible
0031     }
0032     QtControls.Label {
0033         id: statusLabel
0034         Connections {
0035             target: newStuffModel
0036             function onEntryChanged(entry) {
0037                 const status = entry.status;
0038                 if (status == NewStuff.Entry.Downloadable
0039                 || status == NewStuff.Entry.Installed
0040                 || status == NewStuff.Entry.Updateable
0041                 || status == NewStuff.Entry.Deleted) {
0042                     statusLabel.text = "";
0043                 } else if (status == NewStuff.Entry.Installing) {
0044                     statusLabel.text = i18ndc("knewstuff6", "Label for the busy indicator showing an item is being installed OR uninstalled", "Working…");
0045                 } else if (status == NewStuff.Entry.Updating) {
0046                     statusLabel.text = i18ndc("knewstuff6", "Label for the busy indicator showing an item is in the process of being updated", "Updating…");
0047                 } else {
0048                     statusLabel.text = i18ndc("knewstuff6", "Label for the busy indicator which should only be shown when the entry has been given some unknown or invalid status.", "Invalid or unknown state. <a href=\"https://bugs.kde.org/enter_bug.cgi?product=frameworks-knewstuff\">Please report this to the KDE Community in a bug report</a>.");
0049                 }
0050             }
0051         }
0052         onLinkActivated: Qt.openUrlExternally(link);
0053         anchors {
0054             top: parent.verticalCenter
0055             left: parent.left
0056             right: parent.right
0057             margins: Kirigami.Units.smallSpacing
0058         }
0059         horizontalAlignment: Text.AlignHCenter
0060         // TODO: This is where we'd want to put the download progress and cancel button as well
0061         text: i18ndc("knewstuff6", "Label for the busy indicator showing an item is installing", "Installing…");
0062     }
0063 }