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:
parent
db57b12723
commit
b6cd4c8726
2 changed files with 25 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue