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
#include
"QGCTabbedInfoView.h"
#include
"UASRawStatusView.h"
#include
"PrimaryFlightDisplay.h"
#include
<QGCConfig
View.h
>
#include
"Setup
View.h
"
#include
"SerialSettingsDialog.h"
#include
"terminalconsole.h"
#include
"menuactionhelper.h"
...
...
@@ -207,9 +207,10 @@ void MainWindow::init()
// Add actions for average users (displayed next to each other)
QList
<
QAction
*>
actions
;
actions
<<
ui
.
actionSetup
;
actions
<<
ui
.
actionMissionView
;
actions
<<
ui
.
actionFlightView
;
actions
<<
ui
.
action
HardwareConfig
;
actions
<<
ui
.
action
EngineersView
;
toolBar
->
setPerspectiveChangeActions
(
actions
);
...
...
@@ -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
#ifdef Q_OS_MACX
ui
.
action
MissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
ui
.
action
Flight
View
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
ui
.
action
HardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
ui
.
action
Setup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
ui
.
action
Mission
View
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
ui
.
action
FlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+4"
,
0
));
ui
.
actionGoogleEarthView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+5"
,
0
));
ui
.
actionLocal3DView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+6"
,
0
));
...
...
@@ -344,9 +345,9 @@ void MainWindow::init()
ui
.
actionFirmwareUpdateView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+9"
,
0
));
ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+Return"
,
0
));
#else
ui
.
action
MissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+1"
,
0
));
ui
.
action
Flight
View
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+2"
,
0
));
ui
.
action
HardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+3"
,
0
));
ui
.
action
Setup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+1"
,
0
));
ui
.
action
Mission
View
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+2"
,
0
));
ui
.
action
FlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+3"
,
0
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+4"
,
0
));
ui
.
actionGoogleEarthView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+5"
,
0
));
ui
.
actionLocal3DView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+6"
,
0
));
...
...
@@ -530,12 +531,12 @@ void MainWindow::buildCommonWidgets()
addToCentralStackedWidget
(
terminalView
,
VIEW_TERMINAL
,
tr
(
"Terminal View"
));
}
if
(
!
config
View
)
if
(
!
setup
View
)
{
config
View
=
new
SubMainWindow
(
this
);
config
View
->
setObjectName
(
"VIEW_
HARDWARE_CONFIG
"
);
config
View
->
setCentralWidget
(
new
QGCConfig
View
(
this
));
addToCentralStackedWidget
(
config
View
,
VIEW_
HARDWARE_CONFIG
,
"Config
"
);
setup
View
=
new
SubMainWindow
(
this
);
setup
View
->
setObjectName
(
"VIEW_
SETUP
"
);
setup
View
->
setCentralWidget
(
new
Setup
View
(
this
));
addToCentralStackedWidget
(
setup
View
,
VIEW_
SETUP
,
"Setup
"
);
}
if
(
!
engineeringView
)
...
...
@@ -1160,7 +1161,7 @@ void MainWindow::connectCommonActions()
perspectives
->
addAction
(
ui
.
actionFlightView
);
perspectives
->
addAction
(
ui
.
actionSimulationView
);
perspectives
->
addAction
(
ui
.
actionMissionView
);
perspectives
->
addAction
(
ui
.
action
HardwareConfig
);
perspectives
->
addAction
(
ui
.
action
Setup
);
perspectives
->
addAction
(
ui
.
actionTerminalView
);
perspectives
->
addAction
(
ui
.
actionGoogleEarthView
);
perspectives
->
addAction
(
ui
.
actionLocal3DView
);
...
...
@@ -1195,10 +1196,10 @@ void MainWindow::connectCommonActions()
ui
.
actionMissionView
->
setChecked
(
true
);
ui
.
actionMissionView
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_
HARDWARE_CONFIG
)
if
(
currentView
==
VIEW_
SETUP
)
{
ui
.
action
HardwareConfig
->
setChecked
(
true
);
ui
.
action
HardwareConfig
->
activate
(
QAction
::
Trigger
);
ui
.
action
Setup
->
setChecked
(
true
);
ui
.
action
Setup
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_SOFTWARE_CONFIG
)
{
...
...
@@ -1250,10 +1251,9 @@ void MainWindow::connectCommonActions()
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
.
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
.
actionLocal3DView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadLocal3DView
()));
connect
(
ui
.
actionHardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadHardwareConfigView
()));
connect
(
ui
.
actionSoftwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSoftwareConfigView
()));
connect
(
ui
.
actionTerminalView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadTerminalView
()));
...
...
@@ -1624,8 +1624,8 @@ void MainWindow::loadViewState()
// Load defaults
switch
(
currentView
)
{
case
VIEW_
HARDWARE_CONFIG
:
centerStack
->
setCurrentWidget
(
config
View
);
case
VIEW_
SETUP
:
centerStack
->
setCurrentWidget
(
setup
View
);
break
;
case
VIEW_SOFTWARE_CONFIG
:
if
(
softwareConfigView
)
...
...
@@ -1722,7 +1722,7 @@ void MainWindow::handleMisconfiguration(UASInterface* uas)
UASManager
::
instance
()
->
setActiveUAS
(
uas
);
// Flick to config view
load
HardwareConfig
View
();
load
Setup
View
();
}
}
...
...
@@ -1747,13 +1747,13 @@ void MainWindow::loadOperatorView()
loadViewState
();
}
}
void
MainWindow
::
load
HardwareConfig
View
()
void
MainWindow
::
load
Setup
View
()
{
if
(
currentView
!=
VIEW_
HARDWARE_CONFIG
)
if
(
currentView
!=
VIEW_
SETUP
)
{
storeViewState
();
currentView
=
VIEW_
HARDWARE_CONFIG
;
ui
.
action
HardwareConfig
->
setChecked
(
true
);
currentView
=
VIEW_
SETUP
;
ui
.
action
Setup
->
setChecked
(
true
);
loadViewState
();
}
}
...
...
src/ui/MainWindow.h
View file @
dbb90dd0
...
...
@@ -218,7 +218,7 @@ public slots:
void
setAdvancedMode
(
bool
isAdvancedMode
);
void
handleMisconfiguration
(
UASInterface
*
uas
);
/** @brief Load configuration views */
void
load
HardwareConfig
View
();
void
load
Setup
View
();
void
loadSoftwareConfigView
();
/** @brief Load view for pilot */
void
loadPilotView
();
...
...
@@ -332,7 +332,7 @@ protected:
VIEW_FLIGHT
,
VIEW_SIMULATION
,
VIEW_FIRMWAREUPDATE
,
VIEW_
HARDWARE_CONFIG
,
VIEW_
SETUP
,
VIEW_SOFTWARE_CONFIG
,
VIEW_TERMINAL
,
VIEW_LOCAL3D
,
...
...
@@ -400,7 +400,7 @@ protected:
// Center widgets
QPointer
<
SubMainWindow
>
plannerView
;
QPointer
<
SubMainWindow
>
pilotView
;
QPointer
<
SubMainWindow
>
config
View
;
QPointer
<
SubMainWindow
>
setup
View
;
QPointer
<
SubMainWindow
>
softwareConfigView
;
QPointer
<
SubMainWindow
>
engineeringView
;
QPointer
<
SubMainWindow
>
simView
;
...
...
src/ui/MainWindow.ui
View file @
dbb90dd0
...
...
@@ -96,7 +96,7 @@
</property>
<addaction
name=
"actionMissionView"
/>
<addaction
name=
"actionFlightView"
/>
<addaction
name=
"action
HardwareConfig
"
/>
<addaction
name=
"action
Setup
"
/>
<addaction
name=
"actionEngineersView"
/>
<addaction
name=
"actionGoogleEarthView"
/>
<addaction
name=
"actionLocal3DView"
/>
...
...
@@ -277,7 +277,7 @@
<normaloff>
:/files/images/categories/applications-internet.svg
</normaloff>
:/files/images/categories/applications-internet.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Missio
n
</string>
<string>
2. Pla
n
</string>
</property>
</action>
<action
name=
"actionEngineersView"
>
...
...
@@ -289,7 +289,7 @@
<normaloff>
:/files/images/apps/utilities-system-monitor.svg
</normaloff>
:/files/images/apps/utilities-system-monitor.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Plot
</string>
<string>
4. Analyze
</string>
</property>
</action>
<action
name=
"actionMavlinkView"
>
...
...
@@ -313,7 +313,7 @@
<normaloff>
:/files/images/status/network-wireless-encrypted.svg
</normaloff>
:/files/images/status/network-wireless-encrypted.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Instruments
</string>
<string>
3. Fly
</string>
</property>
</action>
<action
name=
"actionNewCustomWidget"
>
...
...
@@ -428,7 +428,7 @@
<bool>
false
</bool>
</property>
</action>
<action
name=
"action
HardwareConfig
"
>
<action
name=
"action
Setup
"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
...
...
@@ -437,10 +437,10 @@
<normaloff>
:/files/images/categories/preferences-system.svg
</normaloff>
:/files/images/categories/preferences-system.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Vehicle
Setup
</string>
<string>
1.
Setup
</string>
</property>
<property
name=
"toolTip"
>
<string>
Hardware s
etup of the vehicle
</string>
<string>
S
etup of the vehicle
</string>
</property>
</action>
<action
name=
"actionAdvanced_Mode"
>
...
...
src/ui/QGCToolBar.cc
View file @
dbb90dd0
...
...
@@ -279,7 +279,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
// Add the first button.
QToolButton
*
first
=
new
QToolButton
(
this
);
first
->
setIcon
(
actions
.
first
()
->
icon
());
//
first->setIcon(actions.first()->icon());
first
->
setText
(
actions
.
first
()
->
text
());
first
->
setToolTip
(
actions
.
first
()
->
toolTip
());
first
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
...
...
@@ -298,7 +298,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
for
(
int
i
=
1
;
i
<
actions
.
count
();
i
++
)
{
QToolButton
*
btn
=
new
QToolButton
(
this
);
btn
->
setIcon
(
actions
.
at
(
i
)
->
icon
());
//
btn->setIcon(actions.at(i)->icon());
btn
->
setText
(
actions
.
at
(
i
)
->
text
());
btn
->
setToolTip
(
actions
.
at
(
i
)
->
toolTip
());
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