Commit 4d3dd793 authored by Don Gagne's avatar Don Gagne

ViewWithDialog -> QGCView

- More more on making QGCView real
- Converted Parameter Editor to QGCView
parent ccc5f622
...@@ -32,7 +32,10 @@ ...@@ -32,7 +32,10 @@
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file> <file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/arrow-down.png">src/QmlControls/arrow-down.png</file> <file alias="QGroundControl/Controls/arrow-down.png">src/QmlControls/arrow-down.png</file>
<file alias="QGroundControl/Controls/ViewWidget.qml">src/ViewWidgets/ViewWidget.qml</file> <file alias="QGroundControl/Controls/ViewWidget.qml">src/ViewWidgets/ViewWidget.qml</file>
<file alias="QGroundControl/Controls/ViewWithDialog.qml">src/QmlControls/ViewWithDialog.qml</file>
<file alias="QGroundControl/Controls/QGCView.qml">src/QmlControls/QGCView.qml</file>
<file alias="QGroundControl/Controls/QGCViewPanel.qml">src/QmlControls/QGCViewPanel.qml</file>
<file alias="QGroundControl/Controls/QGCViewDialog.qml">src/QmlControls/QGCViewDialog.qml</file>
<file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file> <file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file>
......
...@@ -32,8 +32,9 @@ import QGroundControl.Palette 1.0 ...@@ -32,8 +32,9 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
ViewWithDialog { QGCView {
viewComponent: view id: rootQGCView
viewComponent: view
Component { Component {
id: view id: view
...@@ -45,9 +46,13 @@ ViewWithDialog { ...@@ -45,9 +46,13 @@ ViewWithDialog {
signal showDialog(Component component, string title, int charWidth, int buttons) signal showDialog(Component component, string title, int charWidth, int buttons)
signal hideDialog signal hideDialog
function doWorkAfterComponentCompleted() { Connections {
if (controller.showCustomConfigPanel) { target: rootQGCView
panel.showDialog(customConfigDialog, "Custom Airframe Config", 50, StandardButton.Reset)
onCompleted: {
if (controller.showCustomConfigPanel) {
panel.showDialog(customConfigDialog, "Custom Airframe Config", 50, StandardButton.Reset)
}
} }
} }
......
This diff is collapsed.
...@@ -35,14 +35,22 @@ import QGroundControl.FactSystem 1.0 ...@@ -35,14 +35,22 @@ import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0 import QGroundControl.FactControls 1.0
Item { Item {
id: __rootItem
property Component viewComponent property Component viewComponent
/// 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
/// to go.
signal completed
function __showDialog(component, title, charWidth, buttons) { function __showDialog(component, title, charWidth, buttons) {
__acceptButton.visible = false __acceptButton.visible = false
__rejectButton.visible = false __rejectButton.visible = false
__dialogCharWidth = charWidth __dialogCharWidth = charWidth
__dialogTitle = title __dialogTitle = title
// Accept role buttons
if (buttons & StandardButton.Ok) { if (buttons & StandardButton.Ok) {
__acceptButton.text = "Ok" __acceptButton.text = "Ok"
__acceptButton.visible = true __acceptButton.visible = true
...@@ -52,12 +60,6 @@ Item { ...@@ -52,12 +60,6 @@ Item {
} else if (buttons & StandardButton.Save) { } else if (buttons & StandardButton.Save) {
__acceptButton.text = "Save" __acceptButton.text = "Save"
__acceptButton.visible = true __acceptButton.visible = true
} else if (buttons & StandardButton.Cancel) {
__rejectButton.text = "Cancel"
__rejectButton.visible = true
} else if (buttons & StandardButton.Close) {
__rejectButton.text = "Cancel"
__rejectButton.visible = true
} else if (buttons & StandardButton.Apply) { } else if (buttons & StandardButton.Apply) {
__acceptButton.text = "Apply" __acceptButton.text = "Apply"
__acceptButton.visible = true __acceptButton.visible = true
...@@ -73,15 +75,6 @@ Item { ...@@ -73,15 +75,6 @@ Item {
} else if (buttons & StandardButton.YesToAll) { } else if (buttons & StandardButton.YesToAll) {
__acceptButton.text = "Yes to All" __acceptButton.text = "Yes to All"
__acceptButton.visible = true __acceptButton.visible = true
} else if (buttons & StandardButton.No) {
__rejectButton.text = "No"
__rejectButton.visible = true
} else if (buttons & StandardButton.NoToAll) {
__rejectButton.text = "No to All"
__rejectButton.visible = true
} else if (buttons & StandardButton.Abort) {
__rejectButton.text = "Abort"
__rejectButton.visible = true
} else if (buttons & StandardButton.Retry) { } else if (buttons & StandardButton.Retry) {
__acceptButton.text = "Retry" __acceptButton.text = "Retry"
__acceptButton.visible = true __acceptButton.visible = true
...@@ -95,6 +88,25 @@ Item { ...@@ -95,6 +88,25 @@ Item {
__acceptButton.text = "Ignore" __acceptButton.text = "Ignore"
__acceptButton.visible = true __acceptButton.visible = true
} }
// Reject role buttons
if (buttons & StandardButton.Cancel) {
__rejectButton.text = "Cancel"
__rejectButton.visible = true
} else if (buttons & StandardButton.Close) {
__rejectButton.text = "Cancel"
__rejectButton.visible = true
} else if (buttons & StandardButton.No) {
__rejectButton.text = "No"
__rejectButton.visible = true
} else if (buttons & StandardButton.NoToAll) {
__rejectButton.text = "No to All"
__rejectButton.visible = true
} else if (buttons & StandardButton.Abort) {
__rejectButton.text = "Abort"
__rejectButton.visible = true
}
__dialogComponent = component __dialogComponent = component
__viewPanel.enabled = false __viewPanel.enabled = false
__dialogOverlay.visible = true __dialogOverlay.visible = true
...@@ -120,7 +132,7 @@ Item { ...@@ -120,7 +132,7 @@ Item {
property Component __dialogComponent property Component __dialogComponent
Component.onCompleted: __viewPanel.item.doWorkAfterComponentCompleted() Component.onCompleted: completed()
Connections { Connections {
target: __viewPanel.item target: __viewPanel.item
...@@ -161,7 +173,7 @@ Item { ...@@ -161,7 +173,7 @@ Item {
// This is the main dialog panel which is anchored to the right edge // This is the main dialog panel which is anchored to the right edge
Rectangle { Rectangle {
id: __dialogPanel id: __dialogPanel
width: __textWidth * __dialogCharWidth width: __dialogCharWidth == -1 ? parent.width : __textWidth * __dialogCharWidth
height: parent.height height: parent.height
anchors.right: parent.right anchors.right: parent.right
color: __qgcPal.windowShadeDark color: __qgcPal.windowShadeDark
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
/// @author Don Gagne <don@thegagnes.com>
import QtQuick 2.3
import QtQuick.Controls 1.3
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
Rectangle {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
signal hideDialog
function accept() {
hideDialog()
}
function reject() {
hideDialog()
}
color: qgcPal.windowShadeDark
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
/// @author Don Gagne <don@thegagnes.com>
import QtQuick 2.3
import QtQuick.Controls 1.3
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
Rectangle {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
signal showDialog(Component component, string title, int charWidth, int buttons)
signal hideDialog
color: qgcPal.window
}
...@@ -16,5 +16,8 @@ VehicleRotationCal 1.0 VehicleRotationCal.qml ...@@ -16,5 +16,8 @@ VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ParameterEditor 1.0 ParameterEditor.qml ParameterEditor 1.0 ParameterEditor.qml
ViewWidget 1.0 ViewWidget.qml ViewWidget 1.0 ViewWidget.qml
ViewWithDialog 1.0 ViewWithDialog.qml
QGCView 1.0 QGCView.qml
QGCViewPanel 1.0 QGCViewPanel.qml
QGCViewDialog 1.0 QGCViewDialog.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