Remove Tab 1/2 differences from UDP interface

The UDP "Free  text" message comamnd should  not expose implementation
differences between tab one and tab two. The "send next" capability is
not available on  tab two so use  of it has been removed  from the UDP
interface.

The ability  to trigger  the immediate  (or in next  Tx period  if the
current period  is Rx) sending  of the  current free text  message has
been added to the UDP interface. This is done by sending a "Free text"
UDP message containing an empty text message with the "Send" flag set.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5725 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville
2015-07-27 11:34:11 +00:00
parent 1c41850d3d
commit 1937612685
3 changed files with 50 additions and 23 deletions
+26 -14
View File
@@ -201,22 +201,34 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme
});
connect (m_messageClient, &MessageClient::error, this, &MainWindow::networkError);
connect (m_messageClient, &MessageClient::free_text, [this] (QString const& text, bool send) {
if (m_config.accept_udp_requests ()) {
if (0 == ui->tabWidget->currentIndex ()) {
ui->tx5->setCurrentText (text);
if (send) {
ui->txb5->click ();
} else {
ui->txrb5->click ();
}
} else if (1 == ui->tabWidget->currentIndex ()) {
ui->freeTextMsg->setCurrentText (text);
if (send) {
ui->rbFreeText->click ();
if (m_config.accept_udp_requests ()) {
// send + non-empty text means set and send the free text
// message, !send + non-empty text means set the current free
// text message, send + empty text means send the current free
// text message without change, !send + empty text means clear
// the current free text message
qDebug () << "Free text UDP message - text:" << text << "send:" << send << "text empty:" << text.isEmpty ();
if (0 == ui->tabWidget->currentIndex ()) {
if (!text.isEmpty ()) {
ui->tx5->setCurrentText (text);
}
if (send) {
ui->txb5->click ();
} else if (text.isEmpty ()) {
ui->tx5->setCurrentText (text);
}
} else if (1 == ui->tabWidget->currentIndex ()) {
if (!text.isEmpty ()) {
ui->freeTextMsg->setCurrentText (text);
}
if (send) {
ui->rbFreeText->click ();
} else if (text.isEmpty ()) {
ui->freeTextMsg->setCurrentText (text);
}
}
}
}
});
});
// Hook up WSPR band hopping
connect (ui->band_hopping_schedule_push_button, &QPushButton::clicked