Warning, /system/plasma-packagekit/applet/contents/ui/TransactionListItem.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     Copyright © 2017 Harald Sitter <sitter@kde.org>
0003 
0004     This program is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU General Public License as
0006     published by the Free Software Foundation; either version 2 of
0007     the License or (at your option) version 3 or any later version
0008     accepted by the membership of KDE e.V. (or its successor approved
0009     by the membership of KDE e.V.), which shall act as a proxy
0010     defined in Section 14 of version 3 of the license.
0011 
0012     This program is distributed in the hope that it will be useful,
0013     but WITHOUT ANY WARRANTY; without even the implied warranty of
0014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015     GNU General Public License for more details.
0016 
0017     You should have received a copy of the GNU General Public License
0018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
0019 */
0020 
0021 import QtQuick 2.0
0022 import QtQuick.Layouts 1.0
0023 
0024 import org.kde.plasma.core 2.1 as PlasmaCore
0025 import org.kde.plasma.components 2.0 as PlasmaComponents
0026 import org.kde.plasma.extras 2.0 as PlasmaExtras
0027 
0028 import org.kde.plasma.private.packagekit 0.1
0029 
0030 import "../code/role.js" as Role
0031 
0032 PlasmaComponents.ListItem {
0033     ColumnLayout {
0034         width: parent.width
0035 
0036         RowLayout {
0037             PlasmaExtras.Heading {
0038                 function roleText() {
0039                     var str = Role.localizedString(role)
0040                     if (str) {
0041                         console.debug(str)
0042                         return str;
0043                     }
0044                     console.debug("FAILED TO MAP %1 defaulting to %2".arg(role.valueOf()).arg(role.toLocaleString()))
0045                     console.debug(Transaction.Role)
0046                     return ModelObject.enumString(role) + " " + role.valueOf()
0047                 }
0048 
0049                 Layout.fillWidth: true
0050                 level: 2
0051                 wrapMode: Text.NoWrap
0052                 elide: Text.ElideRight
0053                 text: roleText() + " " // We want a white space spacing to the tid.
0054             }
0055 
0056             PlasmaExtras.Heading {
0057                 level: 6
0058                 wrapMode: Text.NoWrap
0059                 elide: Text.ElideRight
0060                 text: "[%2]".arg(tidString)
0061             }
0062         }
0063 
0064         PlasmaExtras.Heading {
0065             Layout.fillWidth: true
0066             level: 5
0067             wrapMode: Text.NoWrap
0068             elide: Text.ElideRight
0069             text: lastPackage || ""
0070             visible: text != ""
0071         }
0072         PlasmaExtras.Heading {
0073             id: debugHeading
0074             visible: false
0075             Layout.fillWidth: true
0076             level: 5
0077             wrapMode: Text.NoWrap
0078             elide: Text.ElideRight
0079             text: "%1 -- %2 (%3:%4)".arg(lastPackage).arg(percentage).arg(status).arg(role)
0080         }
0081     }
0082 }