From 4cd9055fe65c975374f63c8de8629bf8717b9a39 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 11 Sep 2018 08:41:37 +0200 Subject: [PATCH] DaemonSrc: fixed missing channel deletion on GUI deletion. Added missing signals handling --- plugins/channeltx/daemonsrc/daemonsrc.cpp | 8 ++++---- plugins/channeltx/daemonsrc/daemonsrcgui.cpp | 10 +++++++++- plugins/channeltx/daemonsrc/daemonsrcgui.h | 3 +++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/plugins/channeltx/daemonsrc/daemonsrc.cpp b/plugins/channeltx/daemonsrc/daemonsrc.cpp index d793da79d..318188243 100644 --- a/plugins/channeltx/daemonsrc/daemonsrc.cpp +++ b/plugins/channeltx/daemonsrc/daemonsrc.cpp @@ -52,14 +52,14 @@ DaemonSrc::DaemonSrc(DeviceSinkAPI *deviceAPI) : { setObjectName(m_channelId); + connect(&m_dataQueue, SIGNAL(dataBlockEnqueued()), this, SLOT(handleData()), Qt::QueuedConnection); + m_cm256p = m_cm256.isInitialized() ? &m_cm256 : 0; + m_currentMeta.init(); + m_channelizer = new UpChannelizer(this); m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this); m_deviceAPI->addThreadedSource(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); - - connect(&m_dataQueue, SIGNAL(dataBlockEnqueued()), this, SLOT(handleData()), Qt::QueuedConnection); - m_cm256p = m_cm256.isInitialized() ? &m_cm256 : 0; - m_currentMeta.init(); } DaemonSrc::~DaemonSrc() diff --git a/plugins/channeltx/daemonsrc/daemonsrcgui.cpp b/plugins/channeltx/daemonsrc/daemonsrcgui.cpp index 003262f6a..3823a9869 100644 --- a/plugins/channeltx/daemonsrc/daemonsrcgui.cpp +++ b/plugins/channeltx/daemonsrc/daemonsrcgui.cpp @@ -169,10 +169,13 @@ DaemonSrcGUI::DaemonSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); m_daemonSrc = (DaemonSrc*) channelTx; m_daemonSrc->setMessageQueueToGUI(getInputMessageQueue()); + connect(&(m_deviceUISet->m_deviceSinkAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); + m_channelMarker.blockSignals(true); m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.setCenterFrequency(0); @@ -186,8 +189,8 @@ DaemonSrcGUI::DaemonSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addRollupWidget(this); + connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); - connect(&(m_deviceUISet->m_deviceSinkAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); m_time.start(); @@ -198,6 +201,7 @@ DaemonSrcGUI::DaemonSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb DaemonSrcGUI::~DaemonSrcGUI() { m_deviceUISet->removeTxChannelInstance(this); + delete m_daemonSrc; delete ui; } @@ -370,3 +374,7 @@ void DaemonSrcGUI::tick() m_tickCount = 0; } } + +void DaemonSrcGUI::channelMarkerChangedByCursor() +{ +} diff --git a/plugins/channeltx/daemonsrc/daemonsrcgui.h b/plugins/channeltx/daemonsrc/daemonsrcgui.h index 7b47c9b99..4d720e3b4 100644 --- a/plugins/channeltx/daemonsrc/daemonsrcgui.h +++ b/plugins/channeltx/daemonsrc/daemonsrcgui.h @@ -53,6 +53,9 @@ public: virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } virtual bool handleMessage(const Message& message); +public slots: + void channelMarkerChangedByCursor(); + private: Ui::DaemonSrcGUI* ui; PluginAPI* m_pluginAPI;