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
0d1969c0
Commit
0d1969c0
authored
Jan 21, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed all known issues in application persistence
parent
b770e5b7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
26 deletions
+68
-26
HUD.cc
src/ui/HUD.cc
+4
-0
MainWindow.cc
src/ui/MainWindow.cc
+64
-26
No files found.
src/ui/HUD.cc
View file @
0d1969c0
...
@@ -230,6 +230,10 @@ void HUD::hideEvent(QHideEvent* event)
...
@@ -230,6 +230,10 @@ void HUD::hideEvent(QHideEvent* event)
void
HUD
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
void
HUD
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
{
{
QMenu
menu
(
this
);
QMenu
menu
(
this
);
// Update actions
enableHUDAction
->
setChecked
(
hudInstrumentsEnabled
);
enableVideoAction
->
setChecked
(
videoEnabled
);
menu
.
addAction
(
enableHUDAction
);
menu
.
addAction
(
enableHUDAction
);
//menu.addAction(selectHUDColorAction);
//menu.addAction(selectHUDColorAction);
menu
.
addAction
(
enableVideoAction
);
menu
.
addAction
(
enableVideoAction
);
...
...
src/ui/MainWindow.cc
View file @
0d1969c0
...
@@ -214,8 +214,8 @@ void MainWindow::setDefaultSettingsForAp()
...
@@ -214,8 +214,8 @@ void MainWindow::setDefaultSettingsForAp()
// ENABLE UAS LIST
// ENABLE UAS LIST
settings
.
setValue
(
buildMenuKey
(
SUB_SECTION_CHECKED
,
MainWindow
::
MENU_UAS_LIST
,
VIEW_OPERATOR
),
true
);
settings
.
setValue
(
buildMenuKey
(
SUB_SECTION_CHECKED
,
MainWindow
::
MENU_UAS_LIST
,
VIEW_OPERATOR
),
true
);
// ENABLE
COMMUNICATION CONSOLE
// ENABLE
HUD TOOL WIDGET
settings
.
setValue
(
buildMenuKey
(
SUB_SECTION_CHECKED
,
MainWindow
::
MENU_
DEBUG_CONSOLE
,
VIEW_OPERATOR
),
true
);
settings
.
setValue
(
buildMenuKey
(
SUB_SECTION_CHECKED
,
MainWindow
::
MENU_
HUD
,
VIEW_OPERATOR
),
true
);
}
}
// ENGINEER VIEW DEFAULT
// ENGINEER VIEW DEFAULT
...
@@ -516,7 +516,7 @@ void MainWindow::buildPxWidgets()
...
@@ -516,7 +516,7 @@ void MainWindow::buildPxWidgets()
headUpDockWidget
=
new
QDockWidget
(
tr
(
"HUD"
),
this
);
headUpDockWidget
=
new
QDockWidget
(
tr
(
"HUD"
),
this
);
headUpDockWidget
->
setWidget
(
new
HUD
(
320
,
240
,
this
));
headUpDockWidget
->
setWidget
(
new
HUD
(
320
,
240
,
this
));
headUpDockWidget
->
setObjectName
(
"HEAD_UP_DISPLAY_DOCK_WIDGET"
);
headUpDockWidget
->
setObjectName
(
"HEAD_UP_DISPLAY_DOCK_WIDGET"
);
addToToolsMenu
(
headUpDockWidget
,
tr
(
"
Control Indicator"
),
SLOT
(
showToolWidget
(
bool
)),
MENU_HUD
,
Qt
::
Lef
tDockWidgetArea
);
addToToolsMenu
(
headUpDockWidget
,
tr
(
"
Head Up Display"
),
SLOT
(
showToolWidget
(
bool
)),
MENU_HUD
,
Qt
::
Righ
tDockWidgetArea
);
}
}
if
(
!
video1DockWidget
)
if
(
!
video1DockWidget
)
...
@@ -766,7 +766,7 @@ void MainWindow::addToToolsMenu ( QWidget* widget,
...
@@ -766,7 +766,7 @@ void MainWindow::addToToolsMenu ( QWidget* widget,
connect
(
tempAction
,
SIGNAL
(
toggled
(
bool
)),
this
,
slotName
);
connect
(
tempAction
,
SIGNAL
(
toggled
(
bool
)),
this
,
slotName
);
connect
(
qobject_cast
<
QDockWidget
*>
(
dockWidgets
[
tool
]),
connect
(
qobject_cast
<
QDockWidget
*>
(
dockWidgets
[
tool
]),
SIGNAL
(
visibilityChanged
(
bool
)),
t
empAction
,
SLOT
(
setChecked
(
bool
)));
SIGNAL
(
visibilityChanged
(
bool
)),
t
his
,
SLOT
(
showToolWidget
(
bool
)));
// connect(qobject_cast <QDockWidget *>(dockWidgets[tool]),
// connect(qobject_cast <QDockWidget *>(dockWidgets[tool]),
// SIGNAL(visibilityChanged(bool)), this, SLOT(updateVisibilitySettings(bool)));
// SIGNAL(visibilityChanged(bool)), this, SLOT(updateVisibilitySettings(bool)));
...
@@ -780,23 +780,60 @@ void MainWindow::showToolWidget(bool visible)
...
@@ -780,23 +780,60 @@ void MainWindow::showToolWidget(bool visible)
if
(
!
aboutToCloseFlag
&&
!
changingViewsFlag
)
if
(
!
aboutToCloseFlag
&&
!
changingViewsFlag
)
{
{
QAction
*
action
=
qobject_cast
<
QAction
*>
(
sender
());
QAction
*
action
=
qobject_cast
<
QAction
*>
(
sender
());
// Prevent this to fire if undocked
if
(
action
)
{
int
tool
=
action
->
data
().
toInt
();
int
tool
=
action
->
data
().
toInt
();
QDockWidget
*
dockWidget
=
qobject_cast
<
QDockWidget
*>
(
dockWidgets
[
tool
]);
QDockWidget
*
dockWidget
=
qobject_cast
<
QDockWidget
*>
(
dockWidgets
[
tool
]);
if
(
action
&&
dockWidget
)
qDebug
()
<<
"DATA:"
<<
tool
<<
"FLOATING"
<<
dockWidget
->
isFloating
()
<<
"checked"
<<
action
->
isChecked
()
<<
"visible"
<<
dockWidget
->
isVisible
()
<<
"action vis:"
<<
action
->
isVisible
();
if
(
dockWidget
&&
dockWidget
->
isVisible
()
!=
visible
)
{
{
if
(
visible
)
if
(
visible
)
{
{
qDebug
()
<<
"DOCK WIDGET ADDED"
;
addDockWidget
(
dockWidgetLocations
[
tool
],
dockWidget
);
addDockWidget
(
dockWidgetLocations
[
tool
],
dockWidget
);
dockWidget
->
show
();
dockWidget
->
show
();
}
}
else
if
(
!
visible
&&
dockWidget
->
isVisible
())
{
{
qDebug
()
<<
"DOCK WIDGET REMOVED"
;
removeDockWidget
(
dockWidget
);
removeDockWidget
(
dockWidget
);
//dockWidget->hide();
}
QHashIterator
<
int
,
QWidget
*>
i
(
dockWidgets
);
while
(
i
.
hasNext
())
{
i
.
next
();
if
((
static_cast
<
QDockWidget
*>
(
dockWidgets
[
i
.
key
()]))
==
dockWidget
)
{
QString
chKey
=
buildMenuKey
(
SUB_SECTION_CHECKED
,
static_cast
<
TOOLS_WIDGET_NAMES
>
(
i
.
key
()),
currentView
);
settings
.
setValue
(
chKey
,
visible
);
qDebug
()
<<
"showToolWidget(): Set key"
<<
chKey
<<
"to"
<<
visible
;
break
;
}
}
}
}
}
QDockWidget
*
dockWidget
=
qobject_cast
<
QDockWidget
*>
(
QObject
::
sender
());
qDebug
()
<<
"Trying to cast dockwidget"
<<
dockWidget
<<
"isvisible"
<<
visible
;
if
(
dockWidget
)
{
// Get action
int
tool
=
dockWidgets
.
key
(
dockWidget
);
qDebug
()
<<
"Updating widget setting"
<<
tool
<<
"to"
<<
visible
;
QAction
*
action
=
toolsMenuActions
[
tool
];
action
->
blockSignals
(
true
);
action
->
setChecked
(
visible
);
action
->
blockSignals
(
false
);
QHashIterator
<
int
,
QWidget
*>
i
(
dockWidgets
);
QHashIterator
<
int
,
QWidget
*>
i
(
dockWidgets
);
while
(
i
.
hasNext
())
while
(
i
.
hasNext
())
...
@@ -1778,19 +1815,20 @@ void MainWindow::presentView()
...
@@ -1778,19 +1815,20 @@ void MainWindow::presentView()
this
->
show
();
this
->
show
();
// Restore window state
// Restore window state
// if (UASManager::instance()->getUASList().count() > 0)
if
(
UASManager
::
instance
()
->
getUASList
().
count
()
>
0
)
// {
{
// // Restore the widget positions and size
// Restore the mainwindow size
// if (settings.contains(getWindowStateKey()))
// {
// restoreState(settings.value(getWindowStateKey()).toByteArray(), QGC::applicationVersion());
// }
if
(
settings
.
contains
(
getWindowGeometryKey
()))
if
(
settings
.
contains
(
getWindowGeometryKey
()))
{
{
restoreGeometry
(
settings
.
value
(
getWindowGeometryKey
()).
toByteArray
());
restoreGeometry
(
settings
.
value
(
getWindowGeometryKey
()).
toByteArray
());
}
}
// }
// Restore the widget positions and size
if
(
settings
.
contains
(
getWindowStateKey
()))
{
restoreState
(
settings
.
value
(
getWindowStateKey
()).
toByteArray
(),
QGC
::
applicationVersion
());
}
}
}
}
void
MainWindow
::
showTheCentralWidget
(
TOOLS_WIDGET_NAMES
centralWidget
,
VIEW_SECTIONS
view
)
void
MainWindow
::
showTheCentralWidget
(
TOOLS_WIDGET_NAMES
centralWidget
,
VIEW_SECTIONS
view
)
...
...
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