1
0
Fork 0

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.
This commit is contained in:
James Turner 2018-01-30 18:40:21 +00:00
parent db57b12723
commit b6cd4c8726
2 changed files with 25 additions and 2 deletions

View file

@ -14,9 +14,27 @@ Item {
readonly property bool __isSelected: (_launcher.selectedAircraft == model.uri) 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 { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
if (mouse.modifiers & Qt.ShiftModifier ) {
root.cycleTextDisplay();
return;
}
if (__isSelected) { if (__isSelected) {
root.showDetails(model.uri) root.showDetails(model.uri)
} else { } else {
@ -75,12 +93,13 @@ Item {
Text { Text {
id: description id: description
width: parent.width width: parent.width
text: model.description text: root.__showAlternateText ? root.alternateText()
: model.description
maximumLineCount: 3 maximumLineCount: 3
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
elide: Text.ElideRight elide: Text.ElideRight
height: implicitHeight height: implicitHeight
visible: model.description != "" visible: (model.description != "") || root.__showAlternateText
} }
AircraftDownloadPanel AircraftDownloadPanel

View file

@ -21,6 +21,10 @@ Rectangle {
property alias fontPixelSize: title.font.pixelSize property alias fontPixelSize: title.font.pixelSize
property int popupFontPixelSize: 0 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) signal selected(var index)
Text { Text {