Warning, /education/marble/src/apps/marble-maps/ProfileSelectorMenu.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2015 Gábor Péterffy <peterffy95@gmail.com>
0004 // SPDX-FileCopyrightText: 2015 Dennis Nienhüser <nienhueser@kde.org>
0005 //
0006
0007 import QtQuick 2.3
0008 import QtQuick.Controls 1.3
0009 import QtQuick.Layouts 1.1
0010 import QtQuick.Window 2.2
0011
0012 import org.kde.marble 0.20
0013
0014 Item {
0015 id: root
0016
0017 property string selectedProfile: carProfileButton.profile
0018 property string profileIcon: "qrc:///material/directions-car.svg"
0019 height: rowLayout.height
0020 width: rowLayout.width
0021
0022 Settings {
0023 id: settings
0024 Component.onDestruction: {
0025 settings.setValue("Routing", "profile", root.selectedProfile)
0026 }
0027 }
0028
0029 RowLayout {
0030 id: rowLayout
0031 ExclusiveGroup {
0032 id: profileGroup
0033 onCurrentChanged: {
0034 profileIcon = current.imageSource
0035 selectedProfile = current.profile;
0036 }
0037 }
0038
0039 RouteProfileRadioButton {
0040 id: carProfileButton
0041 checked: settings.value("Routing", "profile") === "" || settings.value("Routing", "profile", profile) === profile
0042 exclusiveGroup: profileGroup
0043 property string profile: qsTr("Car (fastest)")
0044 imageSource: "qrc:///material/directions-car.svg"
0045 }
0046 RouteProfileRadioButton {
0047 checked: settings.value("Routing", "profile") === profile
0048 exclusiveGroup: profileGroup
0049 property string profile: qsTr("Bicycle")
0050 imageSource: "qrc:///material/directions-bike.svg"
0051 }
0052 RouteProfileRadioButton {
0053 checked: settings.value("Routing", "profile") === profile
0054 exclusiveGroup: profileGroup
0055 property string profile: qsTr("Pedestrian")
0056 imageSource: "qrc:///material/directions-walk.svg"
0057 }
0058 }
0059 }