Commit 506890db authored by Sanjiban Bairagya's avatar Sanjiban Bairagya Committed by Sanjiban Bairagya

Remove buttons from the PlacemarkDialog used to choose how to add the current

placemark as, instead default to add placemarks as route destination always
parent ff866acf
......@@ -19,12 +19,15 @@ Item {
id: root
property var placemark: null
property string actionIconSource: viaGroup.current === addDestinationButton ? routeEditor.currentProfileIcon : "qrc:///add.png"
property string actionIconSource: routeEditor.currentProfileIcon
height: placemark === null ? 0 : Screen.pixelDensity * 6 + Math.max(infoLayout.height, actionsLayout.height)
height: placemark === null ? 0 : Screen.pixelDensity * 6 + infoLayout.height
function addToRoute() {
viaGroup.current.execute()
ensureRouteHasDeparture()
routing.addViaByPlacemarkAtIndex(routing.waypointCount(), placemark)
routing.clearSearchResultPlacemarks()
placemark = null
itemStack.state = "routing"
}
......@@ -49,7 +52,7 @@ Item {
anchors {
bottom: parent.bottom
left: parent.left
right: actionsLayout.left
right: parent.right
margins: Screen.pixelDensity * 2
}
......@@ -96,68 +99,6 @@ Item {
}
}
Column {
id: actionsLayout
width: rowLayout.width
spacing: Screen.pixelDensity * 2
anchors {
right: parent.right
rightMargin: Screen.pixelDensity * 2
}
Item {
id: spacer
height: Screen.pixelDensity * 5
width: 1
}
Row {
id: rowLayout
anchors.right: parent.right
spacing: 0
ExclusiveGroup {
id: viaGroup
}
RouteProfileRadioButton {
anchors.margins: 0
visible: routing.routeRequestModel.count === 0
exclusiveGroup: viaGroup
imageSource: "qrc:///ic_place_departure.png"
function execute() {
routing.addViaByPlacemarkAtIndex(0, placemark);
routing.removeSearchResultPlacemark(placemark);
placemark = null;
}
}
RouteProfileRadioButton {
anchors.margins: 0
exclusiveGroup: viaGroup
imageSource: "qrc:///ic_place_via.png"
function execute() {
ensureRouteHasDeparture()
routing.addViaByPlacemark(placemark)
routing.clearSearchResultPlacemarks();
placemark = null;
}
}
RouteProfileRadioButton {
id: addDestinationButton
anchors.margins: 0
checked: true
exclusiveGroup: viaGroup
imageSource: "qrc:///ic_place_arrival.png"
function execute() {
ensureRouteHasDeparture()
routing.addViaByPlacemarkAtIndex(routing.waypointCount(), placemark)
routing.clearSearchResultPlacemarks();
placemark = null;
}
}
}
}
function ensureRouteHasDeparture() {
if (routing.routeRequestModel.count === 0) {
if (marbleMaps.positionAvailable) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment