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
bbc2cd31
Commit
bbc2cd31
authored
May 04, 2014
by
Thomas Gubler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make keyboard shortcuts OS dependent
parent
4afb95a6
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 @
bbc2cd31
...
@@ -187,7 +187,7 @@ void MainWindow::init()
...
@@ -187,7 +187,7 @@ void MainWindow::init()
ui
.
setupUi
(
this
);
ui
.
setupUi
(
this
);
hide
();
hide
();
menuActionHelper
->
setMenu
(
ui
.
menuTools
);
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.
// 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
#ifdef Q_OS_LINUX
menuBar
()
->
setNativeMenuBar
(
false
);
menuBar
()
->
setNativeMenuBar
(
false
);
...
@@ -223,6 +223,7 @@ void MainWindow::init()
...
@@ -223,6 +223,7 @@ void MainWindow::init()
actions
<<
ui
.
actionFlightView
;
actions
<<
ui
.
actionFlightView
;
actions
<<
ui
.
actionMissionView
;
actions
<<
ui
.
actionMissionView
;
actions
<<
ui
.
actionHardwareConfig
;
actions
<<
ui
.
actionHardwareConfig
;
toolBar
->
setPerspectiveChangeActions
(
actions
);
toolBar
->
setPerspectiveChangeActions
(
actions
);
// Add actions for advanced users (displayed in dropdown under "advanced")
// Add actions for advanced users (displayed in dropdown under "advanced")
...
@@ -346,6 +347,27 @@ void MainWindow::init()
...
@@ -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
()));
connect
(
&
windowNameUpdateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
configureWindowName
()));
windowNameUpdateTimer
.
start
(
15000
);
windowNameUpdateTimer
.
start
(
15000
);
emit
initStatusChanged
(
tr
(
"Done"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
emit
initStatusChanged
(
tr
(
"Done"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
...
@@ -1342,6 +1364,8 @@ void MainWindow::connectCommonActions()
...
@@ -1342,6 +1364,8 @@ void MainWindow::connectCommonActions()
connect
(
ui
.
actionHardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadHardwareConfigView
()));
connect
(
ui
.
actionHardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadHardwareConfigView
()));
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
.
actionSimulationView
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSimulationView
()));
connect
(
ui
.
actionHardwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadHardwareConfigView
()));
if
(
getCustomMode
()
==
CUSTOM_MODE_APM
)
{
if
(
getCustomMode
()
==
CUSTOM_MODE_APM
)
{
connect
(
ui
.
actionSoftwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSoftwareConfigView
()));
connect
(
ui
.
actionSoftwareConfig
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadSoftwareConfigView
()));
...
...
src/ui/MainWindow.ui
View file @
bbc2cd31
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
<string>
Emergency Land
</string>
<string>
Emergency Land
</string>
</property>
</property>
<property
name=
"shortcut"
>
<property
name=
"shortcut"
>
<string>
Ctrl+
E
</string>
<string>
Ctrl+
L
</string>
</property>
</property>
</action>
</action>
<action
name=
"actionEmergency_Kill"
>
<action
name=
"actionEmergency_Kill"
>
...
@@ -284,9 +284,6 @@
...
@@ -284,9 +284,6 @@
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Mission
</string>
<string>
Mission
</string>
</property>
</property>
<property
name=
"shortcut"
>
<string>
Meta+O
</string>
</property>
</action>
</action>
<action
name=
"actionEngineersView"
>
<action
name=
"actionEngineersView"
>
<property
name=
"checkable"
>
<property
name=
"checkable"
>
...
@@ -299,9 +296,6 @@
...
@@ -299,9 +296,6 @@
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Plot
</string>
<string>
Plot
</string>
</property>
</property>
<property
name=
"shortcut"
>
<string>
Meta+E
</string>
</property>
</action>
</action>
<action
name=
"actionMavlinkView"
>
<action
name=
"actionMavlinkView"
>
<property
name=
"checkable"
>
<property
name=
"checkable"
>
...
@@ -314,9 +308,6 @@
...
@@ -314,9 +308,6 @@
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Mavlink
</string>
<string>
Mavlink
</string>
</property>
</property>
<property
name=
"shortcut"
>
<string>
Meta+M
</string>
</property>
</action>
</action>
<action
name=
"actionFlightView"
>
<action
name=
"actionFlightView"
>
<property
name=
"checkable"
>
<property
name=
"checkable"
>
...
@@ -329,9 +320,6 @@
...
@@ -329,9 +320,6 @@
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Flight
</string>
<string>
Flight
</string>
</property>
</property>
<property
name=
"shortcut"
>
<string>
Meta+P
</string>
</property>
</action>
</action>
<action
name=
"actionNewCustomWidget"
>
<action
name=
"actionNewCustomWidget"
>
<property
name=
"icon"
>
<property
name=
"icon"
>
...
@@ -369,9 +357,6 @@
...
@@ -369,9 +357,6 @@
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Unconnected
</string>
<string>
Unconnected
</string>
</property>
</property>
<property
name=
"shortcut"
>
<string>
Meta+U
</string>
</property>
</action>
</action>
<action
name=
"actionShutdownMAV"
>
<action
name=
"actionShutdownMAV"
>
<property
name=
"icon"
>
<property
name=
"icon"
>
...
@@ -397,9 +382,6 @@
...
@@ -397,9 +382,6 @@
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Fullscreen
</string>
<string>
Fullscreen
</string>
</property>
</property>
<property
name=
"shortcut"
>
<string>
Meta+Return
</string>
</property>
</action>
</action>
<action
name=
"actionNormal"
>
<action
name=
"actionNormal"
>
<property
name=
"text"
>
<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