diff --git a/mainwindow.cpp b/mainwindow.cpp index 40edbd5c2..c2fd73794 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -121,6 +121,10 @@ MainWindow::MainWindow(QWidget *parent) : ptt1Timer->setSingleShot(true); connect(ptt1Timer, SIGNAL(timeout()), this, SLOT(startTx2())); + logQSOTimer = new QTimer(this); + logQSOTimer->setSingleShot(true); + connect(logQSOTimer, SIGNAL(timeout()), this, SLOT(on_logQSOButton_clicked())); + m_auto=false; m_waterfallAvg = 1; m_txFirst=false; @@ -155,6 +159,7 @@ MainWindow::MainWindow(QWidget *parent) : m_COMportOpen=0; m_secID=0; m_promptToLog=false; + m_blankLine=false; decodeBusy(false); ui->xThermo->setFillBrush(Qt::green); @@ -1157,6 +1162,7 @@ void MainWindow::readFromStdout() //readFromStdout decodeBusy(false); m_RxLog=0; m_startAnother=m_loopall; + m_blankLine=true; return; } else { @@ -1172,17 +1178,30 @@ void MainWindow::readFromStdout() //readFromStdout out << t.mid(0,n-2) << endl; f.close(); + QTextCursor cursor; + QTextBlockFormat bf; + if(m_blankLine) { + QString bg="#9fb6cd"; + bf.setBackground(QBrush(QColor(bg))); + QString s = "
" + " " + "
"; + cursor = ui->decodedTextBrowser->textCursor(); + cursor.movePosition(QTextCursor::End); + bf = cursor.blockFormat(); + bf.setBackground(QBrush(QColor(bg))); + cursor.insertHtml(s); + m_blankLine=false; + } + QString bg="white"; if(t.indexOf(" CQ ")>0) bg="#66ff66"; //Light green if(m_myCall!="" and t.indexOf(" "+m_myCall+" ")>0) bg="#ff6666"; //Light red - //ui->decodedTextBrowser->setTextBackgroundColor(bg); - //t=t.mid(0,n-2) + " "; - //ui->decodedTextBrowser->append(t); - QString s = "
" + t.replace("\n","") + "
"; - QTextCursor cursor = ui->decodedTextBrowser->textCursor(); + QString s = "
" + t.replace("\n","") + "
"; + cursor = ui->decodedTextBrowser->textCursor(); cursor.movePosition(QTextCursor::End); - QTextBlockFormat bf = cursor.blockFormat(); + bf = cursor.blockFormat(); bf.setBackground(QBrush(QColor(bg))); cursor.insertHtml(s); ui->decodedTextBrowser->setTextCursor(cursor); @@ -1353,7 +1372,8 @@ void MainWindow::guiUpdate() icw[0]=0; if(m_After73 and (t=="73" or itext!=0)) { icw[0]=m_ncw; - if(m_promptToLog) on_logQSOButton_clicked(); +// if(m_promptToLog) on_logQSOButton_clicked(); + if(m_promptToLog) logQSOTimer->start(200); } if(m_idInt>0) { @@ -1485,7 +1505,7 @@ void MainWindow::guiUpdate() } iptt0=m_iptt; btxok0=btxok; -} +} //End of GUIupdate QString MainWindow::rig_command() { diff --git a/mainwindow.h b/mainwindow.h index d8ceaedea..ebeee8584 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -211,6 +211,7 @@ private: bool m_catEnabled; bool m_After73; bool m_promptToLog; + bool m_blankLine; char m_decoded[80]; @@ -237,8 +238,9 @@ private: QProcess proc_jt9; QProcess p3; - QTimer* ptt0Timer; - QTimer* ptt1Timer; + QTimer* ptt1Timer; //StartTx delay + QTimer* ptt0Timer; //StopTx delay + QTimer* logQSOTimer; QString m_path; QString m_pbdecoding_style1; diff --git a/mainwindow.ui b/mainwindow.ui index 6db110f9c..54fb424f6 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -911,7 +911,7 @@ p, li { white-space: pre-wrap; } - Tx first + Tx even @@ -1717,7 +1717,6 @@ p, li { white-space: pre-wrap; } -