Hide allcall when selcal enabled

This commit is contained in:
Jordan Sherer 2018-10-03 16:30:53 -04:00
parent 93299ec7da
commit f1db556598
3 changed files with 257 additions and 236 deletions

View File

@ -5830,11 +5830,13 @@ void MainWindow::clearActivity(){
clearTableWidget(ui->tableWidgetCalls);
// this is now duplicated in three places :(
ui->tableWidgetCalls->insertRow(ui->tableWidgetCalls->rowCount());
auto item = new QTableWidgetItem("ALLCALL");
item->setData(Qt::UserRole, QVariant("ALLCALL"));
ui->tableWidgetCalls->setItem(ui->tableWidgetCalls->rowCount() - 1, 0, item);
ui->tableWidgetCalls->setSpan(ui->tableWidgetCalls->rowCount() - 1, 0, 1, ui->tableWidgetCalls->columnCount());
if(!ui->selcalButton->isChecked()){
ui->tableWidgetCalls->insertRow(ui->tableWidgetCalls->rowCount());
auto item = new QTableWidgetItem("ALLCALL");
item->setData(Qt::UserRole, QVariant("ALLCALL"));
ui->tableWidgetCalls->setItem(ui->tableWidgetCalls->rowCount() - 1, 0, item);
ui->tableWidgetCalls->setSpan(ui->tableWidgetCalls->rowCount() - 1, 0, 1, ui->tableWidgetCalls->columnCount());
}
clearTableWidget(ui->tableWidgetRXAll);
@ -7057,11 +7059,13 @@ void MainWindow::on_clearAction_triggered(QObject * sender){
m_callActivity.clear();
clearTableWidget((ui->tableWidgetCalls));
auto item = new QTableWidgetItem("ALLCALL");
item->setData(Qt::UserRole, QVariant("ALLCALL"));
ui->tableWidgetCalls->insertRow(ui->tableWidgetCalls->rowCount());
ui->tableWidgetCalls->setItem(ui->tableWidgetCalls->rowCount() - 1, 0, item);
ui->tableWidgetCalls->setSpan(ui->tableWidgetCalls->rowCount() - 1, 0, 1, ui->tableWidgetCalls->columnCount());
if(!ui->selcalButton->isChecked()){
auto item = new QTableWidgetItem("ALLCALL");
item->setData(Qt::UserRole, QVariant("ALLCALL"));
ui->tableWidgetCalls->insertRow(ui->tableWidgetCalls->rowCount());
ui->tableWidgetCalls->setItem(ui->tableWidgetCalls->rowCount() - 1, 0, item);
ui->tableWidgetCalls->setSpan(ui->tableWidgetCalls->rowCount() - 1, 0, 1, ui->tableWidgetCalls->columnCount());
}
}
if(sender == ui->extFreeTextMsgEdit){
@ -7913,6 +7917,18 @@ void MainWindow::on_beaconButton_clicked()
}
}
void MainWindow::on_selcalButton_clicked(){
if(ui->selcalButton->isChecked()){
if(callsignSelected() == "ALLCALL"){
clearCallsignSelected();
}
if(ui->tableWidgetRXAll->isVisible()){
ui->tableWidgetRXAll->setVisible(false);
}
}
displayCallActivity();
}
void MainWindow::on_readFreq_clicked()
{
if (m_transmitting) return;
@ -8955,6 +8971,10 @@ void MainWindow::processRxActivity() {
continue;
}
if(ui->selcalButton->isChecked()){
continue;
}
// use the actual frequency and check its delta from our current frequency
// meaning, if our current offset is 1502 and the d.freq is 1492, the delta is <= 10;
bool shouldDisplay = abs(d.freq - currentFreqOffset()) <= 10;
@ -9233,11 +9253,10 @@ void MainWindow::processCommandActivity() {
continue;
}
#if ENABLE_SELCAL
// if selcal is enabled and this isnt directed to us, take no action.
if (isAllCall && ui->selcalButton->isChecked()) {
continue;
}
#endif
// if this is an allcall, check to make sure we haven't replied to their allcall recently (in the past beacon interval)
// that way we never get spammed by allcalls at a higher frequency than what we would normally beacon
@ -9994,16 +10013,17 @@ void MainWindow::displayCallActivity() {
clearTableWidget(ui->tableWidgetCalls);
// Create the ALLCALL item
auto item = new QTableWidgetItem("ALLCALL");
ui->tableWidgetCalls->insertRow(ui->tableWidgetCalls->rowCount());
item->setData(Qt::UserRole, QVariant("ALLCALL"));
ui->tableWidgetCalls->setItem(ui->tableWidgetCalls->rowCount() - 1, 0, item);
ui->tableWidgetCalls->setSpan(ui->tableWidgetCalls->rowCount() - 1, 0, 1, ui->tableWidgetCalls->columnCount());
if (isAllCallIncluded(selectedCall)) {
ui->tableWidgetCalls->item(0, 0)->setSelected(true);
if(!ui->selcalButton->isChecked()){
auto item = new QTableWidgetItem("ALLCALL");
ui->tableWidgetCalls->insertRow(ui->tableWidgetCalls->rowCount());
item->setData(Qt::UserRole, QVariant("ALLCALL"));
ui->tableWidgetCalls->setItem(ui->tableWidgetCalls->rowCount() - 1, 0, item);
ui->tableWidgetCalls->setSpan(ui->tableWidgetCalls->rowCount() - 1, 0, 1, ui->tableWidgetCalls->columnCount());
if (isAllCallIncluded(selectedCall)) {
ui->tableWidgetCalls->item(0, 0)->setSelected(true);
}
}
// Build the table
QList < QString > keys = m_callActivity.keys();

View File

@ -316,6 +316,7 @@ private slots:
void on_pbR2T_clicked();
void on_pbT2R_clicked();
void on_beaconButton_clicked();
void on_selcalButton_clicked();
void acceptQSO (QDateTime const&, QString const& call, QString const& grid
, Frequency dial_freq, QString const& mode
, QString const& rpt_sent, QString const& rpt_received

View File

@ -481,72 +481,6 @@ color : white;
<enum>QFrame::Plain</enum>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="4" column="5">
<widget class="QPushButton" name="selcalButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>75</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable or disable selective calling (i.e., only directed messages to you will be displayed)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
font-family: helvetica;
font-weight: bold;
background-color: lightgray;
color: black;
border-style: solid;
border-radius:2px;
border-width:0px;
border-color: gray;
font-size:90%;
min-width:75px;
min-height:30px;
/*max-width:60px;*/
max-height:30px;
}
QPushButton[state=&quot;error&quot;] {
background-color: red;
}
QPushButton[state=&quot;warning&quot;] {
background-color: orange;
}
QPushButton[state=&quot;ok&quot;] {
background-color: #00ff00;
}
QPushButton:checked {
background-color: #6699ff;
}</string>
</property>
<property name="text">
<string>SELCAL</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="3">
<spacer name="verticalSpacer_9">
<property name="orientation">
@ -560,82 +494,6 @@ background-color: #6699ff;
</property>
</spacer>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="spotButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>75</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable or disable spotting of callsigns heard to PSKReporter&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
font-family: helvetica;
font-weight: bold;
background-color: lightgray;
color: black;
border-style: solid;
border-radius:2px;
border-width:0px;
border-color: gray;
font-size:90%;
min-width:75px;
min-height:30px;
/*max-width:60px;*/
max-height:30px;
}
QPushButton[state=&quot;error&quot;] {
background-color: red;
}
QPushButton[state=&quot;warning&quot;] {
background-color: orange;
}
QPushButton[state=&quot;ok&quot;] {
background-color: #00ff00;
}
QPushButton:checked {
background-color: #00ff00;
}</string>
</property>
<property name="text">
<string>SPOT</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="3">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QWidget" name="monitorContainer" native="true">
<property name="sizePolicy">
@ -785,8 +643,8 @@ background-color: yellow;
</widget>
</widget>
</item>
<item row="0" column="3">
<spacer name="verticalSpacer_7">
<item row="5" column="3">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -798,69 +656,6 @@ background-color: yellow;
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="tuneButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>75</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Transmit a tuning tone&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
font-family: helvetica;
font-weight: bold;
background-color: lightgray;
color: black;
border-style: solid;
border-radius:2px;
border-width:0px;
border-color: gray;
font-size:90%;
min-width:75px;
min-height:30px;
/*max-width:60px;*/
max-height:30px;
}
QPushButton[state=&quot;error&quot;] {
background-color: red;
}
QPushButton[state=&quot;warning&quot;] {
background-color: orange;
}
QPushButton[state=&quot;ok&quot;] {
background-color: #00ff00;
}
QPushButton:checked {
background-color: #6699ff;
}</string>
</property>
<property name="text">
<string>TUNE</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QPushButton" name="activeButton">
<property name="enabled">
@ -927,13 +722,13 @@ background-color: #6699ff;
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="autoReplyButton">
<item row="1" column="2">
<widget class="QPushButton" name="tuneButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -946,12 +741,12 @@ background-color: #6699ff;
</property>
<property name="maximumSize">
<size>
<width>0</width>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable or disable automatic station replies to directed queries&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Transmit a tuning tone&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
@ -983,14 +778,27 @@ background-color: #6699ff;
}</string>
</property>
<property name="text">
<string>AUTO</string>
<string>TUNE</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="2">
<item row="0" column="3">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="3">
<widget class="QPushButton" name="beaconButton">
<property name="enabled">
<bool>true</bool>
@ -1053,7 +861,199 @@ background-color: #6699ff;
</property>
</widget>
</item>
<item row="4" column="3">
<item row="4" column="2">
<widget class="QPushButton" name="autoReplyButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>75</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable or disable automatic station replies to directed queries&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
font-family: helvetica;
font-weight: bold;
background-color: lightgray;
color: black;
border-style: solid;
border-radius:2px;
border-width:0px;
border-color: gray;
font-size:90%;
min-width:75px;
min-height:30px;
/*max-width:60px;*/
max-height:30px;
}
QPushButton[state=&quot;error&quot;] {
background-color: red;
}
QPushButton[state=&quot;warning&quot;] {
background-color: orange;
}
QPushButton[state=&quot;ok&quot;] {
background-color: #00ff00;
}
QPushButton:checked {
background-color: #6699ff;
}</string>
</property>
<property name="text">
<string>AUTO</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="selcalButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>75</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="visible">
<bool>true</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable or disable selective calling (i.e., only directed messages to you will be displayed in the RX area)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
font-family: helvetica;
font-weight: bold;
background-color: lightgray;
color: black;
border-style: solid;
border-radius:2px;
border-width:0px;
border-color: gray;
font-size:90%;
min-width:75px;
min-height:30px;
/*max-width:60px;*/
max-height:30px;
}
QPushButton[state=&quot;error&quot;] {
background-color: red;
}
QPushButton[state=&quot;warning&quot;] {
background-color: orange;
}
QPushButton[state=&quot;ok&quot;] {
background-color: #00ff00;
}
QPushButton:checked {
background-color: #6699ff;
}</string>
</property>
<property name="text">
<string>SELCAL</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="spotButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>75</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable or disable spotting of callsigns heard to PSKReporter&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
font-family: helvetica;
font-weight: bold;
background-color: lightgray;
color: black;
border-style: solid;
border-radius:2px;
border-width:0px;
border-color: gray;
font-size:90%;
min-width:75px;
min-height:30px;
/*max-width:60px;*/
max-height:30px;
}
QPushButton[state=&quot;error&quot;] {
background-color: red;
}
QPushButton[state=&quot;warning&quot;] {
background-color: orange;
}
QPushButton[state=&quot;ok&quot;] {
background-color: #00ff00;
}
QPushButton:checked {
background-color: #00ff00;
}</string>
</property>
<property name="text">
<string>SPOT</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="logQSOButton">
<property name="enabled">
<bool>true</bool>
@ -1266,7 +1266,7 @@ background-color: #00ff00;
<bool>true</bool>
</property>
<property name="placeholderText">
<string>Incoming and outgoing directed messages will appear here.</string>
<string>Incoming and outgoing messages will appear here.</string>
</property>
</widget>
<widget class="QTextEdit" name="extFreeTextMsgEdit">