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
0008 import QtQuick.Controls
0009 import org.kde.coreaddons as KCA
0010 import org.kde.kirigami as Kirigami
0011 import org.kde.kirigamiaddons.formcard as FormCard
0012 import org.kde.ktrip
0013
0014 Kirigami.ApplicationWindow {
0015 id: window
0016 width: 480
0017 height: 720
0018
0019 pageStack.initialPage: Qt.resolvedUrl("QueryPage.qml")
0020
0021 Component.onCompleted: {
0022 if (Settings.firstRun) {
0023 window.pageStack.push(Qt.resolvedUrl("BackendPage.qml"));
0024 Settings.firstRun = false;
0025 Settings.save();
0026 }
0027 }
0028
0029 globalDrawer: Kirigami.GlobalDrawer {
0030 isMenu: true
0031 actions: [
0032 Kirigami.Action {
0033 text: i18n("Journey")
0034 icon.name: "globe"
0035 onTriggered: {
0036 window.pageStack.clear();
0037 window.pageStack.push(Qt.resolvedUrl("QueryPage.qml"), {
0038 departures: false
0039 });
0040 }
0041 },
0042 Kirigami.Action {
0043 text: i18n("Departures")
0044 icon.name: "arrow-right-double"
0045 onTriggered: {
0046 window.pageStack.clear();
0047 window.pageStack.push(Qt.resolvedUrl("QueryPage.qml"), {
0048 departures: true
0049 });
0050 }
0051 },
0052 Kirigami.Action {
0053 separator: true
0054 },
0055 Kirigami.Action {
0056 text: i18n("Providers")
0057 icon.name: "settings-configure"
0058 onTriggered: window.pageStack.push(Qt.resolvedUrl("BackendPage.qml"))
0059 },
0060 Kirigami.Action {
0061 text: i18n("About KTrip")
0062 // TODO add help-about icon when other actions have icons too
0063 icon.name: "help-about"
0064 onTriggered: {
0065 if (window.pageStack.layers.depth < 2) {
0066 window.pageStack.layers.push(aboutPage);
0067 }
0068 }
0069 }
0070 ]
0071 }
0072
0073 Component {
0074 id: aboutPage
0075 FormCard.AboutPage {
0076 aboutData: KCA.AboutData
0077 }
0078 }
0079 }