Warning, /system/drkonqi-pk-debug-installer/src/qml/main.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: 2020 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.12 as Kirigami
0008 import org.kde.drkonqi.debug.installer.pk 1.0
0009 
0010 Kirigami.ApplicationWindow {
0011     id: root
0012 
0013     title: i18nc("@title:window", "Debug Symbols Installer")
0014     minimumWidth: Kirigami.Units.gridUnit * 22
0015     minimumHeight: Kirigami.Units.gridUnit * 22
0016 
0017     // Window instances aren't Items so we need a helper to do clean state management.
0018     // Errors are currently a one-way road. We'll not let the user recover from there to save some time developing
0019     // comprehensive state resets in the c++ code.
0020     // The user will ultimately still be able to repeat the install via drkonqi.
0021     Item {
0022         state: {
0023             if (DebugRepoEnabler.error !== "") {
0024                 return "error"
0025             }
0026             if (Installer.error !== "") {
0027                 return "error"
0028             }
0029             if (!DebugRepoEnabler.installed) {
0030                 return "debug-repo"
0031             }
0032             "normal"
0033         }
0034 
0035         states: [
0036             State {
0037                 name: "debug-repo"
0038                 PropertyChanges { target: pageStack; initialPage: "qrc:/DebugRepoPage.qml" }
0039             },
0040             State {
0041                 name: "normal"
0042                 PropertyChanges { target: pageStack; initialPage: "qrc:/MainPage.qml" }
0043             },
0044             State {
0045                 name: "error"
0046                 PropertyChanges { target: pageStack; initialPage: "qrc:/ErrorPage.qml" }
0047             }
0048         ]
0049     }
0050 
0051     // TODO: an argument could be made that a global footer would be nicer, it's also trickier as the content is
0052     //  depending on the "main" page. i.e. we have different dialogboxes depending on whether
0053     //  we are on the initial page or the error page. both of which are "main" pages
0054 
0055     // footer: {
0056     //     console.log("!!!!!!!!!!!!!!!!!!!")
0057     //     console.log(pageStack.items[0])
0058     //     console.log(pageStack.items[0].title)
0059     //     console.log(pageStack.items[0].globalFooter)
0060     //     pageStack.items[0].globalFooter === undefined ? null : pageStack.items[0].globalFooter
0061     // }
0062 
0063     Component.onCompleted: DebugRepoEnabler.run()
0064 }