From b6cd4c8726cd39cf6306d201652450c1ce732451 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 30 Jan 2018 18:40:21 +0000 Subject: [PATCH] Launcher: show aircraft URI and local path Shift-clicking on the compact delegate will show the local path and URI of the aircraft, to identify the source. --- src/GUI/qml/AircraftCompactDelegate.qml | 23 +++++++++++++++++++++-- src/GUI/qml/AircraftVariantChoice.qml | 4 ++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/GUI/qml/AircraftCompactDelegate.qml b/src/GUI/qml/AircraftCompactDelegate.qml index d4e14bbc9..503ceded7 100644 --- a/src/GUI/qml/AircraftCompactDelegate.qml +++ b/src/GUI/qml/AircraftCompactDelegate.qml @@ -14,9 +14,27 @@ Item { readonly property bool __isSelected: (_launcher.selectedAircraft == model.uri) + property bool __showAlternateText: false + + function cycleTextDisplay() + { + __showAlternateText = !__showAlternateText; + } + + function alternateText() + { + return qsTr("URI: %1\nLocal path: %2").arg(model.uri).arg(titleBox.pathOnDisk); + } + MouseArea { anchors.fill: parent + onClicked: { + if (mouse.modifiers & Qt.ShiftModifier ) { + root.cycleTextDisplay(); + return; + } + if (__isSelected) { root.showDetails(model.uri) } else { @@ -75,12 +93,13 @@ Item { Text { id: description width: parent.width - text: model.description + text: root.__showAlternateText ? root.alternateText() + : model.description maximumLineCount: 3 wrapMode: Text.WordWrap elide: Text.ElideRight height: implicitHeight - visible: model.description != "" + visible: (model.description != "") || root.__showAlternateText } AircraftDownloadPanel diff --git a/src/GUI/qml/AircraftVariantChoice.qml b/src/GUI/qml/AircraftVariantChoice.qml index 72f164573..5ad5f4e08 100644 --- a/src/GUI/qml/AircraftVariantChoice.qml +++ b/src/GUI/qml/AircraftVariantChoice.qml @@ -21,6 +21,10 @@ Rectangle { property alias fontPixelSize: title.font.pixelSize property int popupFontPixelSize: 0 + // expose this to avoid a second AircraftInfo in the compact delegate + // really should refactor to put the AircraftInfo up there. + readonly property string pathOnDisk: aircraftInfo.pathOnDisk + signal selected(var index) Text {