Working through a keyboard to keyboard chat window
This commit is contained in:
parent
678c1d3966
commit
a4fa5b9988
@ -2836,6 +2836,8 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
if(!b65 and m_modeTx=="JT65") on_pbTxMode_clicked();
|
||||
}
|
||||
m_QSOText = decodedtext.string ().trimmed ();
|
||||
|
||||
ui->textEditRX->insertHtml(decodedtext.messageWords().first().trimmed() + " ");
|
||||
}
|
||||
if(m_mode=="FT8" or m_mode=="QRA64") auto_sequence (decodedtext, 25, 50);
|
||||
|
||||
@ -3520,8 +3522,9 @@ void MainWindow::stopTx()
|
||||
//1. check to see if there are more messages to send
|
||||
//2. if there are, fixup next message and continue transmitting
|
||||
//3. if not, allow the transmission to stop
|
||||
QString txt = ui->extFreeTextMsg->toPlainText().trimmed();
|
||||
int sz = txt.size();
|
||||
// TODO: refactor this to "count remaining"
|
||||
QString txt = ui->extFreeTextMsg->toPlainText();
|
||||
int sz = countFreeTextMsgs(txt.trimmed().mid(m_extFreeTxtPos).trimmed());
|
||||
if(sz > 0){
|
||||
splitNextFreeTextMsg();
|
||||
ui->txFirstCheckBox->setChecked(!m_txFirst);
|
||||
@ -3530,6 +3533,8 @@ void MainWindow::stopTx()
|
||||
ui->autoButton->click();
|
||||
}
|
||||
ui->nextFreeTextMsg->clear();
|
||||
ui->extFreeTextMsg->clear();
|
||||
m_extFreeTxtPos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4630,7 +4635,7 @@ void MainWindow::on_extFreeTextMsg_currentTextChanged (QString const& text)
|
||||
ui->extFreeTextMsg->setTextCursor(c);
|
||||
}
|
||||
|
||||
int count = countFreeTextMsgs(x);
|
||||
int count = countFreeTextMsgs(x.trimmed().mid(m_extFreeTxtPos).trimmed());
|
||||
ui->lblTxNum->setText(QString("Remaining Tx Sequences: %1").arg(count));
|
||||
}
|
||||
|
||||
@ -4671,12 +4676,24 @@ int MainWindow::countFreeTextMsgs(QString input){
|
||||
|
||||
void MainWindow::splitNextFreeTextMsg()
|
||||
{
|
||||
QString txt = ui->extFreeTextMsg->toPlainText().trimmed();
|
||||
QString txt = ui->extFreeTextMsg->toPlainText().trimmed().mid(m_extFreeTxtPos).trimmed();
|
||||
|
||||
QString nextTxt = parseFT8Message(txt);
|
||||
ui->nextFreeTextMsg->setText(nextTxt);
|
||||
QRegExp n = QRegExp("^" + QRegExp::escape(nextTxt));
|
||||
ui->extFreeTextMsg->setPlainText(txt.remove(n).trimmed());
|
||||
|
||||
//ui->extFreeTextMsg->setPlainText(txt.remove(n).trimmed());
|
||||
|
||||
if(txt.contains(n)){
|
||||
QTextCursor tc = ui->extFreeTextMsg->textCursor();
|
||||
tc.setPosition(0);
|
||||
m_extFreeTxtPos += n.matchedLength();
|
||||
tc.setPosition(m_extFreeTxtPos, QTextCursor::KeepAnchor);
|
||||
QTextCharFormat cf = tc.charFormat();
|
||||
cf.setFontStrikeOut(true);
|
||||
tc.mergeCharFormat(cf);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_dxCallEntry_textChanged (QString const& call)
|
||||
|
@ -481,6 +481,7 @@ private:
|
||||
}
|
||||
m_QSOProgress;
|
||||
|
||||
int m_extFreeTxtPos;
|
||||
int m_ihsym;
|
||||
int m_nzap;
|
||||
int m_npts8;
|
||||
|
183
mainwindow.ui
183
mainwindow.ui
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>815</width>
|
||||
<height>555</height>
|
||||
<width>1026</width>
|
||||
<height>605</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -19,7 +19,21 @@
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0">
|
||||
<widget class="QTabWidget" name="mainTabWidget">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::North</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mainTabOne">
|
||||
<attribute name="title">
|
||||
<string>Main</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="2,1">
|
||||
<property name="horizontalSpacing">
|
||||
@ -1644,7 +1658,7 @@ list. The list can be maintained in Settings (F2).</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="extFreeTextMsg">
|
||||
<widget class="QTextEdit" name="extFreeTextMsg_old">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
@ -1660,14 +1674,14 @@ list. The list can be maintained in Settings (F2).</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblTxNum">
|
||||
<widget class="QLabel" name="lblTxNum_old">
|
||||
<property name="text">
|
||||
<string>Remaining Tx Sequences: 0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbNextFreeTextMsg">
|
||||
<widget class="QPushButton" name="pbNextFreeTextMsg_old">
|
||||
<property name="text">
|
||||
<string>Next</string>
|
||||
</property>
|
||||
@ -2368,6 +2382,159 @@ QPushButton[state="ok"] {
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="mainTabTwo">
|
||||
<attribute name="title">
|
||||
<string>Free Text</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEditRX">
|
||||
<property name="font">
|
||||
<font>
|
||||
<italic>true</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTextEdit { background:rgb(255, 250, 205); }</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Messages from your receive frequency will appear here.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="extFreeTextMsg">
|
||||
<property name="acceptRichText">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Your message, if longer than 13 characters, will be split into separate free text transmissions. At the start of each tx cycle, the next chunk of the message will be removed from this textbox for transmission.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_6">
|
||||
<property name="text">
|
||||
<string>CQ</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_5">
|
||||
<property name="text">
|
||||
<string>Your Call</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_8">
|
||||
<property name="text">
|
||||
<string>Their Call</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="text">
|
||||
<string>Macro 1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="text">
|
||||
<string>Macro 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Macro 3</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Macro 4</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbNextFreeTextMsg">
|
||||
<property name="text">
|
||||
<string>Send Next</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_7">
|
||||
<property name="text">
|
||||
<string>Halt</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblTxNum">
|
||||
<property name="text">
|
||||
<string>Remaining Tx Sequences: 0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -2376,8 +2543,8 @@ QPushButton[state="ok"] {
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>815</width>
|
||||
<height>21</height>
|
||||
<width>1026</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user