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?
bool forceData = m_txFrameCountSent > 0;
Varicode::MessageInfo info;
auto frames = Varicode::buildMessageFrames(
mycall,
mygrid,
@ -6287,7 +6288,17 @@ QList<QPair<QString, int>> MainWindow::buildMessageFrames(const QString &text){
text,
forceIdentify,
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
qDebug() << "frames:";

View File

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

View File

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