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
7fa87116
Commit
7fa87116
authored
May 17, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #635 from mavlink/keyboardshortcuts
make keyboard shortcuts OS dependent
parents
2b2c826b
b15acd6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
MainWindow.cc
src/ui/MainWindow.cc
+25
-1
MainWindow.ui
src/ui/MainWindow.ui
+1
-19
No files found.
src/ui/MainWindow.cc
View file @
7fa87116
...
...
@@ -187,7 +187,7 @@ void MainWindow::init()
ui
.
setupUi
(
this
);
hide
();
menuActionHelper
->
setMenu
(
ui
.
menuTools
);
// Qt 4 on Ubuntu does place the native menubar correctly so on Linux we revert back to in-window menu bar.
#ifdef Q_OS_LINUX
menuBar
()
->
setNativeMenuBar
(
false
);
...
...
@@ -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
.
actionFlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionHardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionSimulationView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+4"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+5"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMavlinkView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+M"
,
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
));
#else
ui
.
actionFlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+1"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+2"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionHardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+3"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionSimulationView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+4"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+5"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMavlinkView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+M"
,
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
));
#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 @
7fa87116
...
...
@@ -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
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