From 26f21cd70aeff1556b90727943a0bb2fcee81eec Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Mon, 3 Dec 2018 22:42:19 -0500 Subject: [PATCH] Fixed issue with repeat messages --- mainwindow.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 8b88581..51325ad 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5584,9 +5584,7 @@ bool MainWindow::ensureSelcalCallsignSelected(bool alert){ bool MainWindow::ensureKeyNotStuck(QString const& text){ // be annoying and drop messages with all the same character to reduce spam... - if(text.length() > 10 && QString(text).replace(text.at(0), "").isEmpty()){ - - MessageBox::warning_message(this, tr ("Please enter a message before trying to transmit")); + if(text.length() > 5 && QString(text).replace(text.at(0), "").trimmed().isEmpty()){ return false; } @@ -5607,6 +5605,17 @@ void MainWindow::createMessage(QString const& text){ if(!ensureKeyNotStuck(text)){ on_stopTxButton_clicked(); + + ui->monitorButton->setChecked(false); + on_monitorButton_clicked(false); + + foreach(auto obj, this->children()){ + if(obj->isWidgetType()){ + auto wid = qobject_cast(obj); + wid->setEnabled(false); + } + } + return; }