Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
dbb90dd0
Commit
dbb90dd0
authored
Nov 16, 2014
by
Don Gagne
Browse files
Reorder top level buttons, new VehicleSetup code
parent
18138fbb
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ui/MainWindow.cc
View file @
dbb90dd0
...
@@ -64,7 +64,7 @@ This file is part of the QGROUNDCONTROL project
...
@@ -64,7 +64,7 @@ This file is part of the QGROUNDCONTROL project
#include
"QGCTabbedInfoView.h"
#include
"QGCTabbedInfoView.h"
#include
"UASRawStatusView.h"
#include
"UASRawStatusView.h"
#include
"PrimaryFlightDisplay.h"
#include
"PrimaryFlightDisplay.h"
#include
<QGCConfig
View.h
>
#include
"Setup
View.h
"
#include
"SerialSettingsDialog.h"
#include
"SerialSettingsDialog.h"
#include
"terminalconsole.h"
#include
"terminalconsole.h"
#include
"menuactionhelper.h"
#include
"menuactionhelper.h"
...
@@ -207,9 +207,10 @@ void MainWindow::init()
...
@@ -207,9 +207,10 @@ void MainWindow::init()
// Add actions for average users (displayed next to each other)
// Add actions for average users (displayed next to each other)
QList
<
QAction
*>
actions
;
QList
<
QAction
*>
actions
;
actions
<<
ui
.
actionSetup
;
actions
<<
ui
.
actionMissionView
;
actions
<<
ui
.
actionMissionView
;
actions
<<
ui
.
actionFlightView
;
actions
<<
ui
.
actionFlightView
;
actions
<<
ui
.
action
HardwareConfig
;
actions
<<
ui
.
action
EngineersView
;
toolBar
->
setPerspectiveChangeActions
(
actions
);
toolBar
->
setPerspectiveChangeActions
(
actions
);
...
@@ -333,9 +334,9 @@ void MainWindow::init()
...
@@ -333,9 +334,9 @@ void MainWindow::init()
// Set OS dependent keyboard shortcuts for the main window, non OS dependent shortcuts are set in MainWindow.ui
// Set OS dependent keyboard shortcuts for the main window, non OS dependent shortcuts are set in MainWindow.ui
#ifdef Q_OS_MACX
#ifdef Q_OS_MACX
ui
.
action
MissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
ui
.
action
Setup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
ui
.
action
Flight
View
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
ui
.
action
Mission
View
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
ui
.
action
HardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
ui
.
action
FlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+4"
,
0
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+4"
,
0
));
ui
.
actionGoogleEarthView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+5"
,
0
));
ui
.
actionGoogleEarthView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+5"
,
0
));
ui
.
actionLocal3DView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+6"
,
0
));
ui
.
actionLocal3DView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+6"
,
0
));
...
@@ -344,9 +345,9 @@ void MainWindow::init()
...
@@ -344,9 +345,9 @@ void MainWindow::init()
ui
.
actionFirmwareUpdateView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+9"
,
0
));
ui
.
actionFirmwareUpdateView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+9"
,
0
));
ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+Return"
,
0
));
ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+Return"
,
0
));
#else
#else
ui
.
action
MissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+1"
,
0
));
ui
.
action
Setup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+1"
,
0
));
ui
.
action
Flight
View
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+2"
,
0
));
ui
.
action
Mission
View
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+2"
,
0
));
ui
.
action
HardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+3"
,
0
));
ui
.
action
FlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+3"
,
0
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+4"
,
0
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+4"
,
0
));
ui
.
actionGoogleEarthView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+5"
,
0
));
ui
.
actionGoogleEarthView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+5"
,
0
));
ui
.
actionLocal3DView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+6"
,
0
));
ui
.
actionLocal3DView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+6"
,
0
));
...
@@ -530,12 +531,12 @@ void MainWindow::buildCommonWidgets()
...
@@ -530,12 +531,12 @@ void MainWindow::buildCommonWidgets()
addToCentralStackedWidget
(
terminalView
,
VIEW_TERMINAL
,
tr
(
"Terminal View"
));
addToCentralStackedWidget
(
terminalView
,
VIEW_TERMINAL
,
tr
(
"Terminal View"
));
}
}
if
(
!
config
View
)
if
(
!
setup
View
)
{
{
config
View
=
new
SubMainWindow
(
this
);
setup
View
=
new
SubMainWindow
(
this
);
config
View
->
setObjectName
(
"VIEW_
HARDWARE_CONFIG
"
);
setup
View
->
setObjectName
(
"VIEW_
SETUP
"
);
config
View
->
setCentralWidget
(
new
QGCConfig
View
(
this
));
setup
View
->
setCentralWidget
(
new
Setup
View
(
this
));
addToCentralStackedWidget
(
config
View
,
VIEW_
HARDWARE_CONFIG
,
"Config
"
);
addToCentralStackedWidget
(
setup
View
,
VIEW_
SETUP
,
"Setup
"
);
}
}
if
(
!
engineeringView
)
if
(
!
engineeringView
)
...
@@ -1160,7 +1161,7 @@ void MainWindow::connectCommonActions()
...
@@ -1160,7 +1161,7 @@ void MainWindow::connectCommonActions()
perspectives
->
addAction
(
ui
.
actionFlightView
);
perspectives
->
addAction
(
ui
.
actionFlightView
);
perspectives
->
addAction
(
ui
.
actionSimulationView
);
perspectives
->
addAction
(
ui
.
actionSimulationView
);
perspectives
->
addAction
(
ui
.
actionMissionView
);
perspectives
->
addAction
(
ui
.
actionMissionView
);
perspectives
->
addAction
(
ui
.
action
HardwareConfig
);
perspectives
->
addAction
(
ui
.
action
Setup
);
perspectives
->
addAction
(
ui
.
actionTerminalView
);
perspectives
->
addAction
(
ui
.
actionTerminalView
);
perspectives
->
addAction
(
ui
.
actionGoogleEarthView
);
perspectives
->
addAction
(
ui
.
actionGoogleEarthView
);
perspectives
->
addAction
(
ui
.
actionLocal3DView
);
perspectives
->
addAction
(
ui
.
actionLocal3DView
);
...
@@ -1195,10 +1196,10 @@ void MainWindow::connectCommonActions()
...
@@ -1195,10 +1196,10 @@ void MainWindow::connectCommonActions()
ui
.
actionMissionView
->
setChecked
(
true
);
ui
.
actionMissionView
->
setChecked
(
true
);
ui
.
actionMissionView
->
activate
(
QAction
::
Trigger
);
ui
.
actionMissionView
->
activate
(
QAction
::
Trigger
);
}
}
if
(
currentView
==
VIEW_
HARDWARE_CONFIG
)
if
(
currentView
==
VIEW_
SETUP
)
{
{
ui
.
action
HardwareConfig
->
setChecked
(
true
);
ui
.
action
Setup
->
setChecked
(
true
);
ui
.
action
HardwareConfig
->
activate
(
QAction
::
Trigger
);
ui
.
action
Setup
->
activate
(
QAction
::
Trigger
);
}
}
if
(
currentView
==
VIEW_SOFTWARE_CONFIG
)
if
(
currentView
==
VIEW_SOFTWARE_CONFIG
)
{
{
...
@@ -1250,10 +1251,9 @@ void MainWindow::connectCommonActions()
...
@@ -1250,10 +1251,9 @@ void MainWindow::connectCommonActions()
connect
(
ui
.
actionSimulationView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSimulationView
()));
connect
(
ui
.
actionSimulationView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSimulationView
()));
connect
(
ui
.
actionEngineersView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadEngineerView
()));
connect
(
ui
.
actionEngineersView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadEngineerView
()));
connect
(
ui
.
actionMissionView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadOperatorView
()));
connect
(
ui
.
actionMissionView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadOperatorView
()));
connect
(
ui
.
action
HardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
load
HardwareConfig
View
()));
connect
(
ui
.
action
Setup
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
load
Setup
View
()));
connect
(
ui
.
actionGoogleEarthView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadGoogleEarthView
()));
connect
(
ui
.
actionGoogleEarthView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadGoogleEarthView
()));
connect
(
ui
.
actionLocal3DView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadLocal3DView
()));
connect
(
ui
.
actionLocal3DView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadLocal3DView
()));
connect
(
ui
.
actionHardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadHardwareConfigView
()));
connect
(
ui
.
actionSoftwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSoftwareConfigView
()));
connect
(
ui
.
actionSoftwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSoftwareConfigView
()));
connect
(
ui
.
actionTerminalView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadTerminalView
()));
connect
(
ui
.
actionTerminalView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadTerminalView
()));
...
@@ -1624,8 +1624,8 @@ void MainWindow::loadViewState()
...
@@ -1624,8 +1624,8 @@ void MainWindow::loadViewState()
// Load defaults
// Load defaults
switch
(
currentView
)
switch
(
currentView
)
{
{
case
VIEW_
HARDWARE_CONFIG
:
case
VIEW_
SETUP
:
centerStack
->
setCurrentWidget
(
config
View
);
centerStack
->
setCurrentWidget
(
setup
View
);
break
;
break
;
case
VIEW_SOFTWARE_CONFIG
:
case
VIEW_SOFTWARE_CONFIG
:
if
(
softwareConfigView
)
if
(
softwareConfigView
)
...
@@ -1722,7 +1722,7 @@ void MainWindow::handleMisconfiguration(UASInterface* uas)
...
@@ -1722,7 +1722,7 @@ void MainWindow::handleMisconfiguration(UASInterface* uas)
UASManager
::
instance
()
->
setActiveUAS
(
uas
);
UASManager
::
instance
()
->
setActiveUAS
(
uas
);
// Flick to config view
// Flick to config view
load
HardwareConfig
View
();
load
Setup
View
();
}
}
}
}
...
@@ -1747,13 +1747,13 @@ void MainWindow::loadOperatorView()
...
@@ -1747,13 +1747,13 @@ void MainWindow::loadOperatorView()
loadViewState
();
loadViewState
();
}
}
}
}
void
MainWindow
::
load
HardwareConfig
View
()
void
MainWindow
::
load
Setup
View
()
{
{
if
(
currentView
!=
VIEW_
HARDWARE_CONFIG
)
if
(
currentView
!=
VIEW_
SETUP
)
{
{
storeViewState
();
storeViewState
();
currentView
=
VIEW_
HARDWARE_CONFIG
;
currentView
=
VIEW_
SETUP
;
ui
.
action
HardwareConfig
->
setChecked
(
true
);
ui
.
action
Setup
->
setChecked
(
true
);
loadViewState
();
loadViewState
();
}
}
}
}
...
...
src/ui/MainWindow.h
View file @
dbb90dd0
...
@@ -218,7 +218,7 @@ public slots:
...
@@ -218,7 +218,7 @@ public slots:
void
setAdvancedMode
(
bool
isAdvancedMode
);
void
setAdvancedMode
(
bool
isAdvancedMode
);
void
handleMisconfiguration
(
UASInterface
*
uas
);
void
handleMisconfiguration
(
UASInterface
*
uas
);
/** @brief Load configuration views */
/** @brief Load configuration views */
void
load
HardwareConfig
View
();
void
load
Setup
View
();
void
loadSoftwareConfigView
();
void
loadSoftwareConfigView
();
/** @brief Load view for pilot */
/** @brief Load view for pilot */
void
loadPilotView
();
void
loadPilotView
();
...
@@ -332,7 +332,7 @@ protected:
...
@@ -332,7 +332,7 @@ protected:
VIEW_FLIGHT
,
VIEW_FLIGHT
,
VIEW_SIMULATION
,
VIEW_SIMULATION
,
VIEW_FIRMWAREUPDATE
,
VIEW_FIRMWAREUPDATE
,
VIEW_
HARDWARE_CONFIG
,
VIEW_
SETUP
,
VIEW_SOFTWARE_CONFIG
,
VIEW_SOFTWARE_CONFIG
,
VIEW_TERMINAL
,
VIEW_TERMINAL
,
VIEW_LOCAL3D
,
VIEW_LOCAL3D
,
...
@@ -400,7 +400,7 @@ protected:
...
@@ -400,7 +400,7 @@ protected:
// Center widgets
// Center widgets
QPointer
<
SubMainWindow
>
plannerView
;
QPointer
<
SubMainWindow
>
plannerView
;
QPointer
<
SubMainWindow
>
pilotView
;
QPointer
<
SubMainWindow
>
pilotView
;
QPointer
<
SubMainWindow
>
config
View
;
QPointer
<
SubMainWindow
>
setup
View
;
QPointer
<
SubMainWindow
>
softwareConfigView
;
QPointer
<
SubMainWindow
>
softwareConfigView
;
QPointer
<
SubMainWindow
>
engineeringView
;
QPointer
<
SubMainWindow
>
engineeringView
;
QPointer
<
SubMainWindow
>
simView
;
QPointer
<
SubMainWindow
>
simView
;
...
...
src/ui/MainWindow.ui
View file @
dbb90dd0
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
</property>
</property>
<addaction
name=
"actionMissionView"
/>
<addaction
name=
"actionMissionView"
/>
<addaction
name=
"actionFlightView"
/>
<addaction
name=
"actionFlightView"
/>
<addaction
name=
"action
HardwareConfig
"
/>
<addaction
name=
"action
Setup
"
/>
<addaction
name=
"actionEngineersView"
/>
<addaction
name=
"actionEngineersView"
/>
<addaction
name=
"actionGoogleEarthView"
/>
<addaction
name=
"actionGoogleEarthView"
/>
<addaction
name=
"actionLocal3DView"
/>
<addaction
name=
"actionLocal3DView"
/>
...
@@ -277,7 +277,7 @@
...
@@ -277,7 +277,7 @@
<normaloff>
:/files/images/categories/applications-internet.svg
</normaloff>
:/files/images/categories/applications-internet.svg
</iconset>
<normaloff>
:/files/images/categories/applications-internet.svg
</normaloff>
:/files/images/categories/applications-internet.svg
</iconset>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Missio
n
</string>
<string>
2. Pla
n
</string>
</property>
</property>
</action>
</action>
<action
name=
"actionEngineersView"
>
<action
name=
"actionEngineersView"
>
...
@@ -289,7 +289,7 @@
...
@@ -289,7 +289,7 @@
<normaloff>
:/files/images/apps/utilities-system-monitor.svg
</normaloff>
:/files/images/apps/utilities-system-monitor.svg
</iconset>
<normaloff>
:/files/images/apps/utilities-system-monitor.svg
</normaloff>
:/files/images/apps/utilities-system-monitor.svg
</iconset>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Plot
</string>
<string>
4. Analyze
</string>
</property>
</property>
</action>
</action>
<action
name=
"actionMavlinkView"
>
<action
name=
"actionMavlinkView"
>
...
@@ -313,7 +313,7 @@
...
@@ -313,7 +313,7 @@
<normaloff>
:/files/images/status/network-wireless-encrypted.svg
</normaloff>
:/files/images/status/network-wireless-encrypted.svg
</iconset>
<normaloff>
:/files/images/status/network-wireless-encrypted.svg
</normaloff>
:/files/images/status/network-wireless-encrypted.svg
</iconset>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Instruments
</string>
<string>
3. Fly
</string>
</property>
</property>
</action>
</action>
<action
name=
"actionNewCustomWidget"
>
<action
name=
"actionNewCustomWidget"
>
...
@@ -428,7 +428,7 @@
...
@@ -428,7 +428,7 @@
<bool>
false
</bool>
<bool>
false
</bool>
</property>
</property>
</action>
</action>
<action
name=
"action
HardwareConfig
"
>
<action
name=
"action
Setup
"
>
<property
name=
"checkable"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
<bool>
true
</bool>
</property>
</property>
...
@@ -437,10 +437,10 @@
...
@@ -437,10 +437,10 @@
<normaloff>
:/files/images/categories/preferences-system.svg
</normaloff>
:/files/images/categories/preferences-system.svg
</iconset>
<normaloff>
:/files/images/categories/preferences-system.svg
</normaloff>
:/files/images/categories/preferences-system.svg
</iconset>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Vehicle
Setup
</string>
<string>
1.
Setup
</string>
</property>
</property>
<property
name=
"toolTip"
>
<property
name=
"toolTip"
>
<string>
Hardware s
etup of the vehicle
</string>
<string>
S
etup of the vehicle
</string>
</property>
</property>
</action>
</action>
<action
name=
"actionAdvanced_Mode"
>
<action
name=
"actionAdvanced_Mode"
>
...
...
src/ui/QGCToolBar.cc
View file @
dbb90dd0
...
@@ -279,7 +279,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
...
@@ -279,7 +279,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
// Add the first button.
// Add the first button.
QToolButton
*
first
=
new
QToolButton
(
this
);
QToolButton
*
first
=
new
QToolButton
(
this
);
first
->
setIcon
(
actions
.
first
()
->
icon
());
//
first->setIcon(actions.first()->icon());
first
->
setText
(
actions
.
first
()
->
text
());
first
->
setText
(
actions
.
first
()
->
text
());
first
->
setToolTip
(
actions
.
first
()
->
toolTip
());
first
->
setToolTip
(
actions
.
first
()
->
toolTip
());
first
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
first
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
...
@@ -298,7 +298,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
...
@@ -298,7 +298,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
for
(
int
i
=
1
;
i
<
actions
.
count
();
i
++
)
for
(
int
i
=
1
;
i
<
actions
.
count
();
i
++
)
{
{
QToolButton
*
btn
=
new
QToolButton
(
this
);
QToolButton
*
btn
=
new
QToolButton
(
this
);
btn
->
setIcon
(
actions
.
at
(
i
)
->
icon
());
//
btn->setIcon(actions.at(i)->icon());
btn
->
setText
(
actions
.
at
(
i
)
->
text
());
btn
->
setText
(
actions
.
at
(
i
)
->
text
());
btn
->
setToolTip
(
actions
.
at
(
i
)
->
toolTip
());
btn
->
setToolTip
(
actions
.
at
(
i
)
->
toolTip
());
btn
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
btn
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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