Warning, /plasma/drkonqi/src/qml/BugzillaPage.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0002 // SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org>
0003 
0004 import QtQuick 2.15
0005 import QtQuick.Layouts 1.15
0006 import QtQuick.Controls 2.15 as QQC2
0007 import org.kde.kirigami 2.19 as Kirigami
0008 
0009 import org.kde.drkonqi 1.0
0010 
0011 Kirigami.Page {
0012     id: page
0013     // This item is intentionally not TITLED. The page should usually not show
0014     // up when when it shows up it should focus on the bare essentials!
0015 
0016     // FIXME currently this page does always show up because we don't preload it so we only contact bugzilla when the page is due for appearance
0017 
0018     Connections {
0019         target: bugzilla
0020         function onBugzillaVersionFound() {
0021             pageStack.pop()
0022             pageStack.push("qrc:/ui/LoginPage.qml")
0023         }
0024 
0025         function onBugzillaVersionError(error) {
0026             console.log("errro " + error)
0027             inlineMessage.errorContext = error
0028             page.state = "error"
0029         }
0030     }
0031 
0032     ColumnLayout {
0033         anchors.fill: parent
0034         visible: page.state === "error"
0035 
0036         Kirigami.InlineMessage {
0037             id: inlineMessage
0038 
0039             property string errorContext
0040 
0041             Layout.fillWidth: true
0042             type: Kirigami.MessageType.Error
0043             text: xi18nc("@info", "Failed to contact bugs.kde.org: <message>%1</message>", errorContext)
0044             visible: true
0045             actions: [
0046                 Kirigami.Action {
0047                     icon.name: "cloudstatus"
0048                     text: i18nc("@action", "Retry")
0049                     onTriggered: {
0050                         page.state = ""
0051                         bugzilla.lookupVersion()
0052                     }
0053                 }
0054             ]
0055         }
0056     }
0057 
0058     Kirigami.PlaceholderMessage {
0059         visible: page.state === ""
0060         anchors.centerIn: parent
0061         width: parent.width - (Kirigami.Units.largeSpacing * 4)
0062         text: i18nc("@info", "Trying to contact bugs.kde.org...")
0063 
0064         QQC2.BusyIndicator {
0065             Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
0066         }
0067     }
0068 
0069     Component.onCompleted: {
0070         bugzilla.lookupVersion()
0071     }
0072 
0073     states: [
0074         State {
0075             name: "error"
0076         },
0077         State {
0078             name: "" // default state
0079         }
0080     ]
0081 }