From aa9cc8e885f3dc115c23f3514bff86aed668b5d3 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 20 Mar 2022 14:16:20 -0400 Subject: [PATCH] Move asterisk; add "Ready on;y" checkbox; some code cleanup. --- widgets/activeStations.cpp | 7 +++- widgets/activeStations.h | 1 + widgets/activeStations.ui | 77 +++++++++++++++++++++----------------- widgets/mainwindow.cpp | 33 ++++++++-------- 4 files changed, 67 insertions(+), 51 deletions(-) diff --git a/widgets/activeStations.cpp b/widgets/activeStations.cpp index 41d42d86a..53cd109fd 100644 --- a/widgets/activeStations.cpp +++ b/widgets/activeStations.cpp @@ -21,7 +21,7 @@ ActiveStations::ActiveStations(QSettings * settings, QFont const& font, QWidget ui->RecentStationsPlainTextEdit->setReadOnly (true); changeFont (font); read_settings (); - ui->header_label2->setText(" N Call Grid Az S/N Freq Tx Age Pts Bands"); + ui->header_label2->setText(" N Call Grid Az S/N Freq Tx Age Pts Bands"); connect(ui->RecentStationsPlainTextEdit, SIGNAL(selectionChanged()), this, SLOT(select())); } @@ -88,3 +88,8 @@ void ActiveStations::erase() { ui->RecentStationsPlainTextEdit->clear(); } + +bool ActiveStations::readyOnly() +{ + return ui->cbReadyOnly->isChecked(); +} diff --git a/widgets/activeStations.h b/widgets/activeStations.h index 76301a0cc..0ff989ac9 100644 --- a/widgets/activeStations.h +++ b/widgets/activeStations.h @@ -25,6 +25,7 @@ public: int maxAge(); void setClickOK(bool b); void erase(); + bool readyOnly(); Q_SLOT void select(); bool m_clickOK=false; diff --git a/widgets/activeStations.ui b/widgets/activeStations.ui index 563a3898f..980503f7c 100644 --- a/widgets/activeStations.ui +++ b/widgets/activeStations.ui @@ -18,6 +18,44 @@ + + + + + 0 + 0 + + + + + 100 + 0 + + + + Max N + + + 50 + + + 10 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -46,44 +84,13 @@ - - - - - 0 - 0 - - - - - 100 - 0 - - - - Max Recent - - - 50 - - - 10 + + + + Ready only - - - - Qt::Horizontal - - - - 40 - 20 - - - - diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 3cda280c6..4f10a3319 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3445,21 +3445,24 @@ void MainWindow::ARRL_Digi_Display() if(age>maxAge) { icall.remove(); } else { - i++; - int az=m_activeCall[deCall].az; - deGrid=m_activeCall[deCall].grid4; - points=m_activeCall[deCall].points; - bands=m_activeCall[deCall].bands; - if(points>maxPoints) maxPoints=points; - float x=float(age)/(maxAge+1); - if(x>1.0) x=0; - pts[i-1]=points - x; - QString t0=" "; - if(age==0 and m_recentCall.value(deCall).ready2call) t0="* "; - QString t1; - t1 = t1.asprintf(" %3d %+2.2d %4d %1d %2d %4d",az,snr,freq,itx,age,points); - t1 = t0 + (deCall + " ").left(6) + " " + m_activeCall[deCall].grid4 + t1 + " " + bands; - list.append(t1); + bool bReady=false; + if(age==0 and m_recentCall.value(deCall).ready2call) bReady=true; + if(bReady or !m_ActiveStationsWidget->readyOnly()) { + i++; + int az=m_activeCall[deCall].az; + deGrid=m_activeCall[deCall].grid4; + points=m_activeCall[deCall].points; + bands=m_activeCall[deCall].bands; + if(points>maxPoints) maxPoints=points; + float x=float(age)/(maxAge+1); + if(x>1.0) x=0; + pts[i-1]=points - x; + QString t1; + if(!bReady) t1 = t1.asprintf(" %3d %+2.2d %4d %1d %2d %4d",az,snr,freq,itx,age,points); + if(bReady) t1 = t1.asprintf(" %3d %+2.2d %4d %1d %2d*%4d",az,snr,freq,itx,age,points); + t1 = (deCall + " ").left(6) + " " + m_activeCall[deCall].grid4 + t1 + " " + bands; + list.append(t1); + } } } if(i==0) return;