Commit e3a27797 authored by Don Gagne's avatar Don Gagne

Merge pull request #1627 from DonLakeFlyer/QGCView

QGCViewPanel no longer needs to be in component
parents c0a45987 d1632543
This diff is collapsed.
This diff is collapsed.
......@@ -34,7 +34,7 @@ import QGroundControl.ScreenTools 1.0
FactPanel {
id: panel
QGCPalette { id: palette; colorGroupEnabled: true }
QGCPalette { id: palette; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel }
property int flightLineWidth: 2 // width of lines for flight graphic
......
......@@ -32,9 +32,9 @@ import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
Rectangle {
color: __qgcPal.window
color: qgcPal.window
QGCPalette { id: __qgcPal; colorGroupEnabled: true }
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
property string __missingParams: ""
property string __errorMsg: ""
......@@ -57,7 +57,7 @@ Rectangle {
anchors.fill: parent
z: 9999
visible: false
color: __qgcPal.window
color: qgcPal.window
opacity: 0.85
QGCLabel {
......
This diff is collapsed.
......@@ -37,10 +37,9 @@ import QGroundControl.FactControls 1.0
FactPanel {
id: __rootItem
property bool __completedSignalled: false
property bool completedSignalled: false
property Component viewComponent
property var viewPanel: __viewPanelLoader.item
property var viewPanel
/// This is signalled when the top level Item reaches Component.onCompleted. This allows
/// the view subcomponent to connect to this signal and do work once the full ui is ready
......@@ -115,7 +114,17 @@ FactPanel {
}
}
function __checkForEarlyDialog() {
if (!completedSignalled) {
console.warn("showDialog|Message called before QGCView.completed signalled")
}
}
function showDialog(component, title, charWidth, buttons) {
if (__checkForEarlyDialog()) {
return
}
__stopAllAnimations()
__dialogCharWidth = charWidth
......@@ -124,13 +133,17 @@ FactPanel {
__setupDialogButtons(buttons)
__dialogComponent = component
__viewPanelLoader.enabled = false
viewPanel.enabled = false
__dialogOverlay.visible = true
__animateShowDialog.start()
}
function showMessage(title, message, buttons) {
if (__checkForEarlyDialog()) {
return
}
__stopAllAnimations()
__dialogCharWidth = 50
......@@ -140,14 +153,14 @@ FactPanel {
__setupDialogButtons(buttons)
__dialogComponent = __messageDialog
__viewPanelLoader.enabled = false
viewPanel.enabled = false
__dialogOverlay.visible = true
__animateShowDialog.start()
}
function hideDialog() {
__viewPanelLoader.enabled = true
viewPanel.enabled = true
__animateHideDialog.start()
}
......@@ -171,8 +184,8 @@ FactPanel {
// When we use this control inside a QGCQmlWidgetHolder Component.onCompleted is signalled
// before the width and height are adjusted. So we need to wait for width and heigth to be
// set before we signal our own completed signal.
if (!__completedSignalled && width != 0 && height != 0) {
__completedSignalled = true
if (!completedSignalled && width != 0 && height != 0) {
completedSignalled = true
completed()
}
}
......@@ -181,27 +194,12 @@ FactPanel {
onWidthChanged: __signalCompleted()
onHeightChanged: __signalCompleted()
Connections {
target: __viewPanelLoader.item
onShowDialog: __rootItem.showDialog(component, title, charWidth, buttons)
onShowMessage: __rootItem.showMessage(title, message, buttons)
onHideDialog: __rootItem.hideDialog()
}
Connections {
target: __dialogComponentLoader.item
onHideDialog: __rootItem.hideDialog()
}
Loader {
id: __viewPanelLoader
anchors.fill: parent
focus: true
sourceComponent: viewComponent
}
Item {
id: __dialogOverlay
visible: false
......
......@@ -34,11 +34,5 @@ import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
FactPanel {
QGCPalette { id: __qgcPal; colorGroupEnabled: enabled }
signal showDialog(Component component, string title, int charWidth, int buttons)
signal hideDialog
signal showMessage(string title, string message, int buttons)
color: __qgcPal.window
}
This diff is collapsed.
......@@ -167,6 +167,7 @@ void RadioConfigTest::init(void)
// This will instatiate the widget with an active uas with ready parameters
_calWidget = new QGCQmlWidgetHolder();
_calWidget->resize(600, 600);
Q_CHECK_PTR(_calWidget);
_calWidget->setAutoPilot(_autopilot);
_calWidget->setSource(QUrl::fromUserInput("qrc:/qml/RadioComponent.qml"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment