mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 05:38:46 -05:00
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:
parent
1c41850d3d
commit
1937612685
@ -222,7 +222,7 @@ public:
|
|||||||
Q_EMIT do_free_text (id_, text, false);
|
Q_EMIT do_free_text (id_, text, false);
|
||||||
});
|
});
|
||||||
connect (message_line_edit_, &QLineEdit::editingFinished, [this] () {
|
connect (message_line_edit_, &QLineEdit::editingFinished, [this] () {
|
||||||
Q_EMIT do_free_text (id_, message_line_edit_->text (), !message_line_edit_->text ().isEmpty ());
|
Q_EMIT do_free_text (id_, message_line_edit_->text (), true);
|
||||||
});
|
});
|
||||||
control_layout->addLayout (form_layout);
|
control_layout->addLayout (form_layout);
|
||||||
control_layout->addWidget (auto_off_button_);
|
control_layout->addWidget (auto_off_button_);
|
||||||
|
@ -199,14 +199,29 @@
|
|||||||
* Send bool
|
* Send bool
|
||||||
*
|
*
|
||||||
* This message allows the server to set the current free text
|
* This message allows the server to set the current free text
|
||||||
* message content. Sending this message is equivalent to typing
|
* message content. Sending this message with a non-empty "Text"
|
||||||
* a new message (old contents are discarded) in to the WSJT-X
|
* field is equivalent to typing a new message (old contents are
|
||||||
* free text message field or "Tx5" field (both are updated) and
|
* discarded) in to the WSJT-X free text message field or "Tx5"
|
||||||
* if the Send flag is set then clicking the "Now" radio button
|
* field (both are updated) and if the "Send" flag is set then
|
||||||
* for the "Tx5" field if tab one is current or clicking the
|
* clicking the "Now" radio button for the "Tx5" field if tab one
|
||||||
* "Free msg" radio button if tab two is current. It is the
|
* is current or clicking the "Free msg" radio button if tab two
|
||||||
* responsibility of the sender to limit the length of the
|
* is current.
|
||||||
* message text and to limit it to legal message characters.
|
*
|
||||||
|
* It is the responsibility of the sender to limit the length of
|
||||||
|
* the message text and to limit it to legal message
|
||||||
|
* characters. Despite this, it may be difficult for the sender
|
||||||
|
* to determine the maximum message length without reimplementing
|
||||||
|
* the complete message encoding protocol. Because of this is may
|
||||||
|
* be better to allow any reasonable message length and to let
|
||||||
|
* the WSJT-X application encode and possibly truncate the actual
|
||||||
|
* on-air message.
|
||||||
|
*
|
||||||
|
* If the message text is empty the meaning of the message is
|
||||||
|
* refined to send the current free text unchanged when the
|
||||||
|
* "Send" flag is set or to clear the current free text when the
|
||||||
|
* "Send" flag is unset. Note that this API does not include a
|
||||||
|
* command to determine the contents of the current free text
|
||||||
|
* message.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
|
@ -202,17 +202,29 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme
|
|||||||
connect (m_messageClient, &MessageClient::error, this, &MainWindow::networkError);
|
connect (m_messageClient, &MessageClient::error, this, &MainWindow::networkError);
|
||||||
connect (m_messageClient, &MessageClient::free_text, [this] (QString const& text, bool send) {
|
connect (m_messageClient, &MessageClient::free_text, [this] (QString const& text, bool send) {
|
||||||
if (m_config.accept_udp_requests ()) {
|
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 (0 == ui->tabWidget->currentIndex ()) {
|
||||||
|
if (!text.isEmpty ()) {
|
||||||
ui->tx5->setCurrentText (text);
|
ui->tx5->setCurrentText (text);
|
||||||
|
}
|
||||||
if (send) {
|
if (send) {
|
||||||
ui->txb5->click ();
|
ui->txb5->click ();
|
||||||
} else {
|
} else if (text.isEmpty ()) {
|
||||||
ui->txrb5->click ();
|
ui->tx5->setCurrentText (text);
|
||||||
}
|
}
|
||||||
} else if (1 == ui->tabWidget->currentIndex ()) {
|
} else if (1 == ui->tabWidget->currentIndex ()) {
|
||||||
|
if (!text.isEmpty ()) {
|
||||||
ui->freeTextMsg->setCurrentText (text);
|
ui->freeTextMsg->setCurrentText (text);
|
||||||
|
}
|
||||||
if (send) {
|
if (send) {
|
||||||
ui->rbFreeText->click ();
|
ui->rbFreeText->click ();
|
||||||
|
} else if (text.isEmpty ()) {
|
||||||
|
ui->freeTextMsg->setCurrentText (text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user