Warning, /utilities/ktrip/src/qml/main.qml is written in an unsupported language. File is not indexed.

0001 /**
0002  * SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 import QtQuick 2.2
0008 import QtQuick.Controls 2.4
0009 import org.kde.kirigami 2.6 as Kirigami
0010 import org.kde.ktrip 1.0
0011 
0012 Kirigami.ApplicationWindow
0013 {
0014     id: window
0015     width: 480
0016     height: 720
0017 
0018     pageStack.initialPage: Qt.resolvedUrl("QueryPage.qml")
0019 
0020     Component.onCompleted: {
0021         if (Settings.firstRun) {
0022             window.pageStack.push(Qt.resolvedUrl("BackendPage.qml"))
0023             Settings.firstRun = false
0024             Settings.save()
0025         }
0026     }
0027 
0028     globalDrawer: Kirigami.GlobalDrawer {
0029         isMenu: true
0030         actions: [
0031             Kirigami.Action {
0032                 text: i18n("Journey")
0033                 onTriggered: {
0034                     window.pageStack.clear()
0035                     window.pageStack.push(Qt.resolvedUrl("QueryPage.qml"), {departures: false})
0036                 }
0037             },
0038             Kirigami.Action {
0039                 text: i18n("Departures")
0040                 onTriggered: {
0041                     window.pageStack.clear()
0042                     window.pageStack.push(Qt.resolvedUrl("QueryPage.qml"), {departures: true})
0043                 }
0044             },
0045             Kirigami.Action {
0046                 separator: true
0047             },
0048             Kirigami.Action {
0049                 text: i18n("Providers")
0050                 onTriggered: window.pageStack.push(Qt.resolvedUrl("BackendPage.qml"))
0051             },
0052             Kirigami.Action {
0053                 text: i18n("About KTrip")
0054                 // TODO add help-about icon when other actions have icons too
0055                 onTriggered: {
0056                     if (window.pageStack.layers.depth < 2) {
0057                         window.pageStack.layers.push(aboutPage)
0058                     }
0059                 }
0060             }
0061         ]
0062     }
0063 
0064     Component {
0065         id: aboutPage
0066         Kirigami.AboutPage {
0067             aboutData: _aboutData
0068         }
0069     }
0070 }