Browse Source

MessageIndicator: handle url & parameter links

QGC4.4
Beat Küng 2 years ago committed by Don Gagne
parent
commit
5fed5222df
  1. 26
      src/ui/toolbar/MessageIndicator.qml

26
src/ui/toolbar/MessageIndicator.qml

@ -14,6 +14,7 @@ import QtQuick.Layouts 1.2
import QGroundControl 1.0 import QGroundControl 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.MultiVehicleManager 1.0 import QGroundControl.MultiVehicleManager 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
@ -142,6 +143,10 @@ Item {
} }
} }
FactPanelController {
id: controller
}
QGCFlickable { QGCFlickable {
id: messageFlick id: messageFlick
anchors.margins: ScreenTools.defaultFontPixelHeight anchors.margins: ScreenTools.defaultFontPixelHeight
@ -158,6 +163,27 @@ Item {
color: qgcPal.text color: qgcPal.text
selectionColor: qgcPal.text selectionColor: qgcPal.text
selectedTextColor: qgcPal.window selectedTextColor: qgcPal.window
property var fact: null
onLinkActivated: {
if (link.startsWith('param://')) {
var paramName = link.substr(8);
fact = controller.getParameterFact(-1, paramName, true)
if (fact != null) {
paramEditorDialogComponent.createObject(mainWindow).open()
}
} else {
Qt.openUrlExternally(link);
}
}
}
Component {
id: paramEditorDialogComponent
ParameterEditorDialog {
title: qsTr("Edit Parameter")
fact: messageText.fact
destroyOnClose: true
}
} }
} }
} }

Loading…
Cancel
Save