From 0242ab72e8bd3c2f17e2c3f42ee71e4c44eeeaff Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 1 Sep 2024 13:57:28 -0400 Subject: [PATCH] Allow opening locations in your preferred map Once someone shares a location with you, typically you want to open it in your preferred mapping application or website. For example, being sent a location to a restaurant and needing to route it via Google Maps. Now in NeoChat you can click on the "Open Externally" button on a location message. On KDE Plasma, the default application can be set under System Settings. On Android, this URI is handled by Google Maps and possibly others. --- src/timeline/LocationComponent.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/timeline/LocationComponent.qml b/src/timeline/LocationComponent.qml index d33a2c3c0..20c72ca19 100644 --- a/src/timeline/LocationComponent.qml +++ b/src/timeline/LocationComponent.qml @@ -9,6 +9,7 @@ import QtLocation import QtPositioning import org.kde.neochat +import org.kde.kirigami as Kirigami /** * @brief A component to show a location from a message. @@ -101,6 +102,18 @@ ColumnLayout { Qt.openUrlExternally(link); } } + + Button { + anchors { + top: parent.top + right: parent.right + margins: Kirigami.Units.smallSpacing + } + + text: i18nc("@action:button Open the location in an external program", "Open Externally") + icon.name: "compass" + onClicked: Qt.openUrlExternally("geo:" + root.latitude + "," + root.longitude) + } } Component { id: fullScreenMap