Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
8714e12a
Commit
8714e12a
authored
Jun 08, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #688 from johnflux/master
Master
parents
15f811db
2bc2762d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
49 deletions
+53
-49
MainWindow.cc
src/ui/MainWindow.cc
+37
-30
MainWindow.ui
src/ui/MainWindow.ui
+16
-19
No files found.
src/ui/MainWindow.cc
View file @
8714e12a
...
...
@@ -216,8 +216,6 @@ void MainWindow::init()
toolBar
=
new
QGCToolBar
(
this
);
this
->
addToolBar
(
toolBar
);
ui
.
actionHardwareConfig
->
setText
(
tr
(
"Config"
));
// Add actions for average users (displayed next to each other)
QList
<
QAction
*>
actions
;
actions
<<
ui
.
actionFlightView
;
...
...
@@ -228,10 +226,12 @@ void MainWindow::init()
// Add actions for advanced users (displayed in dropdown under "advanced")
QList
<
QAction
*>
advancedActions
;
advancedActions
<<
ui
.
actionSimulation
_
View
;
advancedActions
<<
ui
.
actionSimulationView
;
advancedActions
<<
ui
.
actionEngineersView
;
toolBar
->
setPerspectiveChangeAdvancedActions
(
advancedActions
);
}
else
{
ui
.
actionHardwareConfig
->
setText
(
tr
(
"Hardware"
));
}
customStatusBar
=
new
QGCStatusBar
(
this
);
...
...
@@ -266,7 +266,7 @@ void MainWindow::init()
apmToolBar
->
setFlightPlanViewAction
(
ui
.
actionMissionView
);
apmToolBar
->
setHardwareViewAction
(
ui
.
actionHardwareConfig
);
apmToolBar
->
setSoftwareViewAction
(
ui
.
actionSoftwareConfig
);
apmToolBar
->
setSimulationViewAction
(
ui
.
actionSimulation
_
View
);
apmToolBar
->
setSimulationViewAction
(
ui
.
actionSimulationView
);
apmToolBar
->
setTerminalViewAction
(
ui
.
actionTerminalView
);
QDockWidget
*
widget
=
new
QDockWidget
(
tr
(
"APM Tool Bar"
),
this
);
...
...
@@ -435,10 +435,10 @@ QString MainWindow::getWindowStateKey()
{
if
(
UASManager
::
instance
()
->
getActiveUAS
())
{
return
QString
::
number
(
currentView
)
+
"_windowstate_"
+
UASManager
::
instance
()
->
getActiveUAS
()
->
getAutopilotTypeName
();
return
QString
::
number
(
currentView
)
+
"_windowstate_"
+
QString
::
number
(
getCustomMode
())
+
"_"
+
UASManager
::
instance
()
->
getActiveUAS
()
->
getAutopilotTypeName
();
}
else
return
QString
::
number
(
currentView
)
+
"_windowstate
"
;
return
QString
::
number
(
currentView
)
+
"_windowstate
_"
+
QString
::
number
(
getCustomMode
())
;
}
QString
MainWindow
::
getWindowGeometryKey
()
...
...
@@ -543,6 +543,15 @@ void MainWindow::buildCommonWidgets()
addToCentralStackedWidget
(
pilotView
,
VIEW_FLIGHT
,
"Pilot"
);
}
if
(
!
terminalView
)
{
terminalView
=
new
SubMainWindow
(
this
);
terminalView
->
setObjectName
(
"VIEW_TERMINAL"
);
TerminalConsole
*
terminalConsole
=
new
TerminalConsole
(
this
);
terminalView
->
setCentralWidget
(
terminalConsole
);
addToCentralStackedWidget
(
terminalView
,
VIEW_TERMINAL
,
tr
(
"Terminal View"
));
}
if
(
getCustomMode
()
==
CUSTOM_MODE_APM
)
{
if
(
!
configView
)
{
...
...
@@ -559,14 +568,7 @@ void MainWindow::buildCommonWidgets()
softwareConfigView
->
setCentralWidget
(
new
ApmSoftwareConfig
(
this
));
addToCentralStackedWidget
(
softwareConfigView
,
VIEW_SOFTWARE_CONFIG
,
"Software"
);
}
if
(
!
terminalView
)
{
terminalView
=
new
SubMainWindow
(
this
);
terminalView
->
setObjectName
(
"VIEW_TERMINAL"
);
TerminalConsole
*
terminalConsole
=
new
TerminalConsole
(
this
);
terminalView
->
setCentralWidget
(
terminalConsole
);
addToCentralStackedWidget
(
terminalView
,
VIEW_TERMINAL
,
tr
(
"Terminal View"
));
}
}
else
{
if
(
!
configView
)
{
...
...
@@ -596,7 +598,7 @@ void MainWindow::buildCommonWidgets()
}
#endif
#if QGC_GOOGLE_EARTH_ENABLED
#if
def
QGC_GOOGLE_EARTH_ENABLED
if
(
!
googleEarthView
)
{
googleEarthView
=
new
SubMainWindow
(
this
);
...
...
@@ -1262,19 +1264,29 @@ void MainWindow::connectCommonActions()
perspectives
->
addAction
(
ui
.
actionEngineersView
);
perspectives
->
addAction
(
ui
.
actionMavlinkView
);
perspectives
->
addAction
(
ui
.
actionFlightView
);
perspectives
->
addAction
(
ui
.
actionSimulation
_
View
);
perspectives
->
addAction
(
ui
.
actionSimulationView
);
perspectives
->
addAction
(
ui
.
actionMissionView
);
//perspectives->addAction(ui.actionConfiguration_2);
perspectives
->
addAction
(
ui
.
actionHardwareConfig
);
if
(
getCustomMode
()
==
CUSTOM_MODE_APM
)
{
perspectives
->
addAction
(
ui
.
actionSoftwareConfig
);
}
perspectives
->
addAction
(
ui
.
actionSoftwareConfig
);
perspectives
->
addAction
(
ui
.
actionTerminalView
);
perspectives
->
addAction
(
ui
.
actionUnconnectedView
);
perspectives
->
addAction
(
ui
.
actionGoogleEarthView
);
perspectives
->
addAction
(
ui
.
actionLocal3DView
);
perspectives
->
setExclusive
(
true
);
/* Hide the actions that are not relevant */
ui
.
actionSoftwareConfig
->
setVisible
(
getCustomMode
()
==
CUSTOM_MODE_APM
);
#ifndef QGC_MAVGEN_ENABLED
ui
.
actionMavlinkView
->
setVisible
(
false
);
#endif
#ifndef QGC_GOOGLE_EARTH_ENABLED
ui
.
actionGoogleEarthView
->
setVisible
(
false
);
#endif
#ifndef QGC_OSG_ENABLED
ui
.
actionLocal3DView
->
setVisible
(
false
);
#endif
// Mark the right one as selected
if
(
currentView
==
VIEW_ENGINEER
)
{
...
...
@@ -1293,8 +1305,8 @@ void MainWindow::connectCommonActions()
}
if
(
currentView
==
VIEW_SIMULATION
)
{
ui
.
actionSimulation
_
View
->
setChecked
(
true
);
ui
.
actionSimulation
_
View
->
activate
(
QAction
::
Trigger
);
ui
.
actionSimulationView
->
setChecked
(
true
);
ui
.
actionSimulationView
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_MISSION
)
{
...
...
@@ -1358,21 +1370,16 @@ void MainWindow::connectCommonActions()
// Views actions
connect
(
ui
.
actionFlightView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadPilotView
()));
connect
(
ui
.
actionSimulation
_
View
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSimulationView
()));
connect
(
ui
.
actionSimulationView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSimulationView
()));
connect
(
ui
.
actionEngineersView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadEngineerView
()));
connect
(
ui
.
actionMissionView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadOperatorView
()));
connect
(
ui
.
actionUnconnectedView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadUnconnectedView
()));
connect
(
ui
.
actionHardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadHardwareConfigView
()));
connect
(
ui
.
actionGoogleEarthView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadGoogleEarthView
()));
connect
(
ui
.
actionLocal3DView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadLocal3DView
()));
connect
(
ui
.
actionSimulationView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSimulationView
()));
connect
(
ui
.
actionHardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadHardwareConfigView
()));
if
(
getCustomMode
()
==
CUSTOM_MODE_APM
)
{
connect
(
ui
.
actionSoftwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSoftwareConfigView
()));
connect
(
ui
.
actionTerminalView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadTerminalView
()));
}
connect
(
ui
.
actionSoftwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSoftwareConfigView
()));
connect
(
ui
.
actionTerminalView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadTerminalView
()));
connect
(
ui
.
actionMavlinkView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadMAVLinkView
()));
// Help Actions
...
...
@@ -2049,7 +2056,7 @@ void MainWindow::loadSimulationView()
{
storeViewState
();
currentView
=
VIEW_SIMULATION
;
ui
.
actionSimulation
_
View
->
setChecked
(
true
);
ui
.
actionSimulationView
->
setChecked
(
true
);
loadViewState
();
}
}
...
...
src/ui/MainWindow.ui
View file @
8714e12a
...
...
@@ -51,7 +51,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
1024
</width>
<height>
2
2
</height>
<height>
2
1
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuMGround"
>
...
...
@@ -95,13 +95,13 @@
<property
name=
"title"
>
<string>
Perspectives
</string>
</property>
<addaction
name=
"actionMissionView"
/>
<addaction
name=
"actionFlightView"
/>
<addaction
name=
"actionMissionView"
/>
<addaction
name=
"actionHardwareConfig"
/>
<addaction
name=
"actionSoftwareConfig"
/>
<addaction
name=
"actionTerminalView"
/>
<addaction
name=
"actionEngineersView"
/>
<addaction
name=
"actionSimulationView"
/>
<addaction
name=
"actionEngineersView"
/>
<addaction
name=
"actionGoogleEarthView"
/>
<addaction
name=
"actionLocal3DView"
/>
<addaction
name=
"separator"
/>
...
...
@@ -401,30 +401,21 @@
</property>
</action>
<action
name=
"actionFirmwareUpdateView"
>
<property
name=
"icon"
>
<iconset
resource=
"../../qgroundcontrol.qrc"
>
<normaloff>
:/files/images/status/software-update-available.svg
</normaloff>
:/files/images/status/software-update-available.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Firmware Update
</string>
</property>
<property
name=
"toolTip"
>
<string>
Update the firmware of one of the connected autopilots
</string>
</property>
</action>
<action
name=
"actionSimulation_View"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"visible"
>
<bool>
false
</bool>
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../qgroundcontrol.qrc"
>
<normaloff>
:/files/images/
control/launch.svg
</normaloff>
:/files/images/control/launch
.svg
</iconset>
<normaloff>
:/files/images/
status/software-update-available.svg
</normaloff>
:/files/images/status/software-update-available
.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Simulation
</string>
<string>
Firmware Update
</string>
</property>
<property
name=
"toolTip"
>
<string>
Open the simulation view
</string>
<string>
Update the firmware of one of the connected autopilots
</string>
</property>
</action>
<action
name=
"actionHardwareConfig"
>
...
...
@@ -436,7 +427,7 @@
<normaloff>
:/files/images/categories/preferences-system.svg
</normaloff>
:/files/images/categories/preferences-system.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Hardware
</string>
<string>
Config
</string>
</property>
<property
name=
"toolTip"
>
<string>
Configuration options of the vehicle.
</string>
...
...
@@ -487,11 +478,17 @@
</property>
</action>
<action
name=
"actionGoogleEarthView"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Google Earth
</string>
</property>
</action>
<action
name=
"actionLocal3DView"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Local 3D View
</string>
</property>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment