Browse Source

Merge pull request #3891 from DonLakeFlyer/ViewNaming

View naming
QGC4.4
Don Gagne 9 years ago committed by GitHub
parent
commit
9aa3d174b3
  1. 3
      qgroundcontrol.pro
  2. 2
      qgroundcontrol.qrc
  3. 2
      src/FirmwarePlugin/APM/MavCmdInfoCommon.json
  4. 2
      src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json
  5. 2
      src/FirmwarePlugin/PX4/MavCmdInfoFixedWing.json
  6. 31
      src/FlightDisplay/FlightDisplayViewWidgets.qml
  7. 38
      src/MissionEditor/MissionEditor.qml
  8. 10
      src/MissionManager/MavCmdInfoCommon.json
  9. 7
      src/QGCMapPalette.h
  10. 2
      src/Vehicle/GPSFact.json
  11. 6
      src/Vehicle/VehicleFact.json
  12. 2
      src/Vehicle/WindFact.json
  13. 40
      src/VehicleSetup/SetupView.qml
  14. 198
      src/ui/AppSettings.qml
  15. 13
      src/ui/MainWindow.cc
  16. 4
      src/ui/MainWindow.h
  17. 12
      src/ui/MainWindow.ui
  18. 51
      src/ui/MainWindowInner.qml
  19. 222
      src/ui/MainWindowLeftPanel.qml
  20. 57
      src/ui/SettingsDialog.cc
  21. 37
      src/ui/SettingsDialog.h
  22. 43
      src/ui/SettingsDialog.ui
  23. 6
      src/ui/toolbar/MainToolBar.qml

3
qgroundcontrol.pro

@ -238,7 +238,6 @@ FORMS += \
src/ui/QGCTabbedInfoView.ui \ src/ui/QGCTabbedInfoView.ui \
src/ui/QGCUASFileView.ui \ src/ui/QGCUASFileView.ui \
src/ui/QGCUASFileViewMulti.ui \ src/ui/QGCUASFileViewMulti.ui \
src/ui/SettingsDialog.ui \
src/ui/uas/UASQuickView.ui \ src/ui/uas/UASQuickView.ui \
src/ui/uas/UASQuickViewItemSelect.ui \ src/ui/uas/UASQuickViewItemSelect.ui \
src/ui/UASInfo.ui \ src/ui/UASInfo.ui \
@ -363,7 +362,6 @@ HEADERS += \
src/ui/MultiVehicleDockWidget.h \ src/ui/MultiVehicleDockWidget.h \
src/ui/QGCMAVLinkLogPlayer.h \ src/ui/QGCMAVLinkLogPlayer.h \
src/ui/QGCMapRCToParamDialog.h \ src/ui/QGCMapRCToParamDialog.h \
src/ui/SettingsDialog.h \
src/ui/uas/UASMessageView.h \ src/ui/uas/UASMessageView.h \
src/ui/uas/QGCUnconnectedInfoWidget.h \ src/ui/uas/QGCUnconnectedInfoWidget.h \
src/ui/QGCDataPlot2D.h \ src/ui/QGCDataPlot2D.h \
@ -490,7 +488,6 @@ SOURCES += \
src/ui/uas/UASMessageView.cc \ src/ui/uas/UASMessageView.cc \
src/uas/FileManager.cc \ src/uas/FileManager.cc \
src/ui/uas/QGCUnconnectedInfoWidget.cc \ src/ui/uas/QGCUnconnectedInfoWidget.cc \
src/ui/SettingsDialog.cc \
src/ui/MAVLinkDecoder.cc \ src/ui/MAVLinkDecoder.cc \
src/ui/MAVLinkSettingsWidget.cc \ src/ui/MAVLinkSettingsWidget.cc \
src/ui/QGCMapRCToParamDialog.cpp \ src/ui/QGCMapRCToParamDialog.cpp \

2
qgroundcontrol.qrc

@ -37,7 +37,7 @@
<file alias="MainWindowHybrid.qml">src/ui/MainWindowHybrid.qml</file> <file alias="MainWindowHybrid.qml">src/ui/MainWindowHybrid.qml</file>
<file alias="MainWindowInner.qml">src/ui/MainWindowInner.qml</file> <file alias="MainWindowInner.qml">src/ui/MainWindowInner.qml</file>
<file alias="MainWindowNative.qml">src/ui/MainWindowNative.qml</file> <file alias="MainWindowNative.qml">src/ui/MainWindowNative.qml</file>
<file alias="MainWindowLeftPanel.qml">src/ui/MainWindowLeftPanel.qml</file> <file alias="AppSettings.qml">src/ui/AppSettings.qml</file>
<file alias="MissionEditor.qml">src/MissionEditor/MissionEditor.qml</file> <file alias="MissionEditor.qml">src/MissionEditor/MissionEditor.qml</file>
<file alias="MotorComponent.qml">src/AutoPilotPlugins/Common/MotorComponent.qml</file> <file alias="MotorComponent.qml">src/AutoPilotPlugins/Common/MotorComponent.qml</file>
<file alias="PowerComponent.qml">src/AutoPilotPlugins/PX4/PowerComponent.qml</file> <file alias="PowerComponent.qml">src/AutoPilotPlugins/PX4/PowerComponent.qml</file>

2
src/FirmwarePlugin/APM/MavCmdInfoCommon.json

@ -12,7 +12,7 @@
"category": "Basic", "category": "Basic",
"param1": { "param1": {
"label": "Pitch:", "label": "Pitch:",
"units": "degrees", "units": "deg",
"default": 15, "default": 15,
"decimalPlaces": 2 "decimalPlaces": 2
}, },

2
src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json

@ -147,7 +147,7 @@
"category": "Basic", "category": "Basic",
"param1": { "param1": {
"label": "Pitch:", "label": "Pitch:",
"units": "degrees", "units": "deg",
"default": 10, "default": 10,
"decimalPlaces": 0 "decimalPlaces": 0
}, },

2
src/FirmwarePlugin/PX4/MavCmdInfoFixedWing.json

@ -135,7 +135,7 @@
"category": "Basic", "category": "Basic",
"param1": { "param1": {
"label": "Pitch:", "label": "Pitch:",
"units": "degrees", "units": "deg",
"default": 10, "default": 10,
"decimalPlaces": 0 "decimalPlaces": 0
}, },

31
src/FlightDisplay/FlightDisplayViewWidgets.qml

@ -30,13 +30,13 @@ Item {
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
property bool _lightWidgetBorders: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true property bool _lightWidgetBorders: _isSatellite
property bool _useAlternateInstruments: QGroundControl.virtualTabletJoystick || ScreenTools.isTinyScreen property bool _useAlternateInstruments: QGroundControl.virtualTabletJoystick || ScreenTools.isTinyScreen
readonly property real _margins: ScreenTools.defaultFontPixelHeight / 2
readonly property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2)
readonly property real _margins: ScreenTools.defaultFontPixelHeight / 2 QGCMapPalette { id: mapPal; lightColors: isBackgroundDark }
QGCMapPalette { id: mapPal; lightColors: !isBackgroundDark }
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
function getGadgetWidth() { function getGadgetWidth() {
@ -139,14 +139,25 @@ Item {
maxHeight: virtualJoystickMultiTouch.visible ? virtualJoystickMultiTouch.y - y : parent.height - anchors.margins - y maxHeight: virtualJoystickMultiTouch.visible ? virtualJoystickMultiTouch.y - y : parent.height - anchors.margins - y
} }
QGCLabel {
id: flyLabel
text: qsTr("Fly")
color: mapPal.text
visible: !ScreenTools.isShortScreen
anchors.topMargin: _toolButtonTopMargin
anchors.horizontalCenter: toolColumn.horizontalCenter
anchors.top: parent.top
}
//-- Vertical Tool Buttons //-- Vertical Tool Buttons
Column { Column {
id: toolColumn id: toolColumn
visible: _mainIsMap anchors.topMargin: ScreenTools.isShortScreen ? _toolButtonTopMargin : ScreenTools.defaultFontPixelHeight / 2
anchors.margins: ScreenTools.defaultFontPixelHeight anchors.leftMargin: ScreenTools.defaultFontPixelHeight
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: ScreenTools.isShortScreen ? parent.top : flyLabel.bottom
spacing: ScreenTools.defaultFontPixelHeight spacing: ScreenTools.defaultFontPixelHeight
visible: _mainIsMap
//-- Map Center Control //-- Map Center Control
DropButton { DropButton {

38
src/MissionEditor/MissionEditor.qml

@ -33,17 +33,19 @@ QGCView {
// zOrder comes from the Loader in MainWindow.qml // zOrder comes from the Loader in MainWindow.qml
z: QGroundControl.zOrderTopMost z: QGroundControl.zOrderTopMost
readonly property int _decimalPlaces: 8 readonly property int _decimalPlaces: 8
readonly property real _horizontalMargin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _horizontalMargin: ScreenTools.defaultFontPixelWidth / 2
readonly property real _margin: ScreenTools.defaultFontPixelHeight * 0.5 readonly property real _margin: ScreenTools.defaultFontPixelHeight * 0.5
readonly property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle readonly property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30) readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30)
readonly property real _rightPanelOpacity: 0.8 readonly property real _rightPanelOpacity: 0.8
readonly property int _toolButtonCount: 6 readonly property int _toolButtonCount: 6
readonly property string _autoSyncKey: "AutoSync" readonly property string _autoSyncKey: "AutoSync"
readonly property real _toolButtonTopMargin: parent.height - ScreenTools.availableHeight + (ScreenTools.defaultFontPixelHeight / 2)
readonly property int _addMissionItemsButtonAutoOffTimeout: 10000 readonly property int _addMissionItemsButtonAutoOffTimeout: 10000
readonly property var _defaultVehicleCoordinate: QtPositioning.coordinate(37.803784, -122.462276) readonly property var _defaultVehicleCoordinate: QtPositioning.coordinate(37.803784, -122.462276)
property bool _syncNeeded: controller.visualItems.dirty // Unsaved changes, visible to parent container property bool _syncNeeded: controller.visualItems.dirty // Unsaved changes, visible to parent container
property var _visualItems: controller.visualItems property var _visualItems: controller.visualItems
property var _currentMissionItem property var _currentMissionItem
@ -272,6 +274,8 @@ QGCView {
} }
} }
QGCMapPalette { id: mapPal; lightColors: editorMap.isSatelliteMap }
MouseArea { MouseArea {
//-- It's a whole lot faster to just fill parent and deal with top offset below //-- It's a whole lot faster to just fill parent and deal with top offset below
// than computing the coordinate offset. // than computing the coordinate offset.
@ -524,13 +528,23 @@ QGCView {
} }
} }
QGCLabel {
id: planLabel
text: qsTr("Plan")
color: mapPal.text
visible: !ScreenTools.isShortScreen
anchors.topMargin: _toolButtonTopMargin
anchors.horizontalCenter: toolColumn.horizontalCenter
anchors.top: parent.top
}
//-- Vertical Tool Buttons //-- Vertical Tool Buttons
Column { Column {
id: toolColumn id: toolColumn
anchors.topMargin: parent.height - ScreenTools.availableHeight + ScreenTools.defaultFontPixelHeight anchors.topMargin: ScreenTools.isShortScreen ? _toolButtonTopMargin : ScreenTools.defaultFontPixelHeight / 2
anchors.margins: ScreenTools.defaultFontPixelHeight anchors.leftMargin: ScreenTools.defaultFontPixelHeight
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: ScreenTools.isShortScreen ? parent.top : planLabel.bottom
spacing: ScreenTools.defaultFontPixelHeight spacing: ScreenTools.defaultFontPixelHeight
z: QGroundControl.zOrderWidgets z: QGroundControl.zOrderWidgets
@ -749,7 +763,7 @@ QGCView {
width: sendSaveGrid.width width: sendSaveGrid.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: _syncNeeded && !controller.autoSync ? text: _syncNeeded && !controller.autoSync ?
qsTr("You have unsaved changed to you mission. You should send to your vehicle, or save to a file:") : qsTr("You have unsaved changes to your mission. You should send to your vehicle, or save to a file:") :
qsTr("Sync:") qsTr("Sync:")
} }
GridLayout { GridLayout {

10
src/MissionManager/MavCmdInfoCommon.json

@ -138,7 +138,7 @@
"category": "Basic", "category": "Basic",
"param1": { "param1": {
"label": "Pitch:", "label": "Pitch:",
"units": "degrees", "units": "deg",
"default": 15, "default": 15,
"decimalPlaces": 2 "decimalPlaces": 2
}, },
@ -250,7 +250,7 @@
"param4": { "param4": {
"label": "Heading goal:", "label": "Heading goal:",
"default": 0, "default": 0,
"units": "degrees", "units": "deg",
"decimalPlaces": 2 "decimalPlaces": 2
} }
}, },
@ -280,7 +280,7 @@
"category": "VTOL", "category": "VTOL",
"param4": { "param4": {
"label": "Heading:", "label": "Heading:",
"units": "degrees", "units": "deg",
"default": 0.0, "default": 0.0,
"decimalPlaces": 2 "decimalPlaces": 2
} }
@ -295,7 +295,7 @@
"category": "VTOL", "category": "VTOL",
"param4": { "param4": {
"label": "Heading:", "label": "Heading:",
"units": "degrees", "units": "deg",
"default": 0.0, "default": 0.0,
"decimalPlaces": 2 "decimalPlaces": 2
}, },
@ -371,7 +371,7 @@
"category": "Conditionals", "category": "Conditionals",
"param1": { "param1": {
"label": "Heading:", "label": "Heading:",
"units": "degrees", "units": "deg",
"default": 0, "default": 0,
"decimalPlaces": 1 "decimalPlaces": 1
}, },

7
src/QGCMapPalette.h

@ -28,7 +28,7 @@ class QGCMapPalette : public QObject
// text - Text color // text - Text color
// thumbJoystick - Thumb joystick indicator // thumbJoystick - Thumb joystick indicator
Q_PROPERTY(QColor text READ text NOTIFY paletteChanged) Q_PROPERTY(QColor text READ text NOTIFY paletteChanged)
Q_PROPERTY(QColor thumbJoystick READ thumbJoystick NOTIFY paletteChanged) Q_PROPERTY(QColor thumbJoystick READ thumbJoystick NOTIFY paletteChanged)
public: public:
@ -37,11 +37,12 @@ public:
bool lightColors(void) const { return _lightColors; } bool lightColors(void) const { return _lightColors; }
void setLightColors(bool lightColors); void setLightColors(bool lightColors);
QColor text(void) const { return _text[_lightColors]; } QColor text(void) const { return _text[_lightColors ? 0 : 1]; }
QColor thumbJoystick(void) const { return _thumbJoystick[_lightColors]; } QColor thumbJoystick(void) const { return _thumbJoystick[_lightColors ? 0 : 1]; }
signals: signals:
void paletteChanged(void); void paletteChanged(void);
void lightColorsChanged(bool lightColors);
private: private:
bool _lightColors; bool _lightColors;

2
src/Vehicle/GPSFact.json

@ -19,7 +19,7 @@
"shortDescription": "Course Over Ground", "shortDescription": "Course Over Ground",
"type": "double", "type": "double",
"decimalPlaces": 1, "decimalPlaces": 1,
"units": "degrees" "units": "deg"
}, },
{ {
"name": "lock", "name": "lock",

6
src/Vehicle/VehicleFact.json

@ -7,21 +7,21 @@
"shortDescription": "Roll", "shortDescription": "Roll",
"type": "double", "type": "double",
"decimalPlaces": 1, "decimalPlaces": 1,
"units": "degrees" "units": "deg"
}, },
{ {
"name": "pitch", "name": "pitch",
"shortDescription": "Pitch", "shortDescription": "Pitch",
"type": "double", "type": "double",
"decimalPlaces": 1, "decimalPlaces": 1,
"units": "degrees" "units": "deg"
}, },
{ {
"name": "heading", "name": "heading",
"shortDescription": "Heading", "shortDescription": "Heading",
"type": "double", "type": "double",
"decimalPlaces": 0, "decimalPlaces": 0,
"units": "degrees" "units": "deg"
}, },
{ {
"name": "groundSpeed", "name": "groundSpeed",

2
src/Vehicle/WindFact.json

@ -7,7 +7,7 @@
"shortDescription": "Wind Direction", "shortDescription": "Wind Direction",
"type": "double", "type": "double",
"decimalPlaces": 1, "decimalPlaces": 1,
"units": "degrees" "units": "deg"
}, },
{ {
"name": "speed", "name": "speed",

40
src/VehicleSetup/SetupView.qml

@ -23,7 +23,7 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.MultiVehicleManager 1.0 import QGroundControl.MultiVehicleManager 1.0
Rectangle { Rectangle {
id: setupView id: setupView
color: qgcPal.window color: qgcPal.window
z: QGroundControl.zOrderTopMost z: QGroundControl.zOrderTopMost
@ -33,8 +33,9 @@ Rectangle {
readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight
readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth
readonly property real _margin: Math.round(_defaultTextHeight / 2) readonly property real _horizontalMargin: _defaultTextWidth / 2
readonly property real _buttonWidth: Math.round(_defaultTextWidth * 18) readonly property real _verticalMargin: _defaultTextHeight / 2
readonly property real _buttonWidth: _defaultTextWidth * 18
readonly property string _armedVehicleText: qsTr("This operation cannot be performed while vehicle is armed.") readonly property string _armedVehicleText: qsTr("This operation cannot be performed while vehicle is armed.")
property string _messagePanelText: "missing message panel text" property string _messagePanelText: "missing message panel text"
@ -211,6 +212,8 @@ Rectangle {
anchors.topMargin: _defaultTextHeight / 2 anchors.topMargin: _defaultTextHeight / 2
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.leftMargin: _horizontalMargin
anchors.left: parent.left
contentHeight: buttonColumn.height contentHeight: buttonColumn.height
flickableDirection: Flickable.VerticalFlick flickableDirection: Flickable.VerticalFlick
clip: true clip: true
@ -245,6 +248,15 @@ Rectangle {
} }
} }
QGCLabel {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Vehicle Setup")
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
visible: !ScreenTools.isShortScreen
}
SubMenuButton { SubMenuButton {
id: summaryButton id: summaryButton
imageResource: "/qmlimages/VehicleSummaryIcon.png" imageResource: "/qmlimages/VehicleSummaryIcon.png"
@ -315,13 +327,25 @@ Rectangle {
} }
} }
Rectangle {
id: divider
anchors.topMargin: _verticalMargin
anchors.bottomMargin: _verticalMargin
anchors.leftMargin: _horizontalMargin
anchors.left: buttonScroll.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 1
color: qgcPal.windowShade
}
Loader { Loader {
id: panelLoader id: panelLoader
anchors.topMargin: _margin anchors.topMargin: _verticalMargin
anchors.bottomMargin: _margin anchors.bottomMargin: _verticalMargin
anchors.leftMargin: _defaultTextWidth anchors.leftMargin: _horizontalMargin
anchors.rightMargin: _defaultTextWidth anchors.rightMargin: _horizontalMargin
anchors.left: buttonScroll.right anchors.left: divider.right
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

198
src/ui/AppSettings.qml

@ -0,0 +1,198 @@
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.5
import QtQuick.Controls 1.2
import QtPositioning 5.2
import QGroundControl 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.ScreenTools 1.0
Rectangle {
id: settingsView
color: qgcPal.window
z: QGroundControl.zOrderTopMost
readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight
readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth
readonly property real _horizontalMargin: _defaultTextWidth / 2
readonly property real _verticalMargin: _defaultTextHeight / 2
readonly property real _buttonHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight * 2
readonly property real _buttonWidth: ScreenTools.defaultFontPixelWidth * 10
QGCPalette { id: qgcPal }
Component.onCompleted: {
//-- Default to General Settings
__rightPanel.source = "GeneralSettings.qml"
_generalButton.checked = true
panelActionGroup.current = _generalButton
}
QGCFlickable {
id: buttonList
width: buttonColumn.width
anchors.topMargin: _verticalMargin
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: _horizontalMargin
anchors.left: parent.left
contentHeight: buttonColumn.height + _verticalMargin
flickableDirection: Flickable.VerticalFlick
clip: true
ExclusiveGroup { id: panelActionGroup }
Column {
id: buttonColumn
width: _maxButtonWidth
spacing: _verticalMargin
property real _maxButtonWidth: 0
Component.onCompleted: reflowWidths()
function reflowWidths() {
buttonColumn._maxButtonWidth = 0
for (var i = 0; i < children.length; i++) {
buttonColumn._maxButtonWidth = Math.max(buttonColumn._maxButtonWidth, children[i].width)
}
for (var j = 0; j < children.length; j++) {
children[j].width = buttonColumn._maxButtonWidth
}
}
QGCLabel {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Application Settings")
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
visible: !ScreenTools.isShortScreen
}
QGCButton {
id: _generalButton
height: _buttonHeight
text: qsTr("General")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "GeneralSettings.qml") {
__rightPanel.source = "GeneralSettings.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
text: qsTr("Comm Links")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "LinkSettings.qml") {
__rightPanel.source = "LinkSettings.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
text: qsTr("Offline Maps")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "OfflineMap.qml") {
__rightPanel.source = "OfflineMap.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
text: qsTr("MavLink")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "MavlinkSettings.qml") {
__rightPanel.source = "MavlinkSettings.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
text: qsTr("Console")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "QGroundControl/Controls/AppMessages.qml") {
__rightPanel.source = "QGroundControl/Controls/AppMessages.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
text: qsTr("Mock Link")
visible: ScreenTools.isDebug
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "MockLink.qml") {
__rightPanel.source = "MockLink.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
text: qsTr("Debug")
visible: ScreenTools.isDebug
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "DebugWindow.qml") {
__rightPanel.source = "DebugWindow.qml"
}
checked = true
}
}
}
}
Rectangle {
id: divider
anchors.topMargin: _verticalMargin
anchors.bottomMargin: _verticalMargin
anchors.leftMargin: _horizontalMargin
anchors.left: buttonList.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 1
color: qgcPal.windowShade
}
//-- Panel Contents
Loader {
id: __rightPanel
anchors.leftMargin: _horizontalMargin
anchors.rightMargin: _horizontalMargin
anchors.topMargin: _verticalMargin
anchors.bottomMargin: _verticalMargin
anchors.left: divider.right
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
}
}

13
src/ui/MainWindow.cc

@ -25,6 +25,7 @@
#include <QDesktopServices> #include <QDesktopServices>
#include <QDockWidget> #include <QDockWidget>
#include <QMenuBar> #include <QMenuBar>
#include <QDialog>
#include "QGC.h" #include "QGC.h"
#include "MAVLinkProtocol.h" #include "MAVLinkProtocol.h"
@ -42,7 +43,6 @@
#include "QGCImageProvider.h" #include "QGCImageProvider.h"
#ifndef __mobile__ #ifndef __mobile__
#include "SettingsDialog.h"
#include "QGCDataPlot2D.h" #include "QGCDataPlot2D.h"
#include "Linecharts.h" #include "Linecharts.h"
#include "QGCUASFileViewMulti.h" #include "QGCUASFileViewMulti.h"
@ -489,9 +489,6 @@ void MainWindow::connectCommonActions()
connect(qgcApp()->toolbox()->audioOutput(), &GAudioOutput::mutedChanged, _ui.actionMuteAudioOutput, &QAction::setChecked); connect(qgcApp()->toolbox()->audioOutput(), &GAudioOutput::mutedChanged, _ui.actionMuteAudioOutput, &QAction::setChecked);
connect(_ui.actionMuteAudioOutput, &QAction::triggered, qgcApp()->toolbox()->audioOutput(), &GAudioOutput::mute); connect(_ui.actionMuteAudioOutput, &QAction::triggered, qgcApp()->toolbox()->audioOutput(), &GAudioOutput::mute);
// Application Settings
connect(_ui.actionSettings, &QAction::triggered, this, &MainWindow::showSettings);
// Connect internal actions // Connect internal actions
connect(qgcApp()->toolbox()->multiVehicleManager(), &MultiVehicleManager::vehicleAdded, this, &MainWindow::_vehicleAdded); connect(qgcApp()->toolbox()->multiVehicleManager(), &MultiVehicleManager::vehicleAdded, this, &MainWindow::_vehicleAdded);
} }
@ -503,14 +500,6 @@ void MainWindow::_openUrl(const QString& url, const QString& errorMessage)
} }
} }
#ifndef __mobile__
void MainWindow::showSettings()
{
SettingsDialog settings(this);
settings.exec();
}
#endif
void MainWindow::_vehicleAdded(Vehicle* vehicle) void MainWindow::_vehicleAdded(Vehicle* vehicle)
{ {
connect(vehicle->uas(), &UAS::valueChanged, this, &MainWindow::valueChanged); connect(vehicle->uas(), &UAS::valueChanged, this, &MainWindow::valueChanged);

4
src/ui/MainWindow.h

@ -89,10 +89,6 @@ public:
QObject* rootQmlObject(void); QObject* rootQmlObject(void);
public slots: public slots:
#ifndef __mobile__
void showSettings();
#endif
/** @brief Save power by reducing update rates */ /** @brief Save power by reducing update rates */
void enableLowPowerMode(bool enabled) { _lowPowerMode = enabled; } void enableLowPowerMode(bool enabled) { _lowPowerMode = enabled; }

12
src/ui/MainWindow.ui

@ -61,7 +61,6 @@
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionMuteAudioOutput"/> <addaction name="actionMuteAudioOutput"/>
<addaction name="actionStatusBar"/> <addaction name="actionStatusBar"/>
<addaction name="actionSettings"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionExit"/> <addaction name="actionExit"/>
</widget> </widget>
@ -95,17 +94,6 @@
<string>Mute Audio Output</string> <string>Mute Audio Output</string>
</property> </property>
</action> </action>
<action name="actionSettings">
<property name="text">
<string>Settings</string>
</property>
<property name="toolTip">
<string>Application settings</string>
</property>
<property name="menuRole">
<enum>QAction::PreferencesRole</enum>
</property>
</action>
<action name="actionAdvanced_Mode"> <action name="actionAdvanced_Mode">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>

51
src/ui/MainWindowInner.qml

@ -29,7 +29,7 @@ Item {
readonly property string _planViewSource: "MissionEditor.qml" readonly property string _planViewSource: "MissionEditor.qml"
readonly property string _setupViewSource: "SetupView.qml" readonly property string _setupViewSource: "SetupView.qml"
readonly property string _preferencesSource: "MainWindowLeftPanel.qml" readonly property string _settingsViewSource: "AppSettings.qml"
QGCPalette { id: qgcPal; colorGroupEnabled: true } QGCPalette { id: qgcPal; colorGroupEnabled: true }
@ -56,7 +56,7 @@ Item {
currentPopUp.close() currentPopUp.close()
} }
ScreenTools.availableHeight = parent.height - toolBar.height ScreenTools.availableHeight = parent.height - toolBar.height
preferencesPanel.visible = false settingsViewLoader.visible = false
flightView.visible = true flightView.visible = true
setupViewLoader.visible = false setupViewLoader.visible = false
planViewLoader.visible = false planViewLoader.visible = false
@ -71,7 +71,7 @@ Item {
planViewLoader.source = _planViewSource planViewLoader.source = _planViewSource
} }
ScreenTools.availableHeight = parent.height - toolBar.height ScreenTools.availableHeight = parent.height - toolBar.height
preferencesPanel.visible = false settingsViewLoader.visible = false
flightView.visible = false flightView.visible = false
setupViewLoader.visible = false setupViewLoader.visible = false
planViewLoader.visible = true planViewLoader.visible = true
@ -87,27 +87,27 @@ Item {
if (setupViewLoader.source != _setupViewSource) { if (setupViewLoader.source != _setupViewSource) {
setupViewLoader.source = _setupViewSource setupViewLoader.source = _setupViewSource
} }
preferencesPanel.visible = false settingsViewLoader.visible = false
flightView.visible = false flightView.visible = false
setupViewLoader.visible = true setupViewLoader.visible = true
planViewLoader.visible = false planViewLoader.visible = false
toolBar.checkSetupButton() toolBar.checkSetupButton()
} }
function showPreferences() { function showSettingsView() {
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
} }
//-- In preferences view, the full height is available. Set to 0 so it is ignored. //-- In preferences view, the full height is available. Set to 0 so it is ignored.
ScreenTools.availableHeight = 0 ScreenTools.availableHeight = 0
if (preferencesPanel.source != _preferencesSource) { if (settingsViewLoader.source != _settingsViewSource) {
preferencesPanel.source = _preferencesSource settingsViewLoader.source = _settingsViewSource
} }
flightView.visible = false flightView.visible = false
setupViewLoader.visible = false setupViewLoader.visible = false
planViewLoader.visible = false planViewLoader.visible = false
preferencesPanel.visible = true settingsViewLoader.visible = true
toolBar.checkPreferencesButton() toolBar.checkSettingsButton()
} }
// The following are use for unit testing only // The following are use for unit testing only
@ -260,20 +260,6 @@ Item {
currentPopUp = indicatorDropdown currentPopUp = indicatorDropdown
} }
//-- Left Settings Menu
Loader {
id: preferencesPanel
anchors.fill: parent
visible: false
z: QGroundControl.zOrderTopMost + 100
active: visible
onVisibleChanged: {
if(!visible) {
source = ""
}
}
}
//-- Main UI //-- Main UI
MainToolBar { MainToolBar {
@ -283,13 +269,12 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
mainWindow: mainWindow mainWindow: mainWindow
opaqueBackground: preferencesPanel.visible
isBackgroundDark: flightView.isBackgroundDark isBackgroundDark: flightView.isBackgroundDark
z: QGroundControl.zOrderTopMost z: QGroundControl.zOrderTopMost
onShowSetupView: mainWindow.showSetupView() onShowSetupView: mainWindow.showSetupView()
onShowPlanView: mainWindow.showPlanView() onShowPlanView: mainWindow.showPlanView()
onShowFlyView: mainWindow.showFlyView() onShowFlyView: mainWindow.showFlyView()
onShowPreferences: mainWindow.showPreferences() onShowSettingsView: mainWindow.showSettingsView()
Component.onCompleted: { Component.onCompleted: {
ScreenTools.availableHeight = parent.height - toolBar.height ScreenTools.availableHeight = parent.height - toolBar.height
} }
@ -316,6 +301,22 @@ Item {
visible: false visible: false
} }
Loader {
id: settingsViewLoader
anchors.left: parent.left
anchors.right: parent.right
anchors.top: toolBar.bottom
anchors.bottom: parent.bottom
visible: false
onVisibleChanged: {
if (!visible) {
// Free up the memory for this when not shown. No need to persist.
source = ""
}
}
}
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- Dismiss Pop Up Messages //-- Dismiss Pop Up Messages
MouseArea { MouseArea {

222
src/ui/MainWindowLeftPanel.qml

@ -1,222 +0,0 @@
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.5
import QtQuick.Controls 1.2
import QtPositioning 5.2
import QGroundControl 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.ScreenTools 1.0
//-- Left Menu
Item {
id: settingsMenu
anchors.fill: parent
readonly property real __closeButtonSize: ScreenTools.defaultFontPixelHeight * 1.5
readonly property real _margins: ScreenTools.defaultFontPixelHeight * 0.5
readonly property real _buttonHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight * 2
QGCPalette { id: qgcPal }
Component.onCompleted: {
//-- Default to General Settings
__rightPanel.source = "GeneralSettings.qml"
_generalButton.checked = true
panelActionGroup.current = _generalButton
}
// This covers the screen with a transparent section
Rectangle {
id: __transparentSection
height: parent.height - toolBar.height
anchors.bottom: parent.bottom
anchors.left: parent.left
opacity: 0.0
color: qgcPal.window
visible: __rightPanel.source == ""
}
//-- Top Separator
Rectangle {
id: __topSeparator
width: parent.width
height: 1
y: toolBar.height
anchors.left: parent.left
color: QGroundControl.isDarkStyle ? "#909090" : "#7f7f7f"
}
// This is the menu dialog panel which is anchored to the left edge
Rectangle {
id: __leftMenu
width: ScreenTools.defaultFontPixelWidth * 16
anchors.left: parent.left
anchors.top: __topSeparator.bottom
anchors.bottom: parent.bottom
color: qgcPal.windowShadeDark
QGCFlickable {
anchors.fill: parent
contentHeight: buttonColumn.height + _margins
flickableDirection: Flickable.VerticalFlick
clip: true
ExclusiveGroup { id: panelActionGroup }
Column {
id: buttonColumn
anchors.leftMargin: _margins
anchors.rightMargin: _margins
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: _margins
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelHeight * 0.5
QGCLabel {
text: qsTr("Preferences")
anchors.horizontalCenter: parent.horizontalCenter
}
QGCButton {
id: _generalButton
height: _buttonHeight
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("General")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "GeneralSettings.qml") {
__rightPanel.source = "GeneralSettings.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Comm Links")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "LinkSettings.qml") {
__rightPanel.source = "LinkSettings.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Offline Maps")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "OfflineMap.qml") {
__rightPanel.source = "OfflineMap.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("MavLink")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "MavlinkSettings.qml") {
__rightPanel.source = "MavlinkSettings.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Console")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "QGroundControl/Controls/AppMessages.qml") {
__rightPanel.source = "QGroundControl/Controls/AppMessages.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Mock Link")
visible: ScreenTools.isDebug
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "MockLink.qml") {
__rightPanel.source = "MockLink.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Debug")
visible: ScreenTools.isDebug
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "DebugWindow.qml") {
__rightPanel.source = "DebugWindow.qml"
}
checked = true
}
}
}
}
}
//-- Vertical Separator
Rectangle {
id: __verticalSeparator
width: 1
height: parent.height - toolBar.height
anchors.left: __leftMenu.right
anchors.bottom: parent.bottom
color: QGroundControl.isDarkStyle ? "#909090" : "#7f7f7f"
}
//-- Main Setting Display Area
Rectangle {
id: settingDisplayArea
anchors.left: __verticalSeparator.right
width: mainWindow.width - __leftMenu.width - __verticalSeparator.width
height: parent.height - toolBar.height - __topSeparator.height
anchors.bottom: parent.bottom
visible: __rightPanel.source != ""
color: qgcPal.window
//-- Panel Contents
Loader {
id: __rightPanel
anchors.fill: parent
}
}
}

57
src/ui/SettingsDialog.cc

@ -1,57 +0,0 @@
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include <QSettings>
#include <QDesktopWidget>
#include "SettingsDialog.h"
#include "MainWindow.h"
#include "ui_SettingsDialog.h"
#include "LinkManager.h"
#include "MAVLinkProtocol.h"
#include "MAVLinkSettingsWidget.h"
#include "GAudioOutput.h"
#include "QGCApplication.h"
#include "QGCFileDialog.h"
#include "QGCMessageBox.h"
#include "MainToolBarController.h"
#include "FlightMapSettings.h"
SettingsDialog::SettingsDialog(QWidget *parent, Qt::WindowFlags flags)
: QDialog(parent, flags)
, _ui(new Ui::SettingsDialog)
{
_ui->setupUi(this);
// Center the window on the screen.
QDesktopWidget *desktop = QApplication::desktop();
int screen = desktop->screenNumber(parent);
QRect position = frameGeometry();
position.moveCenter(QApplication::desktop()->availableGeometry(screen).center());
move(position.topLeft());
MAVLinkSettingsWidget* pMavsettings = new MAVLinkSettingsWidget(qgcApp()->toolbox()->mavlinkProtocol(), this);
// Add the MAVLink settings pane
_ui->tabWidget->addTab(pMavsettings, "MAVLink");
this->window()->setWindowTitle(tr("QGroundControl Settings"));
_ui->tabWidget->setCurrentWidget(pMavsettings);
connect(_ui->buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog::accept);
}
SettingsDialog::~SettingsDialog()
{
delete _ui;
}

37
src/ui/SettingsDialog.h

@ -1,37 +0,0 @@
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
#include <QDialog>
#include "MainWindow.h"
#include "GAudioOutput.h"
#include "FlightMapSettings.h"
namespace Ui
{
class SettingsDialog;
}
class SettingsDialog : public QDialog
{
Q_OBJECT
public:
SettingsDialog(QWidget *parent = 0, Qt::WindowFlags flags = Qt::Sheet);
~SettingsDialog();
private:
Ui::SettingsDialog* _ui;
};
#endif

43
src/ui/SettingsDialog.ui

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>689</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QTabWidget" name="tabWidget"/>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

6
src/ui/toolbar/MainToolBar.qml

@ -45,14 +45,14 @@ Rectangle {
readonly property var colorBlue: "#636efe" readonly property var colorBlue: "#636efe"
readonly property var colorWhite: "#ffffff" readonly property var colorWhite: "#ffffff"
signal showPreferences() signal showSettingsView()
signal showSetupView() signal showSetupView()
signal showPlanView() signal showPlanView()
signal showFlyView() signal showFlyView()
MainToolBarController { id: _controller } MainToolBarController { id: _controller }
function checkPreferencesButton() { function checkSettingsButton() {
preferencesButton.checked = true preferencesButton.checked = true
} }
@ -332,7 +332,7 @@ Rectangle {
exclusiveGroup: mainActionGroup exclusiveGroup: mainActionGroup
source: "/res/QGCLogoWhite" source: "/res/QGCLogoWhite"
logo: true logo: true
onClicked: toolBar.showPreferences() onClicked: toolBar.showSettingsView()
} }
QGCToolBarButton { QGCToolBarButton {

Loading…
Cancel
Save