Restrict typeahead for buffered commands

This commit is contained in:
Jordan Sherer 2019-09-28 14:33:30 -04:00
parent 481b07c682
commit 3a0e5341df
3 changed files with 29 additions and 3 deletions

View File

@ -6280,6 +6280,7 @@ QList<QPair<QString, int>> MainWindow::buildMessageFrames(const QString &text){
// TODO: might want to be more explicit? // TODO: might want to be more explicit?
bool forceData = m_txFrameCountSent > 0; bool forceData = m_txFrameCountSent > 0;
Varicode::MessageInfo info;
auto frames = Varicode::buildMessageFrames( auto frames = Varicode::buildMessageFrames(
mycall, mycall,
mygrid, mygrid,
@ -6287,7 +6288,17 @@ QList<QPair<QString, int>> MainWindow::buildMessageFrames(const QString &text){
text, text,
forceIdentify, forceIdentify,
forceData, forceData,
m_nSubMode); m_nSubMode,
&info);
if(!info.dirCmd.isEmpty()){
qDebug() << "message contains cmd" << info.dirCmd;
if(Varicode::isCommandBuffered(info.dirCmd)){
// buffered commands should not allow typeahead
// TODO: jsherer - i don't like setting this here, but it works for now...
ui->extFreeTextMsgEdit->setReadOnly(true);
}
}
#if 0 #if 0
qDebug() << "frames:"; qDebug() << "frames:";

View File

@ -1829,7 +1829,8 @@ QList<QPair<QString, int>> Varicode::buildMessageFrames(QString const& mycall,
QString const& text, QString const& text,
bool forceIdentify, bool forceIdentify,
bool forceData, bool forceData,
int submode){ int submode,
MessageInfo *pInfo){
#define ALLOW_SEND_COMPOUND 1 #define ALLOW_SEND_COMPOUND 1
#define ALLOW_SEND_COMPOUND_DIRECTED 1 #define ALLOW_SEND_COMPOUND_DIRECTED 1
#define AUTO_PREPEND_DIRECTED 1 #define AUTO_PREPEND_DIRECTED 1
@ -2061,6 +2062,12 @@ QList<QPair<QString, int>> Varicode::buildMessageFrames(QString const& mycall,
} }
qDebug() << "after:" << line; qDebug() << "after:" << line;
} }
if(pInfo){
pInfo->dirCmd = dirCmd;
pInfo->dirTo = dirTo;
pInfo->dirNum = dirNum;
}
} }
if(useDat){ if(useDat){

View File

@ -16,6 +16,13 @@
class Varicode class Varicode
{ {
public: public:
// extra information out of buildMessageFrames
struct MessageInfo {
QString dirTo;
QString dirCmd;
QString dirNum;
};
// submode types // submode types
enum SubmodeType { enum SubmodeType {
JS8CallNormal = 0, JS8CallNormal = 0,
@ -174,7 +181,8 @@ public:
QString const& text, QString const& text,
bool forceIdentify, bool forceIdentify,
bool forceData, bool forceData,
int submode); int submode,
MessageInfo *pInfo=nullptr);
}; };