Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f4a1b73a
Commit
f4a1b73a
authored
Jul 28, 2011
by
oberion
Browse files
Xbee window fixes
parent
e555424a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ui/CommConfigurationWindow.cc
View file @
f4a1b73a
...
@@ -210,21 +210,32 @@ QAction* CommConfigurationWindow::getAction()
...
@@ -210,21 +210,32 @@ QAction* CommConfigurationWindow::getAction()
void
CommConfigurationWindow
::
setLinkType
(
int
linktype
)
void
CommConfigurationWindow
::
setLinkType
(
int
linktype
)
{
{
#ifdef XBEELINK
#ifdef XBEELINK
// close old configuration window
if
(
link
->
isConnected
())
this
->
window
()
->
close
();
{
// close old configuration window
this
->
window
()
->
close
();
}
else
{
// delete old configuration window
this
->
remove
();
}
LinkInterface
*
tmpLink
(
NULL
);
switch
(
linktype
)
switch
(
linktype
)
{
{
case
4
:
case
4
:
{
{
XbeeLink
*
xbee
=
new
XbeeLink
();
XbeeLink
*
xbee
=
new
XbeeLink
();
MainWindow
::
instance
()
->
addLink
(
xbee
);
tmpLink
=
xbee
;
MainWindow
::
instance
()
->
addLink
(
tmpLink
);
break
;
break
;
}
}
case
0
:
case
0
:
{
{
SerialLink
*
serial
=
new
SerialLink
();
SerialLink
*
serial
=
new
SerialLink
();
MainWindow
::
instance
()
->
addLink
(
serial
);
tmpLink
=
serial
;
MainWindow
::
instance
()
->
addLink
(
tmpLink
);
break
;
break
;
}
}
default:
default:
...
@@ -233,6 +244,16 @@ void CommConfigurationWindow::setLinkType(int linktype)
...
@@ -233,6 +244,16 @@ void CommConfigurationWindow::setLinkType(int linktype)
break
;
break
;
}
}
}
}
// trigger new window
QList
<
QAction
*>
actions
=
MainWindow
::
instance
()
->
listLinkMenuActions
();
foreach
(
QAction
*
act
,
actions
)
{
if
(
act
->
data
().
toInt
()
==
LinkManager
::
instance
()
->
getLinks
().
indexOf
(
tmpLink
))
{
act
->
trigger
();
break
;
}
}
#endif // XBEELINK
#endif // XBEELINK
}
}
...
...
src/ui/MainWindow.cc
View file @
f4a1b73a
...
@@ -2002,3 +2002,7 @@ void MainWindow::loadDataView(QString fileName)
...
@@ -2002,3 +2002,7 @@ void MainWindow::loadDataView(QString fileName)
}
}
QList
<
QAction
*>
MainWindow
::
listLinkMenuActions
(
void
)
{
return
ui
.
menuNetwork
->
actions
();
}
\ No newline at end of file
src/ui/MainWindow.h
View file @
f4a1b73a
...
@@ -35,6 +35,7 @@ This file is part of the QGROUNDCONTROL project
...
@@ -35,6 +35,7 @@ This file is part of the QGROUNDCONTROL project
#include
<QStatusBar>
#include
<QStatusBar>
#include
<QStackedWidget>
#include
<QStackedWidget>
#include
<QSettings>
#include
<QSettings>
#include
<qlist.h>
#include
"ui_MainWindow.h"
#include
"ui_MainWindow.h"
#include
"LinkManager.h"
#include
"LinkManager.h"
...
@@ -215,6 +216,9 @@ public slots:
...
@@ -215,6 +216,9 @@ public slots:
/** @brief Updates a QDockWidget's location */
/** @brief Updates a QDockWidget's location */
void
updateLocationSettings
(
Qt
::
DockWidgetArea
location
);
void
updateLocationSettings
(
Qt
::
DockWidgetArea
location
);
public:
QList
<
QAction
*>
listLinkMenuActions
(
void
);
protected:
protected:
MainWindow
(
QWidget
*
parent
=
0
);
MainWindow
(
QWidget
*
parent
=
0
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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