From 5c28d154ff3e3bc3e6cb463e222c9c7cb07070bf Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Fri, 26 Oct 2018 22:16:48 -0400 Subject: [PATCH] Added autoprepend back in --- mainwindow.cpp | 8 ++++---- varicode.cpp | 15 ++++++--------- varicode.h | 6 +++--- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 1a64e17..1846dc6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5352,7 +5352,7 @@ int MainWindow::currentFreqOffset(){ QStringList MainWindow::buildMessageFrames(const QString &text){ // prepare selected callsign for directed message - //QString selectedCall = callsignSelected(); + QString selectedCall = callsignSelected(); // prepare compound //bool compound = Varicode::isCompoundCallsign(/*Radio::is_compound_callsign(*/m_config.my_callsign()); @@ -5368,7 +5368,7 @@ QStringList MainWindow::buildMessageFrames(const QString &text){ //basecall, mygrid, //compound, - //selectedCall, + selectedCall, text); #if 0 @@ -7906,7 +7906,7 @@ void MainWindow::refreshTextDisplay(){ #else // prepare selected callsign for directed message - //QString selectedCall = callsignSelected(); + QString selectedCall = callsignSelected(); //qDebug() << "selected callsign for directed" << selectedCall; // prepare compound @@ -7923,7 +7923,7 @@ void MainWindow::refreshTextDisplay(){ //basecall, mygrid, //compound, - //selectedCall, + selectedCall, text ); diff --git a/varicode.cpp b/varicode.cpp index d994aeb..4ff97f2 100644 --- a/varicode.cpp +++ b/varicode.cpp @@ -1606,13 +1606,13 @@ QStringList Varicode::buildMessageFrames( //QString const& basecall, QString const& mygrid, //bool compound, - //QString const& selectedCall, + QString const& selectedCall, QString const& text ){ #define ALLOW_SEND_COMPOUND 1 #define ALLOW_SEND_COMPOUND_DIRECTED 1 - #define AUTO_PREPEND_DIRECTED 0 - #define AUTO_REMOVE_MYCALL 0 + #define AUTO_PREPEND_DIRECTED 1 + #define AUTO_REMOVE_MYCALL 1 bool mycallCompound = Varicode::isCompoundCallsign(mycall); @@ -1630,9 +1630,6 @@ QStringList Varicode::buildMessageFrames( if(line.startsWith(mycall + ":") || line.startsWith(mycall + " ")){ line = lstrip(line.mid(mycall.length() + 1)); } - if(line.startsWith(basecall + ":") || line.startsWith(basecall + " ")){ - line = lstrip(line.mid(basecall.length() + 1)); - } // remove trailing whitespace as long as there are characters left afterwards auto rline = rstrip(line); @@ -1828,14 +1825,14 @@ BuildMessageFramesThread::BuildMessageFramesThread( //const QString &basecall, const QString &mygrid, //bool compound, - //const QString &selectedCall, + const QString &selectedCall, const QString &text, QObject *parent): QThread(parent), m_mycall{mycall}, //m_basecall{basecall}, m_mygrid{mygrid}, //m_compound{compound}, - //m_selectedCall{selectedCall}, + m_selectedCall{selectedCall}, m_text{text} { } @@ -1846,7 +1843,7 @@ void BuildMessageFramesThread::run(){ //m_basecall, m_mygrid, //m_compound, - //m_selectedCall, + m_selectedCall, m_text ); diff --git a/varicode.h b/varicode.h index 8e2fd95..e4e7142 100644 --- a/varicode.h +++ b/varicode.h @@ -152,7 +152,7 @@ public: //QString const& basecall, QString const& mygrid, //bool compound, - //QString const& selectedCall, + QString const& selectedCall, QString const& text ); }; @@ -166,7 +166,7 @@ public: //QString const& basecall, QString const& mygrid, //bool compound, - //QString const& selectedCall, + QString const& selectedCall, QString const& text, QObject *parent=nullptr); void run() override; @@ -178,7 +178,7 @@ private: //QString m_basecall; QString m_mygrid; //bool m_compound; - //QString m_selectedCall; + QString m_selectedCall; QString m_text; };