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
2ab0357e
Commit
2ab0357e
authored
Oct 29, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2156 from tcanabrava/fixButtonActivation
Fix state of buttons (menu, toolbar)
parents
68451354
848938f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
MainWindow.cc
src/ui/MainWindow.cc
+12
-0
MainWindow.h
src/ui/MainWindow.h
+9
-0
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+7
-0
No files found.
src/ui/MainWindow.cc
View file @
2ab0357e
...
...
@@ -557,11 +557,23 @@ void MainWindow::connectCommonActions()
connect
(
_ui
.
actionFlight
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
showFlyView
);
connect
(
_ui
.
actionPlan
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
showPlanView
);
connect
(
_ui
.
actionSetup
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
showSetupView
);
connect
(
_ui
.
actionFlight
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
handleActiveViewActionState
);
connect
(
_ui
.
actionPlan
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
handleActiveViewActionState
);
connect
(
_ui
.
actionSetup
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
handleActiveViewActionState
);
// Connect internal actions
connect
(
qgcApp
()
->
toolbox
()
->
multiVehicleManager
(),
&
MultiVehicleManager
::
vehicleAdded
,
this
,
&
MainWindow
::
_vehicleAdded
);
}
void
MainWindow
::
handleActiveViewActionState
(
bool
triggered
)
{
Q_UNUSED
(
triggered
);
QAction
*
triggeredAction
=
qobject_cast
<
QAction
*>
(
sender
());
_ui
.
actionFlight
->
setChecked
(
triggeredAction
==
_ui
.
actionFlight
);
_ui
.
actionPlan
->
setChecked
(
triggeredAction
==
_ui
.
actionPlan
);
_ui
.
actionSetup
->
setChecked
(
triggeredAction
==
_ui
.
actionSetup
);
}
void
MainWindow
::
_openUrl
(
const
QString
&
url
,
const
QString
&
errorMessage
)
{
if
(
!
QDesktopServices
::
openUrl
(
QUrl
(
url
)))
{
...
...
src/ui/MainWindow.h
View file @
2ab0357e
...
...
@@ -134,6 +134,15 @@ protected slots:
*/
void
showStatusBarCallback
(
bool
checked
);
/**
* @brief Disable the other QActions that trigger view mode changes
*
* When a user hits Ctrl+1, Ctrl+2, Ctrl+3 - only one view is set to active
* (and in the QML file for the MainWindow the others are set to have
* visibility = false), but on the Menu all of them would be selected making
* this incoherent.
*/
void
handleActiveViewActionState
(
bool
triggered
);
signals:
// Signals the Qml to show the specified view
void
showFlyView
(
void
);
...
...
src/ui/toolbar/MainToolBar.qml
View file @
2ab0357e
...
...
@@ -445,6 +445,13 @@ Rectangle {
flyButton
.
repaintChevron
=
true
;
}
}
Connections
{
target
:
controller
onShowFlyView
:
{
flyButton
.
checked
=
true
}
onShowPlanView
:
{
planButton
.
checked
=
true
}
onShowSetupView
:{
setupButton
.
checked
=
true
}
}
ExclusiveGroup
{
id
:
mainActionGroup
}
...
...
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