Commit 3c0c01d6 authored by Lorenz Meier's avatar Lorenz Meier

Mainwindow: Fix HIL config deletion

parent f10f22a7
......@@ -796,6 +796,7 @@ void MainWindow::connectCommonActions()
// Connect internal actions
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(UASCreated(UASInterface*)));
connect(UASManager::instance(), SIGNAL(UASDeleted(int)), this, SLOT(UASDeleted(int)));
// Unmanned System controls
connect(_ui.actionLiftoff, SIGNAL(triggered()), UASManager::instance(), SLOT(launchActiveUAS()));
......@@ -909,6 +910,14 @@ void MainWindow::UASCreated(UASInterface* uas)
}
}
void MainWindow::UASDeleted(int uasId)
{
if (_mapUasId2HilDockWidget.contains(uasId)) {
_mapUasId2HilDockWidget[uasId]->deleteLater();
_mapUasId2HilDockWidget.remove(uasId);
}
}
/// Stores the state of the toolbar, status bar and widgets associated with the current view
void MainWindow::_storeCurrentViewState(void)
{
......
......@@ -146,6 +146,9 @@ public slots:
/** @brief Add a new UAS */
void UASCreated(UASInterface* uas);
/** @brief Remove an old UAS */
void UASDeleted(int uasID);
void handleMisconfiguration(UASInterface* uas);
/** @brief Load configuration views */
void loadSetupView();
......
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