From b89ae0459e8c11bebf4e0617713c9913590d587a Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Tue, 24 Jan 2023 01:33:57 +0000 Subject: [PATCH] Make cw textbox a combobox --- cwsender.cpp | 14 +++++--- cwsender.ui | 95 +++++++++++++++++++++++++--------------------------- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/cwsender.cpp b/cwsender.cpp index 74540c7..7d64554 100644 --- a/cwsender.cpp +++ b/cwsender.cpp @@ -63,12 +63,16 @@ void cwSender::handleCurrentModeUpdate(mode_kind mode) void cwSender::on_sendBtn_clicked() { - if( (ui->textToSendEdit->text().length() > 0) && - (ui->textToSendEdit->text().length() <= 30) ) + if( (ui->textToSendEdit->currentText().length() > 0) && + (ui->textToSendEdit->currentText().length() <= 30) ) { - emit sendCW(ui->textToSendEdit->text()); - ui->transcriptText->appendPlainText(ui->textToSendEdit->text()); - ui->textToSendEdit->clear(); + emit sendCW(ui->textToSendEdit->currentText()); + ui->transcriptText->appendPlainText(ui->textToSendEdit->currentText()); + ui->textToSendEdit->addItem(ui->textToSendEdit->currentText()); + if (ui->textToSendEdit->count() > 5) { + ui->textToSendEdit->removeItem(0); + } + ui->textToSendEdit->setCurrentIndex(-1); ui->textToSendEdit->setFocus(); ui->statusbar->showMessage("Sending CW", 3000); } diff --git a/cwsender.ui b/cwsender.ui index 8e8b531..025d824 100644 --- a/cwsender.ui +++ b/cwsender.ui @@ -18,13 +18,6 @@ - - - - WPM: - - - @@ -184,6 +177,13 @@ + + + + Break In + + + @@ -194,35 +194,54 @@ - - - - Break In + + + + <html><head/><body><p>Set the desired break-in mode:</p><p>1. None: You must manually key and unkey the radio.</p><p>2. Semi: Transmit is automatic and switches to receive at the end of the text.</p><p>3. Full: Same as semi, but with breaks between characters when possible.</p></body></html> + + + Off + + + + + Semi + + + + + Full + + - - - - 25 - 0 - + + + + 0 + 0 + - - - 400 - 16777215 - + + true - - Type the text you wish to send as CW here. + + - - 30 + + QComboBox::InsertAtTop - Type here... + Type here... + + + + + + + WPM: @@ -252,28 +271,6 @@ - - - - <html><head/><body><p>Set the desired break-in mode:</p><p>1. None: You must manually key and unkey the radio.</p><p>2. Semi: Transmit is automatic and switches to receive at the end of the text.</p><p>3. Full: Same as semi, but with breaks between characters when possible.</p></body></html> - - - - Off - - - - - Semi - - - - - Full - - - -