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
bbc2cd31
Commit
bbc2cd31
authored
May 04, 2014
by
Thomas Gubler
Browse files
make keyboard shortcuts OS dependent
parent
4afb95a6
Changes
2
Show whitespace changes
Inline
Side-by-side
src/ui/MainWindow.cc
View file @
bbc2cd31
...
...
@@ -223,6 +223,7 @@ void MainWindow::init()
actions
<<
ui
.
actionFlightView
;
actions
<<
ui
.
actionMissionView
;
actions
<<
ui
.
actionHardwareConfig
;
toolBar
->
setPerspectiveChangeActions
(
actions
);
// Add actions for advanced users (displayed in dropdown under "advanced")
...
...
@@ -346,6 +347,27 @@ 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
.
actionMissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+O"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMavlinkView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+M"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionFlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+P"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionUnconnectedView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+U"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+Return"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+E"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionSimulationView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+I"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionHardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+H"
,
0
,
QApplication
::
UnicodeUTF8
));
#else
ui
.
actionMissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+O"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMavlinkView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+M"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionFlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+P"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionUnconnectedView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+U"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+Return"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+E"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionSimulationView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+I"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionHardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+H"
,
0
,
QApplication
::
UnicodeUTF8
));
#endif
connect
(
&
windowNameUpdateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
configureWindowName
()));
windowNameUpdateTimer
.
start
(
15000
);
emit
initStatusChanged
(
tr
(
"Done"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
...
...
@@ -1342,6 +1364,8 @@ void MainWindow::connectCommonActions()
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
()));
...
...
src/ui/MainWindow.ui
View file @
bbc2cd31
...
...
@@ -162,7 +162,7 @@
<string>
Emergency Land
</string>
</property>
<property
name=
"shortcut"
>
<string>
Ctrl+
E
</string>
<string>
Ctrl+
L
</string>
</property>
</action>
<action
name=
"actionEmergency_Kill"
>
...
...
@@ -284,9 +284,6 @@
<property
name=
"text"
>
<string>
Mission
</string>
</property>
<property
name=
"shortcut"
>
<string>
Meta+O
</string>
</property>
</action>
<action
name=
"actionEngineersView"
>
<property
name=
"checkable"
>
...
...
@@ -299,9 +296,6 @@
<property
name=
"text"
>
<string>
Plot
</string>
</property>
<property
name=
"shortcut"
>
<string>
Meta+E
</string>
</property>
</action>
<action
name=
"actionMavlinkView"
>
<property
name=
"checkable"
>
...
...
@@ -314,9 +308,6 @@
<property
name=
"text"
>
<string>
Mavlink
</string>
</property>
<property
name=
"shortcut"
>
<string>
Meta+M
</string>
</property>
</action>
<action
name=
"actionFlightView"
>
<property
name=
"checkable"
>
...
...
@@ -329,9 +320,6 @@
<property
name=
"text"
>
<string>
Flight
</string>
</property>
<property
name=
"shortcut"
>
<string>
Meta+P
</string>
</property>
</action>
<action
name=
"actionNewCustomWidget"
>
<property
name=
"icon"
>
...
...
@@ -369,9 +357,6 @@
<property
name=
"text"
>
<string>
Unconnected
</string>
</property>
<property
name=
"shortcut"
>
<string>
Meta+U
</string>
</property>
</action>
<action
name=
"actionShutdownMAV"
>
<property
name=
"icon"
>
...
...
@@ -397,9 +382,6 @@
<property
name=
"text"
>
<string>
Fullscreen
</string>
</property>
<property
name=
"shortcut"
>
<string>
Meta+Return
</string>
</property>
</action>
<action
name=
"actionNormal"
>
<property
name=
"text"
>
...
...
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