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
d091759f
Commit
d091759f
authored
Jan 02, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing crash bug.
parent
8ccf64f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
34 deletions
+37
-34
MainWindow.cc
src/ui/MainWindow.cc
+36
-33
MainWindow.h
src/ui/MainWindow.h
+1
-1
No files found.
src/ui/MainWindow.cc
View file @
d091759f
...
...
@@ -329,53 +329,56 @@ void MainWindow::_showDockWidget(const QString& name, bool show)
{
// Create the inner widget if we need to
if
(
!
_mapName2DockWidget
.
contains
(
name
))
{
_createInnerDockWidget
(
name
);
if
(
!
_createInnerDockWidget
(
name
))
{
qWarning
()
<<
"Trying to load non existing widget:"
<<
name
;
return
;
}
}
Q_ASSERT
(
_mapName2DockWidget
.
contains
(
name
));
QGCDockWidget
*
dockWidget
=
_mapName2DockWidget
[
name
];
Q_ASSERT
(
dockWidget
);
dockWidget
->
setVisible
(
show
);
Q_ASSERT
(
_mapName2Action
.
contains
(
name
));
_mapName2Action
[
name
]
->
setChecked
(
show
);
}
/// Creates the specified inner dock widget and adds to the QDockWidget
void
MainWindow
::
_createInnerDockWidget
(
const
QString
&
widgetName
)
bool
MainWindow
::
_createInnerDockWidget
(
const
QString
&
widgetName
)
{
QGCDockWidget
*
widget
=
NULL
;
QAction
*
action
=
_mapName2Action
[
widgetName
];
switch
(
action
->
data
().
toInt
())
{
case
MAVLINK_INSPECTOR
:
widget
=
new
QGCMAVLinkInspector
(
widgetName
,
action
,
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
(),
this
);
break
;
case
CUSTOM_COMMAND
:
widget
=
new
CustomCommandWidget
(
widgetName
,
action
,
this
);
break
;
case
ONBOARD_FILES
:
widget
=
new
QGCUASFileViewMulti
(
widgetName
,
action
,
this
);
break
;
case
STATUS_DETAILS
:
widget
=
new
UASInfoWidget
(
widgetName
,
action
,
this
);
break
;
case
HIL_CONFIG
:
widget
=
new
HILDockWidget
(
widgetName
,
action
,
this
);
break
;
case
ANALYZE
:
widget
=
new
Linecharts
(
widgetName
,
action
,
mavlinkDecoder
,
this
);
break
;
case
INFO_VIEW
:
widget
=
new
QGCTabbedInfoView
(
widgetName
,
action
,
this
);
break
;
}
if
(
action
->
data
().
toInt
()
==
INFO_VIEW
)
{
qobject_cast
<
QGCTabbedInfoView
*>
(
widget
)
->
addSource
(
mavlinkDecoder
);
if
(
action
)
{
switch
(
action
->
data
().
toInt
())
{
case
MAVLINK_INSPECTOR
:
widget
=
new
QGCMAVLinkInspector
(
widgetName
,
action
,
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
(),
this
);
break
;
case
CUSTOM_COMMAND
:
widget
=
new
CustomCommandWidget
(
widgetName
,
action
,
this
);
break
;
case
ONBOARD_FILES
:
widget
=
new
QGCUASFileViewMulti
(
widgetName
,
action
,
this
);
break
;
case
STATUS_DETAILS
:
widget
=
new
UASInfoWidget
(
widgetName
,
action
,
this
);
break
;
case
HIL_CONFIG
:
widget
=
new
HILDockWidget
(
widgetName
,
action
,
this
);
break
;
case
ANALYZE
:
widget
=
new
Linecharts
(
widgetName
,
action
,
mavlinkDecoder
,
this
);
break
;
case
INFO_VIEW
:
widget
=
new
QGCTabbedInfoView
(
widgetName
,
action
,
this
);
break
;
}
if
(
action
->
data
().
toInt
()
==
INFO_VIEW
)
{
qobject_cast
<
QGCTabbedInfoView
*>
(
widget
)
->
addSource
(
mavlinkDecoder
);
}
if
(
widget
)
{
_mapName2DockWidget
[
widgetName
]
=
widget
;
}
}
_mapName2DockWidget
[
widgetName
]
=
widget
;
return
widget
!=
NULL
;
}
void
MainWindow
::
_hideAllDockWidgets
(
void
)
...
...
src/ui/MainWindow.h
View file @
d091759f
...
...
@@ -221,7 +221,7 @@ private:
void
_loadCurrentViewState
(
void
);
#ifndef __mobile__
void
_createInnerDockWidget
(
const
QString
&
widgetName
);
bool
_createInnerDockWidget
(
const
QString
&
widgetName
);
void
_buildCommonWidgets
(
void
);
void
_hideAllDockWidgets
(
void
);
void
_showDockWidget
(
const
QString
&
name
,
bool
show
);
...
...
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