Move asterisk; add "Ready on;y" checkbox; some code cleanup.

This commit is contained in:
Joe Taylor 2022-03-20 14:16:20 -04:00
parent edd7fadd5a
commit aa9cc8e885
4 changed files with 67 additions and 51 deletions

View File

@ -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();
}

View File

@ -25,6 +25,7 @@ public:
int maxAge();
void setClickOK(bool b);
void erase();
bool readyOnly();
Q_SLOT void select();
bool m_clickOK=false;

View File

@ -18,6 +18,44 @@
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QSpinBox" name="sbMaxRecent">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="prefix">
<string>Max N </string>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="sbMaxAge">
<property name="sizePolicy">
@ -46,44 +84,13 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QSpinBox" name="sbMaxRecent">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="prefix">
<string>Max Recent </string>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>10</number>
<item row="0" column="2">
<widget class="QCheckBox" name="cbReadyOnly">
<property name="text">
<string>Ready only</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">

View File

@ -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;