diff --git a/Audio/tools/record_time_signal.cpp b/Audio/tools/record_time_signal.cpp index a54c78c65..985fb00b4 100644 --- a/Audio/tools/record_time_signal.cpp +++ b/Audio/tools/record_time_signal.cpp @@ -3,8 +3,7 @@ #include #include #include - -#include +#include #include #include @@ -239,11 +238,9 @@ int main(int argc, char *argv[]) QCoreApplication app {argc, argv}; try { - ::setlocale (LC_NUMERIC, "C"); // ensure number forms are in - // consistent format, do this - // after instantiating - // QApplication so that Qt has - // correct l18n + // ensure number forms are in consistent format, do this after + // instantiating QApplication so that Qt has correct l18n + std::locale::global (std::locale::classic ()); // Override programs executable basename as application name. app.setApplicationName ("WSJT-X Record Time Signal"); diff --git a/UDPExamples/MessageAggregator.cpp b/UDPExamples/MessageAggregator.cpp index 52124045e..f44c036b8 100644 --- a/UDPExamples/MessageAggregator.cpp +++ b/UDPExamples/MessageAggregator.cpp @@ -31,7 +31,7 @@ // menu that allows each dock window to be hidden or revealed. // -#include +#include #include #include @@ -52,10 +52,9 @@ int main (int argc, char * argv[]) QApplication app {argc, argv}; try { - setlocale (LC_NUMERIC, "C"); // ensure number forms are in - // consistent format, do this after - // instantiating QApplication so - // that GUI has correct l18n + // ensure number forms are in consistent format, do this after + // instantiating QApplication so that GUI has correct l18n + std::locale::global (std::locale::classic ()); app.setApplicationName ("WSJT-X Reference UDP Message Aggregator Server"); app.setApplicationVersion ("1.0"); diff --git a/UDPExamples/UDPDaemon.cpp b/UDPExamples/UDPDaemon.cpp index 1d3a7abef..4dc04af86 100644 --- a/UDPExamples/UDPDaemon.cpp +++ b/UDPExamples/UDPDaemon.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -263,10 +264,9 @@ int main (int argc, char * argv[]) QCoreApplication app {argc, argv}; try { - setlocale (LC_NUMERIC, "C"); // ensure number forms are in - // consistent format, do this after - // instantiating QApplication so - // that GUI has correct l18n + // ensure number forms are in consistent format, do this after + // instantiating QApplication so that GUI has correct l18n + std::locale::global (std::locale::classic ()); app.setApplicationName ("WSJT-X UDP Message Server Daemon"); app.setApplicationVersion ("1.0"); diff --git a/main.cpp b/main.cpp index 2db250b33..e4d14b676 100644 --- a/main.cpp +++ b/main.cpp @@ -130,12 +130,8 @@ int main(int argc, char *argv[]) QLocale locale; // get the current system locale - // Set C/C++ locale used for logging etc. -#if defined (Q_OS_WIN) - std::locale::global (std::locale ("C")); -#else - std::locale::global (std::locale ("en_US.UTF-8")); -#endif + // reset the C+ & C global locales to the classic C locale + std::locale::global (std::locale::classic ()); // Override programs executable basename as application name. a.setApplicationName ("WSJT-X"); diff --git a/translations/wsjtx_da.ts b/translations/wsjtx_da.ts index 97ece7461..b14c7ad80 100644 --- a/translations/wsjtx_da.ts +++ b/translations/wsjtx_da.ts @@ -2285,12 +2285,12 @@ Fejl(%2): %3 Quick-Start Guide to Q65 - + Quick Start Guide for Q65 Auto Clear Avg after decode - + Auto Slet Avg efter Dekodning @@ -2992,7 +2992,7 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Q65 - + Q65 @@ -4107,7 +4107,9 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2021 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; and other members of the WSJT Development Group." - + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2021 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; and other members of the WSJT Development Group." If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: @@ -5290,7 +5292,7 @@ Fejl(%2): %3 Q65_Sync - + Q65_Sync diff --git a/translations/wsjtx_es.ts b/translations/wsjtx_es.ts index c078e4a11..ed537eb7e 100644 --- a/translations/wsjtx_es.ts +++ b/translations/wsjtx_es.ts @@ -2480,12 +2480,12 @@ Error(%2): %3 Quick-Start Guide to Q65 - + Guía de inicio rápido de Q65 Auto Clear Avg after decode - + Auto Clear Avg después de decodificar @@ -2610,7 +2610,7 @@ Error(%2): %3 Q65 - + Q65 @@ -4442,7 +4442,9 @@ Error al cargar datos de usuarios de LotW If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2021 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; and other members of the WSJT Development Group." - + Si hace un uso legítimo de cualquier parte del programa WSJT-X según los términos de la Licencia Pública General GNU, debe mostrar el siguiente aviso de derechos de autor en un lugar destacado en su trabajo derivado: + +"Los algoritmos, código fuente, apariencia de WSJT-X y programas relacionados, y especificaciones de protocolo para los modos FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 son Copyright (C) 2001-2021 por uno o más de los siguientes autores: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; y otros miembros del Grupo de Desarrollo WSJT ". If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: @@ -5698,7 +5700,7 @@ Error(%2): %3 Q65_Sync - + Q65_Sync diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index 2d916efd2..33a6a4e3b 100644 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -413,17 +413,19 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con else { if (bCQonly) return; - if (myCall != "" && (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)) { - highlight_types types {Highlight::MyCall}; - set_colours (m_config, &bg, &fg, types); - } + if (myCall.size ()) + { + QString regexp {"[ <]" + myCall + "[ >]"}; + if (Radio::is_compound_callsign (myCall)) + { + regexp = "(?:" + regexp + "|[ <]" + Radio::base_callsign (myCall) + "[ >])"; + } + if ((decodedText.clean_string () + " ").contains (QRegularExpression {regexp})) + { + highlight_types types {Highlight::MyCall}; + set_colours (m_config, &bg, &fg, types); + } + } } auto message = decodedText.string(); QString dxCall; diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index bc26f362e..942729137 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1493,8 +1493,8 @@ void MainWindow::dataSink(qint64 frames) freqcal_(&dec_data.d2[0],&k,&nkhz,&RxFreq,&ftol,&line[0],80); QString t=QString::fromLatin1(line); DecodedText decodedtext {t}; - ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_mode,m_config.DXCC(), - m_logBook,m_currentBand, m_config.ppfx()); + ui->decodedTextBrowser->displayDecodedText (decodedtext, m_config.my_callsign (), m_mode, m_config.DXCC (), + m_logBook, m_currentBand, m_config.ppfx ()); if (ui->measure_check_box->isChecked ()) { // Append results text to file "fmt.all". QFile f {m_config.writeable_data_dir ().absoluteFilePath ("fmt.all")}; @@ -1748,8 +1748,8 @@ void MainWindow::fastSink(qint64 frames) if(bmsk144 and (line[0]!=0)) { QString message {QString::fromLatin1 (line)}; DecodedText decodedtext {message.replace (QChar::LineFeed, "")}; - ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_mode,m_config.DXCC(), - m_logBook,m_currentBand,m_config.ppfx()); + ui->decodedTextBrowser->displayDecodedText (decodedtext, m_config.my_callsign (), m_mode, m_config.DXCC(), + m_logBook, m_currentBand, m_config.ppfx ()); m_bDecoded=true; auto_sequence (decodedtext, ui->sbFtol->value (), std::numeric_limits::max ()); postDecode (true, decodedtext.string ()); @@ -3253,8 +3253,8 @@ void::MainWindow::fast_decode_done() //Left (Band activity) window DecodedText decodedtext {message.replace (QChar::LineFeed, "")}; if(!m_bFastDone) { - ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_mode,m_config.DXCC(), - m_logBook,m_currentBand,m_config.ppfx()); + ui->decodedTextBrowser->displayDecodedText (decodedtext, m_config.my_callsign (), m_mode, m_config.DXCC (), + m_logBook, m_currentBand, m_config.ppfx ()); } t=message.mid(10,5).toFloat(); @@ -3460,16 +3460,16 @@ void MainWindow::readFromStdout() //readFromStdout if(!m_bDisplayedOnce) { // This hack sets the font. Surely there's a better way! DecodedText dt{"."}; - ui->decodedTextBrowser->displayDecodedText(dt,m_baseCall,m_mode,m_config.DXCC(), - m_logBook,m_currentBand,m_config.ppfx()); + ui->decodedTextBrowser->displayDecodedText (dt, m_config.my_callsign (), m_mode, m_config.DXCC (), + m_logBook, m_currentBand, m_config.ppfx ()); m_bDisplayedOnce=true; } } else { DecodedText decodedtext1=decodedtext0; - ui->decodedTextBrowser->displayDecodedText(decodedtext1,m_baseCall,m_mode,m_config.DXCC(), - m_logBook,m_currentBand,m_config.ppfx(), - ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(), - haveFSpread, fSpread); + ui->decodedTextBrowser->displayDecodedText (decodedtext1, m_config.my_callsign (), m_mode, m_config.DXCC (), + m_logBook, m_currentBand, m_config.ppfx (), + ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(), + haveFSpread, fSpread); if(m_bBestSPArmed && m_mode=="FT4" && CALLING == m_QSOProgress) { QString messagePriority=ui->decodedTextBrowser->CQPriority(); @@ -3498,7 +3498,6 @@ void MainWindow::readFromStdout() //readFromStdout bool bDisplayRight=bAvgMsg; int audioFreq=decodedtext.frequencyOffset(); if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4" or m_mode=="Q65") { -// if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4") { int ftol=10; if(m_mode=="Q65") ftol=ui->sbFtol->value(); auto const& parts = decodedtext.string().remove("<").remove(">") @@ -3506,7 +3505,23 @@ void MainWindow::readFromStdout() //readFromStdout if (parts.size() > 6) { auto for_us = parts[5].contains (m_baseCall) || ("DE" == parts[5] && qAbs (ui->RxFreqSpinBox->value () - audioFreq) <= ftol); - if(m_baseCall==m_config.my_callsign() and m_baseCall!=parts[5]) for_us=false; + if(m_baseCall == m_config.my_callsign()) + { + if (m_baseCall != parts[5]) + { + for_us=false; + } + } + else + { + if (m_config.my_callsign () != parts[5]) + { + for_us = false; // same base call as ours but + // different prefix or suffix, rare + // but can happen with multi station + // special events + } + } if(m_bCallingCQ && !m_bAutoReply && for_us && ui->cbFirst->isChecked() and SpecOp::FOX > m_config.special_op_id()) { m_bDoubleClicked=true; @@ -3527,8 +3542,8 @@ void MainWindow::readFromStdout() //readFromStdout // This msg is within 10 hertz of our tuned frequency, or a JT4 or JT65 avg, // or contains MyCall if(!m_bBestSPArmed or m_mode!="FT4") { - ui->decodedTextBrowser2->displayDecodedText(decodedtext0,m_baseCall,m_mode,m_config.DXCC(), - m_logBook,m_currentBand,m_config.ppfx()); + ui->decodedTextBrowser2->displayDecodedText (decodedtext0, m_config.my_callsign (), m_mode, m_config.DXCC (), + m_logBook, m_currentBand, m_config.ppfx ()); } m_QSOText = decodedtext.string ().trimmed (); } @@ -5194,8 +5209,8 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie QString s2 = message.clean_string ().trimmed(); if (s1!=s2 and !message.isTX()) { if (!s2.contains(m_baseCall) or m_mode=="MSK144") { // Taken care of elsewhere if for_us and slow mode - ui->decodedTextBrowser2->displayDecodedText(message, m_baseCall,m_mode,m_config.DXCC(), - m_logBook,m_currentBand,m_config.ppfx()); + ui->decodedTextBrowser2->displayDecodedText (message, m_config.my_callsign (), m_mode, m_config.DXCC (), + m_logBook, m_currentBand, m_config.ppfx ()); } m_QSOText = s2; }