Commit 61202e9a authored by Don Gagne's avatar Don Gagne

Change toolbox startup mechanism

This prevents problems with toolbox references from inside
QGCTool::setToolbox calls.
parent eca72e33
...@@ -343,6 +343,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) ...@@ -343,6 +343,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
initializeVideoStreaming(argc, argv); initializeVideoStreaming(argc, argv);
_toolbox = new QGCToolbox(this); _toolbox = new QGCToolbox(this);
_toolbox->setChildToolboxes();
} }
QGCApplication::~QGCApplication() QGCApplication::~QGCApplication()
......
...@@ -71,7 +71,10 @@ QGCToolbox::QGCToolbox(QGCApplication* app) ...@@ -71,7 +71,10 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
_qgcPositionManager = new QGCPositionManager(app); _qgcPositionManager = new QGCPositionManager(app);
_followMe = new FollowMe(app); _followMe = new FollowMe(app);
_videoManager = new VideoManager(app); _videoManager = new VideoManager(app);
}
void QGCToolbox::setChildToolboxes(void)
{
_audioOutput->setToolbox(this); _audioOutput->setToolbox(this);
_autopilotPluginManager->setToolbox(this); _autopilotPluginManager->setToolbox(this);
_factSystem->setToolbox(this); _factSystem->setToolbox(this);
......
...@@ -61,6 +61,8 @@ public: ...@@ -61,6 +61,8 @@ public:
#endif #endif
private: private:
void setChildToolboxes(void);
GAudioOutput* _audioOutput; GAudioOutput* _audioOutput;
AutoPilotPluginManager* _autopilotPluginManager; AutoPilotPluginManager* _autopilotPluginManager;
FactSystem* _factSystem; FactSystem* _factSystem;
...@@ -81,6 +83,8 @@ private: ...@@ -81,6 +83,8 @@ private:
FollowMe* _followMe; FollowMe* _followMe;
QGCPositionManager* _qgcPositionManager; QGCPositionManager* _qgcPositionManager;
VideoManager* _videoManager; VideoManager* _videoManager;
friend class QGCApplication;
}; };
/// This is the base class for all tools /// This is the base class for all tools
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment