Make cw textbox a combobox

half-duplex
Phil Taylor 2023-01-24 01:33:57 +00:00
rodzic 525f984f01
commit b89ae0459e
2 zmienionych plików z 55 dodań i 54 usunięć

Wyświetl plik

@ -63,12 +63,16 @@ void cwSender::handleCurrentModeUpdate(mode_kind mode)
void cwSender::on_sendBtn_clicked() void cwSender::on_sendBtn_clicked()
{ {
if( (ui->textToSendEdit->text().length() > 0) && if( (ui->textToSendEdit->currentText().length() > 0) &&
(ui->textToSendEdit->text().length() <= 30) ) (ui->textToSendEdit->currentText().length() <= 30) )
{ {
emit sendCW(ui->textToSendEdit->text()); emit sendCW(ui->textToSendEdit->currentText());
ui->transcriptText->appendPlainText(ui->textToSendEdit->text()); ui->transcriptText->appendPlainText(ui->textToSendEdit->currentText());
ui->textToSendEdit->clear(); ui->textToSendEdit->addItem(ui->textToSendEdit->currentText());
if (ui->textToSendEdit->count() > 5) {
ui->textToSendEdit->removeItem(0);
}
ui->textToSendEdit->setCurrentIndex(-1);
ui->textToSendEdit->setFocus(); ui->textToSendEdit->setFocus();
ui->statusbar->showMessage("Sending CW", 3000); ui->statusbar->showMessage("Sending CW", 3000);
} }

Wyświetl plik

@ -18,13 +18,6 @@
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="1" column="5">
<widget class="QLabel" name="label">
<property name="text">
<string>WPM:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="8"> <item row="0" column="0" colspan="8">
<widget class="QPlainTextEdit" name="transcriptText"> <widget class="QPlainTextEdit" name="transcriptText">
<property name="focusPolicy"> <property name="focusPolicy">
@ -184,6 +177,13 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="3">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Break In</string>
</property>
</widget>
</item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QPushButton" name="stopBtn"> <widget class="QPushButton" name="stopBtn">
<property name="toolTip"> <property name="toolTip">
@ -194,35 +194,54 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3"> <item row="1" column="4">
<widget class="QLabel" name="label_2"> <widget class="QComboBox" name="breakinCombo">
<property name="text"> <property name="toolTip">
<string>Break In</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the desired break-in mode:&lt;/p&gt;&lt;p&gt;1. None: You must manually key and unkey the radio.&lt;/p&gt;&lt;p&gt;2. Semi: Transmit is automatic and switches to receive at the end of the text.&lt;/p&gt;&lt;p&gt;3. Full: Same as semi, but with breaks between characters when possible.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<item>
<property name="text">
<string>Off</string>
</property>
</item>
<item>
<property name="text">
<string>Semi</string>
</property>
</item>
<item>
<property name="text">
<string>Full</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QLineEdit" name="textToSendEdit"> <widget class="QComboBox" name="textToSendEdit">
<property name="minimumSize"> <property name="sizePolicy">
<size> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<width>25</width> <horstretch>0</horstretch>
<height>0</height> <verstretch>0</verstretch>
</size> </sizepolicy>
</property> </property>
<property name="maximumSize"> <property name="editable">
<size> <bool>true</bool>
<width>400</width>
<height>16777215</height>
</size>
</property> </property>
<property name="toolTip"> <property name="currentText">
<string>Type the text you wish to send as CW here.</string> <string notr="true"/>
</property> </property>
<property name="maxLength"> <property name="insertPolicy">
<number>30</number> <enum>QComboBox::InsertAtTop</enum>
</property> </property>
<property name="placeholderText"> <property name="placeholderText">
<string>Type here...</string> <string notr="true">Type here...</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QLabel" name="label">
<property name="text">
<string>WPM:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -252,28 +271,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4">
<widget class="QComboBox" name="breakinCombo">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the desired break-in mode:&lt;/p&gt;&lt;p&gt;1. None: You must manually key and unkey the radio.&lt;/p&gt;&lt;p&gt;2. Semi: Transmit is automatic and switches to receive at the end of the text.&lt;/p&gt;&lt;p&gt;3. Full: Same as semi, but with breaks between characters when possible.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Off</string>
</property>
</item>
<item>
<property name="text">
<string>Semi</string>
</property>
</item>
<item>
<property name="text">
<string>Full</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>