Add a "CQstarOnly" button.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@4703 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2014-11-30 16:46:23 +00:00
parent 6ac901b3ef
commit 1e9ba7740b
4 changed files with 40 additions and 14 deletions

View File

@ -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("<DecodeFinished>") >= 0) {
if(m_widebandDecode) {
g_pMessages->setText(m_messagesText);
g_pMessages->setText(m_messagesText,m_bandmapText);
g_pBandMap->setText(m_bandmapText);
m_widebandDecode=false;
}

View File

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

View File

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

View File

@ -54,7 +54,14 @@
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<widget class="QCheckBox" name="cbCQstar">
<property name="text">
<string>CQ* Only</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbCQ">
<property name="text">
<string>CQ Only</string>
</property>