From a1936ab3307347ab72a9abcaf026a2e0e10b5000 Mon Sep 17 00:00:00 2001 From: Ladislav Foldyna Date: Sun, 12 Mar 2023 11:05:50 +0100 Subject: [PATCH] Fixed #188 - BandMap: Suppression of double tuneDX signal if double-click --- ui/BandmapWidget.cpp | 10 ++++++++++ ui/BandmapWidget.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/ui/BandmapWidget.cpp b/ui/BandmapWidget.cpp index 28caedb2..15f65a99 100644 --- a/ui/BandmapWidget.cpp +++ b/ui/BandmapWidget.cpp @@ -640,7 +640,17 @@ void BandmapWidget::spotClicked(QString call, double freq) { FCT_IDENTIFICATION; + qCDebug(function_parameters) << call << freq; + qCDebug(runtime) << "Last Tuned DX" << lastTunedDX.callsign << lastTunedDX.freq; + + /* Do not emit the Spot two times - double click*/ + if ( lastTunedDX.callsign == call + && lastTunedDX.freq == freq ) + return; + emit tuneDx(call, freq); + lastTunedDX.callsign = call; + lastTunedDX.freq = freq; } void BandmapWidget::showContextMenu(QPoint point) diff --git a/ui/BandmapWidget.h b/ui/BandmapWidget.h index 97a586df..4f9236d1 100644 --- a/ui/BandmapWidget.h +++ b/ui/BandmapWidget.h @@ -116,6 +116,13 @@ private slots: double zoomFreq; int zoomWidgetYOffset; bool bandmapAnimation; + + struct LastTuneDx + { + QString callsign; + double freq; + }; + LastTuneDx lastTunedDX; }; Q_DECLARE_METATYPE(BandmapWidget::BandmapZoom)