From cf9263f1ff489e7c31fa3822e2028bd1e9688002 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 3 Oct 2015 02:14:26 +0200 Subject: [PATCH] Added a save settings button to the main window --- include-gpl/mainwindow.h | 1 + sdrbase/dsp/dspengine.cpp | 6 ++--- sdrbase/mainwindow.cpp | 5 ++++ sdrbase/mainwindow.ui | 52 ++++++++++++++++++++++++++++++++++++--- 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/include-gpl/mainwindow.h b/include-gpl/mainwindow.h index e4dfb3736..5b79184ce 100644 --- a/include-gpl/mainwindow.h +++ b/include-gpl/mainwindow.h @@ -126,6 +126,7 @@ private slots: void on_action_View_Fullscreen_toggled(bool checked); void on_presetSave_clicked(); void on_presetUpdate_clicked(); + void on_settingsSave_clicked(); void on_presetLoad_clicked(); void on_presetDelete_clicked(); void on_presetTree_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); diff --git a/sdrbase/dsp/dspengine.cpp b/sdrbase/dsp/dspengine.cpp index 601545b22..41d19e0d4 100644 --- a/sdrbase/dsp/dspengine.cpp +++ b/sdrbase/dsp/dspengine.cpp @@ -497,8 +497,6 @@ DSPEngine::State DSPEngine::gotoError(const QString& errorMessage) void DSPEngine::handleSetSource(SampleSource* source) { - qDebug() << "DSPEngine::handleSetSource"; - gotoIdle(); if(m_sampleSource != 0) @@ -510,12 +508,12 @@ void DSPEngine::handleSetSource(SampleSource* source) if(m_sampleSource != 0) { - qDebug() << " - set " << source->getDeviceDescription().toStdString().c_str(); + qDebug() << "DSPEngine::handleSetSource: set " << source->getDeviceDescription().toStdString().c_str(); connect(m_sampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection); } else { - qDebug() << " - set none"; + qDebug() << "DSPEngine::handleSetSource: set none"; } } diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index b915ed2e3..af0a425ec 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -488,6 +488,11 @@ void MainWindow::on_presetUpdate_clicked() } } +void MainWindow::on_settingsSave_clicked() +{ + saveSettings(); +} + void MainWindow::on_presetLoad_clicked() { qDebug() << "MainWindow::on_presetLoad_clicked"; diff --git a/sdrbase/mainwindow.ui b/sdrbase/mainwindow.ui index b5b761490..1da4817ed 100644 --- a/sdrbase/mainwindow.ui +++ b/sdrbase/mainwindow.ui @@ -163,7 +163,7 @@ - + Load selected preset @@ -183,7 +183,7 @@ - + Qt::Horizontal @@ -196,7 +196,7 @@ - + Delete selected preset @@ -216,7 +216,7 @@ - + true @@ -253,6 +253,39 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Save the current settings (inc. presets) + + + ... + + + + :/preset-last.png:/preset-last.png + + + + 16 + 16 + + + + @@ -359,6 +392,17 @@ + + + toolBar + + + TopToolBarArea + + + false + + E&xit