diff --git a/mainwindow.cpp b/mainwindow.cpp index 7819eef05..31627e9a2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1107,7 +1107,7 @@ void MainWindow::on_actionDelete_all_tf2_files_in_SaveDir_triggered() void MainWindow::on_actionErase_Band_Map_and_Messages_triggered() { g_pBandMap->setText(""); - g_pMessages->setText(""); + g_pMessages->setText("",""); m_map65RxLog |= 4; } @@ -1323,7 +1323,7 @@ void MainWindow::readFromStdout() //readFromStdout } if(t.indexOf("") >= 0) { if(m_widebandDecode) { - g_pMessages->setText(m_messagesText); + g_pMessages->setText(m_messagesText,m_bandmapText); g_pBandMap->setText(m_bandmapText); m_widebandDecode=false; } diff --git a/messages.cpp b/messages.cpp index 9a3a6fc8a..86a221812 100644 --- a/messages.cpp +++ b/messages.cpp @@ -11,6 +11,7 @@ Messages::Messages(QWidget *parent) : "QTextBrowser { background-color : #000066; color : red; }"); ui->messagesTextBrowser->clear(); m_cqOnly=false; + m_cqStarOnly=false; connect(ui->messagesTextBrowser,SIGNAL(selectCallsign(bool)),this, SLOT(selectCallsign2(bool))); } @@ -20,10 +21,11 @@ Messages::~Messages() delete ui; } -void Messages::setText(QString t) +void Messages::setText(QString t, QString t2) { QString cfreq,cfreq0; m_t=t; + m_t2=t2; QString s="QTextBrowser{background-color: "+m_colorBackground+"}"; ui->messagesTextBrowser->setStyleSheet(s); @@ -32,7 +34,15 @@ void Messages::setText(QString t) QStringList lines = t.split( "\n", QString::SkipEmptyParts ); foreach( QString line, lines ) { QString t1=line.mid(0,50); - if(m_cqOnly and t1.indexOf(" CQ ") < 0) continue; + int ncq=t1.indexOf(" CQ "); + if((m_cqOnly or m_cqStarOnly) and ncq< 0) continue; + if(m_cqStarOnly) { + QString caller=t1.mid(ncq+4,-1); + int nz=caller.indexOf(" "); + caller=caller.mid(0,nz); + int i=t2.indexOf(caller); + if(t2.mid(i-1,1)==" ") continue; + } int n=line.mid(50,2).toInt(); if(n==0) ui->messagesTextBrowser->setTextColor(m_color0); if(n==1) ui->messagesTextBrowser->setTextColor(m_color1); @@ -64,12 +74,6 @@ void Messages::selectCallsign2(bool ctrl) } } -void Messages::on_checkBox_stateChanged(int n) -{ - m_cqOnly = (n!=0); - setText(m_t); -} - void Messages::setColors(QString t) { m_colorBackground = "#"+t.mid(0,6); @@ -77,5 +81,17 @@ void Messages::setColors(QString t) m_color1 = "#"+t.mid(12,6); m_color2 = "#"+t.mid(18,6); m_color3 = "#"+t.mid(24,6); - setText(m_t); + setText(m_t,m_t2); +} + +void Messages::on_cbCQ_toggled(bool checked) +{ + m_cqOnly = checked; + setText(m_t,m_t2); +} + +void Messages::on_cbCQstar_toggled(bool checked) +{ + m_cqStarOnly = checked; + setText(m_t,m_t2); } diff --git a/messages.h b/messages.h index b264cdb39..de9073904 100644 --- a/messages.h +++ b/messages.h @@ -13,7 +13,7 @@ class Messages : public QDialog public: explicit Messages(QWidget *parent = 0); - void setText(QString t); + void setText(QString t, QString t2); void setColors(QString t); ~Messages(); @@ -23,11 +23,13 @@ signals: private slots: void selectCallsign2(bool ctrl); - void on_checkBox_stateChanged(int arg1); + void on_cbCQ_toggled(bool checked); + void on_cbCQstar_toggled(bool checked); private: Ui::Messages *ui; QString m_t; + QString m_t2; QString m_colorBackground; QString m_color0; QString m_color1; @@ -35,6 +37,7 @@ private: QString m_color3; bool m_cqOnly; + bool m_cqStarOnly; }; #endif // MESSAGES_H diff --git a/messages.ui b/messages.ui index d68839fb1..9c365081c 100644 --- a/messages.ui +++ b/messages.ui @@ -54,7 +54,14 @@ - + + + CQ* Only + + + + + CQ Only