Skip to content

Commit

Permalink
Fixed #188 - BandMap: Suppression of double tuneDX signal if double-c…
Browse files Browse the repository at this point in the history
…lick
  • Loading branch information
foldynl committed Mar 12, 2023
1 parent 3fa78a8 commit a1936ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ui/BandmapWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions ui/BandmapWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a1936ab

Please sign in to comment.