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                 icon.name: "globe"
0034                 onTriggered: {
0035                     window.pageStack.clear()
0036                     window.pageStack.push(Qt.resolvedUrl("QueryPage.qml"), {departures: false})
0037                 }
0038             },
0039             Kirigami.Action {
0040                 text: i18n("Departures")
0041                 icon.name: "arrow-right-double"
0042                 onTriggered: {
0043                     window.pageStack.clear()
0044                     window.pageStack.push(Qt.resolvedUrl("QueryPage.qml"), {departures: true})
0045                 }
0046             },
0047             Kirigami.Action {
0048                 separator: true
0049             },
0050             Kirigami.Action {
0051                 text: i18n("Providers")
0052                 icon.name: "settings-configure"
0053                 onTriggered: window.pageStack.push(Qt.resolvedUrl("BackendPage.qml"))
0054             },
0055             Kirigami.Action {
0056                 text: i18n("About KTrip")
0057                 // TODO add help-about icon when other actions have icons too
0058                 icon.name: "help-about"
0059                 onTriggered: {
0060                     if (window.pageStack.layers.depth < 2) {
0061                         window.pageStack.layers.push(aboutPage)
0062                     }
0063                 }
0064             }
0065         ]
0066     }
0067 
0068     Component {
0069         id: aboutPage
0070         Kirigami.AboutPage {
0071             aboutData: _aboutData
0072         }
0073     }
0074 }