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
e10ca000
Commit
e10ca000
authored
Sep 19, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-enabled custom widget loading
parent
6bbd1bb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
40 deletions
+41
-40
UAS.cc
src/uas/UAS.cc
+7
-4
MainWindow.cc
src/ui/MainWindow.cc
+34
-36
No files found.
src/uas/UAS.cc
View file @
e10ca000
...
...
@@ -1766,10 +1766,13 @@ void UAS::setSystemType(int systemType)
void
UAS
::
setUASName
(
const
QString
&
name
)
{
this
->
name
=
name
;
writeSettings
();
emit
nameChanged
(
name
);
emit
systemSpecsChanged
(
uasId
);
if
(
name
!=
""
)
{
this
->
name
=
name
;
writeSettings
();
emit
nameChanged
(
name
);
emit
systemSpecsChanged
(
uasId
);
}
}
void
UAS
::
executeCommand
(
MAV_CMD
command
)
...
...
src/ui/MainWindow.cc
View file @
e10ca000
...
...
@@ -146,6 +146,8 @@ MainWindow::MainWindow(QWidget *parent):
// Create actions
connectCommonActions
();
buildCustomWidget
();
// Restore the window setup
...
...
@@ -268,40 +270,36 @@ QString MainWindow::getWindowGeometryKey()
void
MainWindow
::
buildCustomWidget
()
{
// Show custom widgets only if UAS is connected
if
(
UASManager
::
instance
()
->
getActiveUAS
()
!=
NULL
)
{
// Create custom widgets
QList
<
QGCToolWidget
*>
widgets
=
QGCToolWidget
::
createWidgetsFromSettings
(
this
);
// Create custom widgets
QList
<
QGCToolWidget
*>
widgets
=
QGCToolWidget
::
createWidgetsFromSettings
(
this
);
if
(
widgets
.
size
()
>
0
)
{
ui
.
menuTools
->
addSeparator
();
}
if
(
widgets
.
size
()
>
0
)
{
ui
.
menuTools
->
addSeparator
();
}
for
(
int
i
=
0
;
i
<
widgets
.
size
();
++
i
)
for
(
int
i
=
0
;
i
<
widgets
.
size
();
++
i
)
{
// Check if this widget already has a parent, do not create it in this case
QGCToolWidget
*
tool
=
widgets
.
at
(
i
);
QDockWidget
*
dock
=
dynamic_cast
<
QDockWidget
*>
(
tool
->
parentWidget
());
if
(
!
dock
)
{
// Check if this widget already has a parent, do not create it in this case
QGCToolWidget
*
tool
=
widgets
.
at
(
i
);
QDockWidget
*
dock
=
dynamic_cast
<
QDockWidget
*>
(
tool
->
parentWidget
());
if
(
!
dock
)
{
QDockWidget
*
dock
=
new
QDockWidget
(
tool
->
windowTitle
(),
this
);
dock
->
setObjectName
(
tool
->
objectName
()
+
"_DOCK"
);
dock
->
setWidget
(
tool
);
connect
(
tool
,
SIGNAL
(
destroyed
()),
dock
,
SLOT
(
deleteLater
()));
QAction
*
showAction
=
new
QAction
(
widgets
.
at
(
i
)
->
windowTitle
(),
this
);
showAction
->
setCheckable
(
true
);
connect
(
showAction
,
SIGNAL
(
triggered
(
bool
)),
dock
,
SLOT
(
setVisible
(
bool
)));
connect
(
dock
,
SIGNAL
(
visibilityChanged
(
bool
)),
showAction
,
SLOT
(
setChecked
(
bool
)));
widgets
.
at
(
i
)
->
setMainMenuAction
(
showAction
);
ui
.
menuTools
->
addAction
(
showAction
);
// Load dock widget location (default is bottom)
Qt
::
DockWidgetArea
location
=
static_cast
<
Qt
::
DockWidgetArea
>
(
tool
->
getDockWidgetArea
(
currentView
));
addDockWidget
(
location
,
dock
);
}
QDockWidget
*
dock
=
new
QDockWidget
(
tool
->
windowTitle
(),
this
);
dock
->
setObjectName
(
tool
->
objectName
()
+
"_DOCK"
);
dock
->
setWidget
(
tool
);
connect
(
tool
,
SIGNAL
(
destroyed
()),
dock
,
SLOT
(
deleteLater
()));
QAction
*
showAction
=
new
QAction
(
widgets
.
at
(
i
)
->
windowTitle
(),
this
);
showAction
->
setCheckable
(
true
);
connect
(
showAction
,
SIGNAL
(
triggered
(
bool
)),
dock
,
SLOT
(
setVisible
(
bool
)));
connect
(
dock
,
SIGNAL
(
visibilityChanged
(
bool
)),
showAction
,
SLOT
(
setChecked
(
bool
)));
widgets
.
at
(
i
)
->
setMainMenuAction
(
showAction
);
ui
.
menuTools
->
addAction
(
showAction
);
// Load dock widget location (default is bottom)
Qt
::
DockWidgetArea
location
=
static_cast
<
Qt
::
DockWidgetArea
>
(
tool
->
getDockWidgetArea
(
currentView
));
addDockWidget
(
location
,
dock
);
}
}
}
...
...
@@ -1251,11 +1249,11 @@ void MainWindow::UASCreated(UASInterface* uas)
if
(
!
ui
.
menuConnected_Systems
->
isEnabled
())
ui
.
menuConnected_Systems
->
setEnabled
(
true
);
// Restore the mainwindow size
if
(
settings
.
contains
(
getWindowGeometryKey
()))
{
restoreGeometry
(
settings
.
value
(
getWindowGeometryKey
()).
toByteArray
());
}
//
// Restore the mainwindow size
//
if (settings.contains(getWindowGeometryKey()))
//
{
//
restoreGeometry(settings.value(getWindowGeometryKey()).toByteArray());
//
}
}
/**
...
...
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