diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 4d523e866..18f3363c4 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -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(); diff --git a/sdrgui/mainwindow.h b/sdrgui/mainwindow.h index a091e754c..b91943bf1 100644 --- a/sdrgui/mainwindow.h +++ b/sdrgui/mainwindow.h @@ -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); };