Warning, /utilities/ktrip/src/qml/LocationQueryPage.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.4 0008 import QtQuick.Layouts 1.1 0009 import QtQuick.Controls 2.4 0010 import org.kde.kirigami 2.12 as Kirigami 0011 import org.kde.kpublictransport 1.0 as KPT 0012 import org.kde.ktrip 1.0 0013 0014 Kirigami.ScrollablePage 0015 { 0016 property bool showCached: true 0017 property var callback 0018 0019 header: Kirigami.SearchField { 0020 id: queryTextField 0021 0022 visible: Manager.enabledBackends.length !== 0 0023 width: parent.width 0024 onAccepted: { 0025 queryModel.request = Controller.createLocationRequest(text) 0026 showCached = false 0027 } 0028 } 0029 0030 ListView { 0031 id: locationView 0032 model: showCached ? cacheModel : queryModel 0033 0034 delegate: Kirigami.BasicListItem { 0035 visible: Manager.enabledBackends.length !== 0 0036 text: location.name 0037 highlighted: false 0038 reserveSpaceForIcon: false 0039 onClicked: { 0040 cacheModel.addCachedLocation(location) 0041 callback(location) 0042 pageStack.pop() 0043 } 0044 } 0045 0046 Kirigami.PlaceholderMessage { 0047 text: i18n("No locations found") 0048 visible: locationView.count === 0 && !queryModel.loading && !noProvidersMessage.visible 0049 anchors.centerIn: parent 0050 } 0051 0052 Kirigami.PlaceholderMessage { 0053 id: noProvidersMessage 0054 text: i18n("No providers enabled") 0055 visible: Manager.enabledBackends.length === 0 0056 helpfulAction: Action { 0057 text: i18n("Configure providers") 0058 icon.name: "configure" 0059 onTriggered: window.pageStack.push(Qt.resolvedUrl("BackendPage.qml")) 0060 } 0061 anchors.centerIn: parent 0062 } 0063 0064 BusyIndicator { 0065 running: queryModel.loading 0066 anchors.centerIn: parent 0067 } 0068 0069 KPT.LocationQueryModel { 0070 id: queryModel 0071 manager: Manager 0072 } 0073 0074 LocationCacheModel { 0075 id: cacheModel 0076 } 0077 } 0078 }