From 56d49f985f9be5cf73517afb61d7f3c9818e2b9e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 8 Apr 2013 01:50:49 +0000 Subject: [PATCH] Offer two sets of controls for entering and selecting Tx messages: 1. The "WSJT Traditional" setof six line-edit fields, radio buttons, and Tx# buttons; 2. New configuration with buttons that generate each message for the standard minimum QSO, one at a time. NB: the logic for these buttons is not yet complete. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3134 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 91 ++- mainwindow.h | 21 + mainwindow.ui | 1762 ++++++++++++++++++++++++++---------------------- 3 files changed, 1059 insertions(+), 815 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 9953984a9..fa40ec882 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -113,6 +113,10 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->tx5, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showMacros(const QPoint&))); + ui->freeTextMsg->setContextMenuPolicy(Qt::CustomContextMenu); + connect(ui->freeTextMsg, SIGNAL(customContextMenuRequested(const QPoint&)), + this, SLOT(showMacros(const QPoint&))); + QTimer *guiTimer = new QTimer(this); connect(guiTimer, SIGNAL(timeout()), this, SLOT(guiUpdate())); guiTimer->start(100); //Don't change the 100 ms! @@ -1349,6 +1353,8 @@ void MainWindow::guiUpdate() if(m_ntx == 4) ba=ui->tx4->text().toLocal8Bit(); if(m_ntx == 5) ba=ui->tx5->text().toLocal8Bit(); if(m_ntx == 6) ba=ui->tx6->text().toLocal8Bit(); + if(m_ntx == 7) ba=ui->genMsg->text().toLocal8Bit(); + if(m_ntx == 8) ba=ui->freeTextMsg->text().toLocal8Bit(); ba2msg(ba,message); // ba2msg(ba,msgsent); @@ -1700,9 +1706,17 @@ void MainWindow::doubleClickOnCall(bool shift, bool ctrl) if(t2.indexOf(m_myCall)>0) { m_ntx=2; ui->txrb2->setChecked(true); + if(ui->tabWidget->currentIndex()==1) { + ui->genMsg->setText(ui->tx2->text()); + m_ntx=7; + } } else { m_ntx=1; ui->txrb1->setChecked(true); + if(ui->tabWidget->currentIndex()==1) { + ui->genMsg->setText(ui->tx1->text()); + m_ntx=7; + } } } @@ -1734,6 +1748,7 @@ void MainWindow::genStdMsgs(QString rpt) //genStdMsgs() msgtype(t, ui->tx6); m_ntx=1; ui->txrb1->setChecked(true); + m_rpt=rpt; } void MainWindow::lookup() //lookup() @@ -2215,17 +2230,18 @@ void MainWindow::showMacros(const QPoint &pos) popupMenu.exec(globalPos); } -void MainWindow::onPopup1() { ui->tx5->setText(m_macro[0]); } -void MainWindow::onPopup2() { ui->tx5->setText(m_macro[1]); } -void MainWindow::onPopup3() { ui->tx5->setText(m_macro[2]); } -void MainWindow::onPopup4() { ui->tx5->setText(m_macro[3]); } -void MainWindow::onPopup5() { ui->tx5->setText(m_macro[4]); } -void MainWindow::onPopup6() { ui->tx5->setText(m_macro[5]); } -void MainWindow::onPopup7() { ui->tx5->setText(m_macro[6]); } -void MainWindow::onPopup8() { ui->tx5->setText(m_macro[7]); } -void MainWindow::onPopup9() { ui->tx5->setText(m_macro[8]); } -void MainWindow::onPopup10() { ui->tx5->setText(m_macro[9]); } +void MainWindow::onPopup1() { ui->tx5->setText(m_macro[0]); freeText(); } +void MainWindow::onPopup2() { ui->tx5->setText(m_macro[1]); freeText(); } +void MainWindow::onPopup3() { ui->tx5->setText(m_macro[2]); freeText(); } +void MainWindow::onPopup4() { ui->tx5->setText(m_macro[3]); freeText(); } +void MainWindow::onPopup5() { ui->tx5->setText(m_macro[4]); freeText(); } +void MainWindow::onPopup6() { ui->tx5->setText(m_macro[5]); freeText(); } +void MainWindow::onPopup7() { ui->tx5->setText(m_macro[6]); freeText(); } +void MainWindow::onPopup8() { ui->tx5->setText(m_macro[7]); freeText(); } +void MainWindow::onPopup9() { ui->tx5->setText(m_macro[8]); freeText(); } +void MainWindow::onPopup10() { ui->tx5->setText(m_macro[9]); freeText(); } +void MainWindow::freeText() { ui->freeTextMsg->setText(ui->tx5->text()); } bool MainWindow::gridOK(QString g) { @@ -2306,3 +2322,58 @@ void MainWindow::on_actionDisplay_distance_in_miles_triggered(bool checked) m_bMiles=checked; on_dxGridEntry_textChanged(m_hisGrid); } + +void MainWindow::on_pbCallCQ_clicked() +{ + genStdMsgs(m_rpt); + ui->genMsg->setText(ui->tx6->text()); +} + +void MainWindow::on_pbAnswerCaller_clicked() +{ + genStdMsgs(m_rpt); + ui->genMsg->setText(ui->tx2->text()); +} + +void MainWindow::on_pbSendRRR_clicked() +{ + genStdMsgs(m_rpt); + ui->genMsg->setText(ui->tx4->text()); +} + +void MainWindow::on_pbAnswerCQ_clicked() +{ + genStdMsgs(m_rpt); + ui->genMsg->setText(ui->tx1->text()); +} + +void MainWindow::on_pbSendReport_clicked() +{ + genStdMsgs(m_rpt); + ui->genMsg->setText(ui->tx3->text()); +} + +void MainWindow::on_pbSend73_clicked() +{ + genStdMsgs(m_rpt); + ui->genMsg->setText(ui->tx5->text()); +} + +void MainWindow::on_rbGenMsg_toggled(bool checked) +{ + m_freeText=false; +} + +void MainWindow::on_rbFreeText_toggled(bool checked) +{ + m_freeText=true; + m_ntx=7; +} + +void MainWindow::on_freeTextMsg_editingFinished() +{ + QString t=ui->freeTextMsg->text(); + msgtype(t, ui->freeTextMsg); + m_ntx=8; + qDebug() << m_ntx; +} diff --git a/mainwindow.h b/mainwindow.h index c15c17f60..90270ced7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -139,6 +139,24 @@ private slots: void on_actionDisplay_distance_in_miles_triggered(bool checked); + void on_pbCallCQ_clicked(); + + void on_pbAnswerCaller_clicked(); + + void on_pbSendRRR_clicked(); + + void on_pbAnswerCQ_clicked(); + + void on_pbSendReport_clicked(); + + void on_pbSend73_clicked(); + + void on_rbGenMsg_toggled(bool checked); + + void on_rbFreeText_toggled(bool checked); + + void on_freeTextMsg_editingFinished(); + private: Ui::MainWindow *ui; @@ -222,6 +240,7 @@ private: bool m_clearCallGrid; bool m_bMiles; bool m_decodedText2; + bool m_freeText; char m_decoded[80]; @@ -267,6 +286,7 @@ private: QString m_dateTime; QString m_mode; QString m_fname; + QString m_rpt; QString m_rptSent; QString m_rptRcvd; QString m_qsoStart; @@ -294,6 +314,7 @@ private: void stub(); void statusChanged(); void dialFreqChanged2(double f); + void freeText(); bool gridOK(QString g); QString rig_command(); }; diff --git a/mainwindow.ui b/mainwindow.ui index 1ba832f8c..e233ad7d5 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 720 - 574 + 750 + 594 @@ -35,15 +35,9 @@ - - - 4 - - - 4 - + - + @@ -266,6 +260,13 @@ + + + 10 + 50 + false + + Band Activity @@ -276,6 +277,13 @@ + + + 10 + 50 + false + + QSO @@ -476,632 +484,8 @@ p, li { white-space: pre-wrap; } - - - - - - 0 - 30 - - - - - 16 - 50 - false - - - - Dial Frequency - - - Qt::AlignCenter - - - - - - - - 200 - 0 - - - - - 170 - 24 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - 40 - 16777215 - - - - Tx 3 - - - - - - - - 40 - 16777215 - - - - Tx 2 - - - - - - - - 16 - 0 - - - - - 0 - 20 - - - - - 20 - 16777215 - - - - - - - buttonGroup - - - - - - - - 16 - 0 - - - - - 0 - 20 - - - - - 20 - 16777215 - - - - - - - true - - - buttonGroup - - - - - - - - 16 - 0 - - - - - 0 - 20 - - - - - 20 - 16777215 - - - - - - - buttonGroup - - - - - - - - 40 - 16777215 - - - - Qt::LeftToRight - - - Tx 1 - - - - - - - - 16 - 0 - - - - - 0 - 20 - - - - - 20 - 16777215 - - - - - - - buttonGroup - - - - - - - - 16777215 - 180 - - - - -50 - - - 50 - - - Qt::Vertical - - - - - - - - 200 - 0 - - - - - 170 - 24 - - - - - - - - - 16 - 0 - - - - - 0 - 20 - - - - - 20 - 16777215 - - - - - - - buttonGroup - - - - - - - - 16 - 0 - - - - - 0 - 20 - - - - - 20 - 16777215 - - - - - - - buttonGroup - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - dB - - - - - - - - 0 - 23 - - - - - 140 - 16777215 - - - - Tx even - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Hz - - - Tx + - - - 500 - - - 20000 - - - 1500 - - - - - - - - 40 - 16777215 - - - - Tx 6 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - 200 - 0 - - - - - 170 - 24 - - - - - Droid Sans - 50 - false - - - - - - - - - - - - 0 - 0 - - - - - 43 - 180 - - - - 1 - - - 60.000000000000000 - - - 0.000000000000000 - - - 8 - - - 0.000000000000000 - - - - - - - - 40 - 16777215 - - - - Tx 5 - - - - - - - - 0 - 0 - - - - - 130 - 60 - - - - - 150 - 60 - - - - - 16 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - 2 - - - 0 - - - 01:23:45 - - - Qt::AlignCenter - - - - - - - - 200 - 0 - - - - - 170 - 24 - - - - - - - - - 200 - 0 - - - - - 170 - 24 - - - - - - - - - 40 - 16777215 - - - - Tx 4 - - - - - - - - 200 - 0 - - - - - 170 - 24 - - - - - - - - - 200 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - - - Generate Std Messages - - - - + + 7 @@ -1188,6 +572,268 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 30 + + + + + 16 + 50 + false + + + + Dial Frequency + + + Qt::AlignCenter + + + + + + + + 0 + 23 + + + + + 140 + 16777215 + + + + Tx even + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + dB + + + + + + + + 0 + 0 + + + + + 43 + 200 + + + + 1 + + + 60.000000000000000 + + + 0.000000000000000 + + + 8 + + + 0.000000000000000 + + + + + + + + 0 + 0 + + + + + 0 + 200 + + + + + 16777215 + 200 + + + + -50 + + + 50 + + + Qt::Vertical + + + + + + + + + + + + 252 + 252 + 252 + + + + + + + 170 + 190 + 200 + + + + + + + + + 252 + 252 + 252 + + + + + + + 170 + 190 + 200 + + + + + + + + + 170 + 190 + 200 + + + + + + + 170 + 190 + 200 + + + + + + + + true + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + + + 5 + + + + + + 0 + 23 + + + + DX Call + + + Qt::AlignCenter + + + 2 + + + + + + + + 0 + 0 + + + + + 0 + 27 + + + + + 70 + 16777215 + + + + + + + Qt::AlignCenter + + + + + + + + @@ -1333,143 +979,115 @@ p, li { white-space: pre-wrap; } - - - - - - - - - 252 - 252 - 252 - - - - - - - 170 - 190 - 200 - - - - - - - - - 252 - 252 - 252 - - - - - - - 170 - 190 - 200 - - - - - - - - - 170 - 190 - 200 - - - - - - - 170 - 190 - 200 - - - - - + + + + + 0 + 0 + + + + 100 + 0 + + + + + 100 + 16777215 + + + + Hz + + + Tx + + + + 500 + + + 20000 + + + 1500 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + true - - QFrame::NoFrame + + Az - - QFrame::Raised + + Qt::AlignCenter + + + 4 + + + + + + + Dist + + + Qt::AlignCenter - - - 0 - - - 0 - - - - - 5 - - - - - - 0 - 23 - - - - DX Call - - - Qt::AlignCenter - - - 2 - - - - - - - - 0 - 0 - - - - - 0 - 27 - - - - - 70 - 16777215 - - - - - - - Qt::AlignCenter - - - - - - @@ -1510,50 +1128,52 @@ p, li { white-space: pre-wrap; } - - - - true + + + + + 0 + 0 + + + + + 130 + 60 + + + + + 150 + 60 + + + + + 16 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + 2 + + + 0 - Az - - - Qt::AlignCenter - - - 4 - - - - - - - Dist + 01:23:45 Qt::AlignCenter - - - - Now - - - Qt::AlignCenter - - - - - - - Next - - - - + @@ -1677,6 +1297,538 @@ p, li { white-space: pre-wrap; } + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 260 + + + + 0 + + + + WSJT Traditional + + + + + 20 + 10 + 261 + 211 + + + + + + + + 200 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + Generate Std Messages + + + + + + + Next + + + + + + + Now + + + Qt::AlignCenter + + + + + + + + 200 + 0 + + + + + 170 + 24 + + + + + Droid Sans + 50 + false + + + + + + + + + + + + 16 + 0 + + + + + 0 + 20 + + + + + 20 + 16777215 + + + + + + + true + + + buttonGroup + + + + + + + + 40 + 16777215 + + + + Qt::LeftToRight + + + Tx 1 + + + + + + + + 40 + 16777215 + + + + Tx 2 + + + + + + + + 200 + 0 + + + + + 170 + 24 + + + + + + + + + 16 + 0 + + + + + 0 + 20 + + + + + 20 + 16777215 + + + + + + + buttonGroup + + + + + + + + 200 + 0 + + + + + 170 + 24 + + + + + + + + + 16 + 0 + + + + + 0 + 20 + + + + + 20 + 16777215 + + + + + + + buttonGroup + + + + + + + + 40 + 16777215 + + + + Tx 3 + + + + + + + + 200 + 0 + + + + + 170 + 24 + + + + + + + + + 16 + 0 + + + + + 0 + 20 + + + + + 20 + 16777215 + + + + + + + buttonGroup + + + + + + + + 40 + 16777215 + + + + Tx 4 + + + + + + + + 200 + 0 + + + + + 170 + 24 + + + + + + + + + 16 + 0 + + + + + 0 + 20 + + + + + 20 + 16777215 + + + + + + + buttonGroup + + + + + + + + 40 + 16777215 + + + + Tx 5 + + + + + + + + 200 + 0 + + + + + 170 + 24 + + + + + + + + + 16 + 0 + + + + + 0 + 20 + + + + + 20 + 16777215 + + + + + + + buttonGroup + + + + + + + + 40 + 16777215 + + + + Tx 6 + + + + + + + + + New Message Controls + + + + + 10 + 10 + 283 + 221 + + + + + + + Call CQ + + + + + + + Answer Caller + + + + + + + Answer CQ + + + + + + + Send RRR + + + + + + + Send Report + + + + + + + Send 73 + + + + + + + true + + + + + + + Generated message + + + true + + + + + + + + + + Free text message + + + + + + + + @@ -1688,8 +1840,8 @@ p, li { white-space: pre-wrap; } 0 0 - 720 - 25 + 750 + 21