Fix several color highlighting anomalies.

This commit is contained in:
Joe Taylor 2018-08-29 14:38:18 -04:00
parent 201b29993c
commit 3718f8d3aa

View File

@ -165,7 +165,6 @@ QString DisplayText::appendWorkedB4(QString message, QString const& callsign, QS
bool gridB4; bool gridB4;
bool gridB4onBand; bool gridB4onBand;
if(call.length()==2) { if(call.length()==2) {
int i0=message.indexOf("CQ "+call); int i0=message.indexOf("CQ "+call);
call=message.mid(i0+6,-1); call=message.mid(i0+6,-1);
@ -175,9 +174,14 @@ QString DisplayText::appendWorkedB4(QString message, QString const& callsign, QS
if(call.length()<3) return message; if(call.length()<3) return message;
if(!call.contains(QRegExp("[0-9]|[A-Z]"))) return message; if(!call.contains(QRegExp("[0-9]|[A-Z]"))) return message;
if(grid=="") {
gridB4=true;
gridB4onBand=true;
} else {
logBook.match(/*in*/call,grid,/*out*/countryName,callWorkedBefore,countryWorkedBefore,gridB4); logBook.match(/*in*/call,grid,/*out*/countryName,callWorkedBefore,countryWorkedBefore,gridB4);
logBook.match(/*in*/call,grid,/*out*/countryName,callB4onBand,countryB4onBand,gridB4onBand, logBook.match(/*in*/call,grid,/*out*/countryName,callB4onBand,countryB4onBand,gridB4onBand,
/*in*/ currentBand); /*in*/ currentBand);
}
message = message.trimmed (); message = message.trimmed ();
QString appendage{""}; QString appendage{""};
@ -269,11 +273,13 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
bg = m_color_CQ; bg = m_color_CQ;
} }
if(bCQonly and !CQcall) return; if(bCQonly and !CQcall) return;
if (myCall != "" and ( if (myCall != "" and (decodedText.indexOf (" " + myCall + " ") >= 0
decodedText.indexOf (" " + myCall + " ") >= 0
or decodedText.indexOf (" " + myCall + "/") >= 0 or decodedText.indexOf (" " + myCall + "/") >= 0
or decodedText.indexOf ("<" + myCall + "/") >= 0
or decodedText.indexOf ("/" + myCall + " ") >= 0 or decodedText.indexOf ("/" + myCall + " ") >= 0
or decodedText.indexOf ("/" + myCall + ">") >= 0
or decodedText.indexOf ("<" + myCall + " ") >= 0 or decodedText.indexOf ("<" + myCall + " ") >= 0
or decodedText.indexOf ("<" + myCall + ">") >= 0
or decodedText.indexOf (" " + myCall + ">") >= 0)) { or decodedText.indexOf (" " + myCall + ">") >= 0)) {
bg = m_color_MyCall; bg = m_color_MyCall;
} }
@ -367,7 +373,8 @@ namespace
} }
} }
void DisplayText::highlight_callsign (QString const& callsign, QColor const& bg, QColor const& fg, bool last_only) void DisplayText::highlight_callsign (QString const& callsign, QColor const& bg,
QColor const& fg, bool last_only)
{ {
QTextCharFormat old_format {currentCharFormat ()}; QTextCharFormat old_format {currentCharFormat ()};
QTextCursor cursor {document ()}; QTextCursor cursor {document ()};