1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

Main window: handle window closing correctly

This commit is contained in:
f4exb 2019-07-22 18:49:24 +02:00
parent a6a6a078f5
commit 0af803551a
2 changed files with 12 additions and 13 deletions

View File

@ -812,8 +812,19 @@ void MainWindow::createStatusBar()
statusBar()->addPermanentWidget(m_dateTimeWidget);
}
void MainWindow::closeEvent(QCloseEvent*)
void MainWindow::closeEvent(QCloseEvent *closeEvent)
{
qDebug("MainWindow::closeEvent");
savePresetSettings(m_settings.getWorkingPreset(), 0);
m_settings.save();
while (m_deviceUIs.size() > 0)
{
removeLastDevice();
}
closeEvent->accept();
}
void MainWindow::updatePresetControls()
@ -1942,17 +1953,6 @@ void MainWindow::on_action_removeLastDevice_triggered()
}
}
void MainWindow::on_action_Exit_triggered()
{
savePresetSettings(m_settings.getWorkingPreset(), 0);
m_settings.save();
while (m_deviceUIs.size() > 0)
{
removeLastDevice();
}
}
void MainWindow::tabInputViewIndexChanged()
{
int inputViewIndex = ui->tabInputsView->currentIndex();

View File

@ -392,7 +392,6 @@ private slots:
void on_action_addSinkDevice_triggered();
void on_action_addMIMODevice_triggered();
void on_action_removeLastDevice_triggered();
void on_action_Exit_triggered();
void tabInputViewIndexChanged();
void commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release);
};