mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 13:48:42 -05:00
Code cleanup; resort displayed Hound calls after activating the sort ComboBox.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8288 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
053a83dc52
commit
3acb75bb41
@ -2768,19 +2768,21 @@ void MainWindow::decodeDone ()
|
|||||||
QTextStream s(&f);
|
QTextStream s(&f);
|
||||||
QString t="";
|
QString t="";
|
||||||
QString t0;
|
QString t0;
|
||||||
QString c2;
|
QString houndCall;
|
||||||
bool b;
|
bool b;
|
||||||
while(!s.atEnd()) {
|
while(!s.atEnd()) {
|
||||||
t0=s.readLine();
|
t0=s.readLine();
|
||||||
c2=t0.mid(0,6);
|
houndCall=t0.mid(0,6);
|
||||||
b=false;
|
b=false;
|
||||||
if(ui->textBrowser3->toPlainText().indexOf(c2) >= 0) b=true;
|
if(ui->textBrowser3->toPlainText().indexOf(houndCall) >= 0) b=true;
|
||||||
if(ui->textBrowser4->toPlainText().indexOf(c2) >= 0) b=true;
|
if(ui->textBrowser4->toPlainText().indexOf(houndCall) >= 0) b=true;
|
||||||
if(!b) {
|
if(!b) {
|
||||||
QString countryName;
|
QString countryName,continent;
|
||||||
bool callWorkedBefore,countryWorkedBefore;
|
bool callWorkedBefore,countryWorkedBefore;
|
||||||
m_logBook.match(/*in*/c2,/*out*/countryName,callWorkedBefore,countryWorkedBefore);
|
m_logBook.match(/*in*/houndCall,/*out*/countryName,callWorkedBefore,countryWorkedBefore);
|
||||||
qDebug() << "D" << t0 << countryName;
|
int i1=countryName.lastIndexOf(";");
|
||||||
|
continent=countryName.mid(i1+2,-1);
|
||||||
|
qDebug() << "D" << t0 << continent;
|
||||||
t += (t0 + "\n"); //Don't list calls already in QSO or in the stack
|
t += (t0 + "\n"); //Don't list calls already in QSO or in the stack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2859,18 +2861,18 @@ void MainWindow::readFromStdout() //readFromStdout
|
|||||||
ui->cbVHFcontest->isChecked(), m_config.my_grid ()};
|
ui->cbVHFcontest->isChecked(), m_config.my_grid ()};
|
||||||
|
|
||||||
if(m_mode=="FT8" and m_config.bFox()) {
|
if(m_mode=="FT8" and m_config.bFox()) {
|
||||||
QString c2,g2;
|
QString houndCall,houndGrid;
|
||||||
decodedtext.deCallAndGrid(/*out*/c2,g2);
|
decodedtext.deCallAndGrid(/*out*/houndCall,houndGrid);
|
||||||
if(g2.mid(0,2)=="R+" or g2.mid(0,2)=="R-") {
|
if(houndGrid.mid(0,2)=="R+" or houndGrid.mid(0,2)=="R-") {
|
||||||
QString a=ui->textBrowser3->toPlainText();
|
QString a=ui->textBrowser3->toPlainText();
|
||||||
int i0=a.indexOf(c2);
|
int i0=a.indexOf(houndCall);
|
||||||
if(i0 >= 0) {
|
if(i0 >= 0) {
|
||||||
QString b=a.mid(i0);
|
QString b=a.mid(i0);
|
||||||
QStringList c=a.split("\n");
|
QStringList c=a.split("\n");
|
||||||
ui->textBrowser3->setText("");
|
ui->textBrowser3->setText("");
|
||||||
for (int i=0; i<c.length(); i++) {
|
for (int i=0; i<c.length(); i++) {
|
||||||
QString d=c.at(i);
|
QString d=c.at(i);
|
||||||
if(d.indexOf(c2)<0 and d.indexOf("RR73")<0) {
|
if(d.indexOf(houndCall)<0 and d.indexOf("RR73")<0) {
|
||||||
ui->textBrowser3->displayFoxToBeCalled(d,"#ffffff");
|
ui->textBrowser3->displayFoxToBeCalled(d,"#ffffff");
|
||||||
} else {
|
} else {
|
||||||
if(d.indexOf("RR73")<0) {
|
if(d.indexOf("RR73")<0) {
|
||||||
@ -3894,13 +3896,13 @@ void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers)
|
|||||||
if(m_config.bFox() and m_decodedText2) {
|
if(m_config.bFox() and m_decodedText2) {
|
||||||
if(m_nToBeCalled >= (m_Nslots + 10) or m_nFoxCallers==0) return;
|
if(m_nToBeCalled >= (m_Nslots + 10) or m_nFoxCallers==0) return;
|
||||||
QString t=cursor.block().text();
|
QString t=cursor.block().text();
|
||||||
QString c2=t.split(" ",QString::SkipEmptyParts).at(0);
|
QString houndCall=t.split(" ",QString::SkipEmptyParts).at(0);
|
||||||
if(ui->textBrowser3->toPlainText().indexOf(c2) >= 0) return; //Don't allow same call twice
|
if(ui->textBrowser3->toPlainText().indexOf(houndCall) >= 0) return; //Don't allow same call twice
|
||||||
if(ui->textBrowser4->toPlainText().indexOf(c2) >= 0) return; //Don't allow same call twice
|
if(ui->textBrowser4->toPlainText().indexOf(houndCall) >= 0) return; //Don't allow same call twice
|
||||||
QString g2=t.split(" ",QString::SkipEmptyParts).at(1);
|
QString houndGrid=t.split(" ",QString::SkipEmptyParts).at(1);
|
||||||
QString rpt=t.split(" ",QString::SkipEmptyParts).at(2);
|
QString rpt=t.split(" ",QString::SkipEmptyParts).at(2);
|
||||||
ui->dxCallEntry->setText(c2);
|
ui->dxCallEntry->setText(houndCall);
|
||||||
ui->dxGridEntry->setText(g2);
|
ui->dxGridEntry->setText(houndGrid);
|
||||||
genStdMsgs(rpt);
|
genStdMsgs(rpt);
|
||||||
on_txb2_clicked();
|
on_txb2_clicked();
|
||||||
m_FoxCallers=m_FoxCallers.remove(t+"\n");
|
m_FoxCallers=m_FoxCallers.remove(t+"\n");
|
||||||
@ -3909,7 +3911,7 @@ void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers)
|
|||||||
m_nToBeCalled++;
|
m_nToBeCalled++;
|
||||||
ui->decodedTextBrowser->clear();
|
ui->decodedTextBrowser->clear();
|
||||||
ui->decodedTextBrowser->append(m_FoxCallers);
|
ui->decodedTextBrowser->append(m_FoxCallers);
|
||||||
QString t1=c2 + " ";
|
QString t1=houndCall + " ";
|
||||||
QString t2=rpt;
|
QString t2=rpt;
|
||||||
if(rpt.mid(0,1) != "-") t2="+" + rpt;
|
if(rpt.mid(0,1) != "-") t2="+" + rpt;
|
||||||
if(t2.length()==2) t2=t2.mid(0,1) + "0" + t2.mid(1,1);
|
if(t2.length()==2) t2=t2.mid(0,1) + "0" + t2.mid(1,1);
|
||||||
@ -7098,7 +7100,7 @@ QString MainWindow::sortHoundCalls(QString t, int isort, int min_dB, int max_dB)
|
|||||||
{
|
{
|
||||||
QMap<QString,QString> map;
|
QMap<QString,QString> map;
|
||||||
QStringList lines,lines2;
|
QStringList lines,lines2;
|
||||||
QString msg,c2,t1;
|
QString msg,houndCall,t1;
|
||||||
QString ABC{"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
|
QString ABC{"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
|
||||||
QList<int> list;
|
QList<int> list;
|
||||||
int i,j,k,m,n,nlines;
|
int i,j,k,m,n,nlines;
|
||||||
@ -7110,8 +7112,8 @@ QString MainWindow::sortHoundCalls(QString t, int isort, int min_dB, int max_dB)
|
|||||||
nlines=lines.length()-1;
|
nlines=lines.length()-1;
|
||||||
for(i=0; i<nlines; i++) {
|
for(i=0; i<nlines; i++) {
|
||||||
msg=lines.at(i);
|
msg=lines.at(i);
|
||||||
c2=msg.split(" ").at(0); //key = callsign; value = "call grid snr freq dist age"
|
houndCall=msg.split(" ").at(0); //key = callsign; value = "call grid snr freq dist age"
|
||||||
map[c2]=msg;
|
map[houndCall]=msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
j=0;
|
j=0;
|
||||||
@ -7209,3 +7211,8 @@ void MainWindow::on_pbFoxReset_clicked()
|
|||||||
ui->textBrowser3->setText("");
|
ui->textBrowser3->setText("");
|
||||||
ui->textBrowser4->setText("");
|
ui->textBrowser4->setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_comboBoxHoundSort_activated(int index)
|
||||||
|
{
|
||||||
|
decodeDone();
|
||||||
|
}
|
||||||
|
@ -286,6 +286,7 @@ private slots:
|
|||||||
void on_sbNslots_valueChanged(int n);
|
void on_sbNslots_valueChanged(int n);
|
||||||
void on_sbMax_dB_valueChanged(int n);
|
void on_sbMax_dB_valueChanged(int n);
|
||||||
void on_pbFoxReset_clicked();
|
void on_pbFoxReset_clicked();
|
||||||
|
void on_comboBoxHoundSort_activated (int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo,
|
Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo,
|
||||||
|
@ -1049,7 +1049,7 @@ QLabel[oob="true"] {
|
|||||||
<enum>QTabWidget::Triangular</enum>
|
<enum>QTabWidget::Triangular</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
Loading…
Reference in New Issue
Block a user