From ec225344d34979518c883b1fbcce3ed3a07a701e Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 24 Oct 2017 18:34:39 +0200 Subject: [PATCH] USe DeviceUISet new struct in main window --- sdrgui/device/deviceuiset.h | 2 +- sdrgui/mainwindow.cpp | 41 ++++++------------------------------- sdrgui/mainwindow.h | 18 +--------------- 3 files changed, 8 insertions(+), 53 deletions(-) diff --git a/sdrgui/device/deviceuiset.h b/sdrgui/device/deviceuiset.h index 60ad89de3..844a3bdcd 100644 --- a/sdrgui/device/deviceuiset.h +++ b/sdrgui/device/deviceuiset.h @@ -30,7 +30,7 @@ class DeviceSourceAPI; class DSPDeviceSinkEngine; class DeviceSinkAPI; -class DeviceUISet +struct DeviceUISet { SpectrumVis *m_spectrumVis; GLSpectrum *m_spectrum; diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index d65e81453..68f40b407 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -15,8 +15,6 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#include -#include #include #include #include @@ -27,10 +25,11 @@ #include #include -#include "mainwindow.h" -#include "ui_mainwindow.h" +#include +#include #include "device/devicesourceapi.h" #include "device/devicesinkapi.h" +#include "device/deviceuiset.h" #include "audio/audiodeviceinfo.h" #include "gui/indicator.h" #include "gui/presetitem.h" @@ -51,6 +50,9 @@ #include "gui/glspectrum.h" #include "gui/glspectrumgui.h" +#include "mainwindow.h" +#include "ui_mainwindow.h" + #include #include @@ -1131,34 +1133,3 @@ void MainWindow::updateStatus() { m_dateTimeWidget->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss t")); } - -MainWindow::DeviceUISet::DeviceUISet(QTimer& timer) -{ - m_spectrum = new GLSpectrum; - m_spectrumVis = new SpectrumVis(m_spectrum); - m_spectrum->connectTimer(timer); - m_spectrumGUI = new GLSpectrumGUI; - m_spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, m_spectrum); - m_channelWindow = new ChannelWindow; - m_samplingDeviceControl = new SamplingDeviceControl; - m_deviceSourceEngine = 0; - m_deviceSourceAPI = 0; - m_deviceSinkEngine = 0; - m_deviceSinkAPI = 0; - - // m_spectrum needs to have its font to be set since it cannot be inherited from the main window - QFont font; - font.setFamily(QStringLiteral("Sans Serif")); - font.setPointSize(9); - m_spectrum->setFont(font); - -} - -MainWindow::DeviceUISet::~DeviceUISet() -{ - delete m_samplingDeviceControl; - delete m_channelWindow; - delete m_spectrumGUI; - delete m_spectrumVis; - delete m_spectrum; -} diff --git a/sdrgui/mainwindow.h b/sdrgui/mainwindow.h index 10ac04296..b626a6812 100644 --- a/sdrgui/mainwindow.h +++ b/sdrgui/mainwindow.h @@ -46,6 +46,7 @@ class ChannelMarker; class PluginManager; class DeviceSourceAPI; class DeviceSinkAPI; +class DeviceUISet; class PluginInterface; class QWidget; @@ -57,23 +58,6 @@ class SDRANGEL_API MainWindow : public QMainWindow { Q_OBJECT public: - struct DeviceUISet - { - SpectrumVis *m_spectrumVis; - GLSpectrum *m_spectrum; - GLSpectrumGUI *m_spectrumGUI; - ChannelWindow *m_channelWindow; - SamplingDeviceControl *m_samplingDeviceControl; - DSPDeviceSourceEngine *m_deviceSourceEngine; - DeviceSourceAPI *m_deviceSourceAPI; - DSPDeviceSinkEngine *m_deviceSinkEngine; - DeviceSinkAPI *m_deviceSinkAPI; - QByteArray m_mainWindowState; - - DeviceUISet(QTimer& timer); - ~DeviceUISet(); - }; - explicit MainWindow(QWidget* parent = 0); ~MainWindow(); static MainWindow *getInstance() { return m_instance; } // Main Window is de facto a singleton so this just returns its reference