Fixed issue with double printing of directed and undirected activity. Fixed enter key press with no message
This commit is contained in:
parent
e5347eb4b6
commit
08d8beed64
@ -1029,7 +1029,13 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
if(pProcessed) *pProcessed = false;
|
if(pProcessed) *pProcessed = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pProcessed) *pProcessed = true;
|
if(pProcessed) *pProcessed = true;
|
||||||
|
|
||||||
|
if(ui->extFreeTextMsgEdit->toPlainText().trimmed().isEmpty()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
toggleTx(true);
|
toggleTx(true);
|
||||||
});
|
});
|
||||||
ui->extFreeTextMsgEdit->installEventFilter(enterFilter);
|
ui->extFreeTextMsgEdit->installEventFilter(enterFilter);
|
||||||
@ -5800,8 +5806,9 @@ void MainWindow::displayTextForFreq(QString text, int freq, QDateTime date, bool
|
|||||||
int highFreq = lowFreq + 10;
|
int highFreq = lowFreq + 10;
|
||||||
|
|
||||||
int block = -1;
|
int block = -1;
|
||||||
|
|
||||||
if(m_rxFrameBlockNumbers.contains(freq)){
|
if(m_rxFrameBlockNumbers.contains(freq)){
|
||||||
block =m_rxFrameBlockNumbers[freq];
|
block = m_rxFrameBlockNumbers[freq];
|
||||||
} else if(m_rxFrameBlockNumbers.contains(lowFreq)){
|
} else if(m_rxFrameBlockNumbers.contains(lowFreq)){
|
||||||
block = m_rxFrameBlockNumbers[lowFreq];
|
block = m_rxFrameBlockNumbers[lowFreq];
|
||||||
freq = lowFreq;
|
freq = lowFreq;
|
||||||
@ -5811,7 +5818,7 @@ void MainWindow::displayTextForFreq(QString text, int freq, QDateTime date, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isNewLine){
|
if(isNewLine){
|
||||||
m_rxFrameBlockNumbers.remove(freq);
|
//m_rxFrameBlockNumbers.remove(freq);
|
||||||
m_rxFrameBlockNumbers.remove(lowFreq);
|
m_rxFrameBlockNumbers.remove(lowFreq);
|
||||||
m_rxFrameBlockNumbers.remove(highFreq);
|
m_rxFrameBlockNumbers.remove(highFreq);
|
||||||
block = -1;
|
block = -1;
|
||||||
@ -5820,7 +5827,9 @@ void MainWindow::displayTextForFreq(QString text, int freq, QDateTime date, bool
|
|||||||
block = writeMessageTextToUI(date, text, freq, isTx, block);
|
block = writeMessageTextToUI(date, text, freq, isTx, block);
|
||||||
|
|
||||||
// never cache tx or last lines
|
// never cache tx or last lines
|
||||||
if(!isTx && !isLast){
|
if(isTx || isLast) {
|
||||||
|
// pass
|
||||||
|
} else {
|
||||||
m_rxFrameBlockNumbers.insert(freq, block);
|
m_rxFrameBlockNumbers.insert(freq, block);
|
||||||
m_rxFrameBlockNumbers.insert(lowFreq, block);
|
m_rxFrameBlockNumbers.insert(lowFreq, block);
|
||||||
m_rxFrameBlockNumbers.insert(highFreq, block);
|
m_rxFrameBlockNumbers.insert(highFreq, block);
|
||||||
@ -5876,7 +5885,6 @@ int MainWindow::writeMessageTextToUI(QDateTime date, QString text, int freq, boo
|
|||||||
|
|
||||||
c.movePosition(QTextCursor::End);
|
c.movePosition(QTextCursor::End);
|
||||||
|
|
||||||
|
|
||||||
ui->textEditRX->ensureCursorVisible();
|
ui->textEditRX->ensureCursorVisible();
|
||||||
ui->textEditRX->verticalScrollBar()->setValue(ui->textEditRX->verticalScrollBar()->maximum());
|
ui->textEditRX->verticalScrollBar()->setValue(ui->textEditRX->verticalScrollBar()->maximum());
|
||||||
|
|
||||||
@ -9107,12 +9115,18 @@ void MainWindow::processCommandActivity() {
|
|||||||
// we'd be double printing here if were on frequency, so let's be "smart" about this...
|
// we'd be double printing here if were on frequency, so let's be "smart" about this...
|
||||||
bool shouldDisplay = true;
|
bool shouldDisplay = true;
|
||||||
if(shouldDisplay){
|
if(shouldDisplay){
|
||||||
if(isRecentOffset(d.freq) && ui->textEditRX->find(QString("(%1)").arg(ad.freq), QTextDocument::FindBackward)){
|
auto c = ui->textEditRX->textCursor();
|
||||||
|
c.movePosition(QTextCursor::End);
|
||||||
|
ui->textEditRX->setTextCursor(c);
|
||||||
|
|
||||||
|
if(isRecentOffset(d.freq) && ui->textEditRX->find(d.utcTimestamp.time().toString(), QTextDocument::FindBackward)){
|
||||||
// ... maybe we could delete the last line that had this message on this frequency...
|
// ... maybe we could delete the last line that had this message on this frequency...
|
||||||
auto c = ui->textEditRX->textCursor();
|
c = ui->textEditRX->textCursor();
|
||||||
c.movePosition(QTextCursor::StartOfBlock);
|
c.movePosition(QTextCursor::StartOfBlock);
|
||||||
c.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
|
c.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
|
||||||
qDebug() << "should display directed message, erasing last rx activity line..." << c.selectedText();
|
qDebug() << "should display directed message, erasing last rx activity line..." << c.selectedText();
|
||||||
|
c.deletePreviousChar();
|
||||||
|
c.deletePreviousChar();
|
||||||
c.deleteChar();
|
c.deleteChar();
|
||||||
c.deleteChar();
|
c.deleteChar();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user