From da7da823cb924231f34e0505ad572988526b8f02 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 6 Feb 2018 21:49:57 +0000 Subject: [PATCH] Remove the "single-click" patch, it appears to have problems. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8465 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Configuration.cpp | 6 ++++++ Configuration.ui | 11 +++++++++++ displaytext.cpp | 36 +---------------------------------- displaytext.h | 12 +----------- mainwindow.cpp | 48 ++++++++++++----------------------------------- mainwindow.h | 4 ---- 6 files changed, 31 insertions(+), 86 deletions(-) diff --git a/Configuration.cpp b/Configuration.cpp index 15e7d2f18..b1cab5b65 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -558,6 +558,7 @@ private: bool ppfx_; bool clear_DX_; bool miles_; + bool quick_call_; bool disable_TX_on_73_; int watchdog_; bool TX_messages_; @@ -658,6 +659,7 @@ bool Configuration::DXCC () const {return m_->DXCC_;} bool Configuration::ppfx() const {return m_->ppfx_;} bool Configuration::clear_DX () const {return m_->clear_DX_;} bool Configuration::miles () const {return m_->miles_;} +bool Configuration::quick_call () const {return m_->quick_call_;} bool Configuration::disable_TX_on_73 () const {return m_->disable_TX_on_73_;} int Configuration::watchdog () const {return m_->watchdog_;} bool Configuration::TX_messages () const {return m_->TX_messages_;} @@ -1145,6 +1147,7 @@ void Configuration::impl::initialize_models () ui_->ppfx_check_box->setChecked (ppfx_); ui_->clear_DX_check_box->setChecked (clear_DX_); ui_->miles_check_box->setChecked (miles_); + ui_->quick_call_check_box->setChecked (quick_call_); ui_->disable_TX_on_73_check_box->setChecked (disable_TX_on_73_); ui_->tx_watchdog_spin_box->setValue (watchdog_); ui_->TX_messages_check_box->setChecked (TX_messages_); @@ -1381,6 +1384,7 @@ void Configuration::impl::read_settings () ppfx_ = settings_->value ("PrincipalPrefix", false).toBool (); clear_DX_ = settings_->value ("ClearCallGrid", false).toBool (); miles_ = settings_->value ("Miles", false).toBool (); + quick_call_ = settings_->value ("QuickCall", false).toBool (); disable_TX_on_73_ = settings_->value ("73TxDisable", false).toBool (); watchdog_ = settings_->value ("TxWatchdog", 6).toInt (); TX_messages_ = settings_->value ("Tx2QSO", true).toBool (); @@ -1478,6 +1482,7 @@ void Configuration::impl::write_settings () settings_->setValue ("PrincipalPrefix", ppfx_); settings_->setValue ("ClearCallGrid", clear_DX_); settings_->setValue ("Miles", miles_); + settings_->setValue ("QuickCall", quick_call_); settings_->setValue ("73TxDisable", disable_TX_on_73_); settings_->setValue ("TxWatchdog", watchdog_); settings_->setValue ("Tx2QSO", TX_messages_); @@ -1884,6 +1889,7 @@ void Configuration::impl::accept () ppfx_ = ui_->ppfx_check_box->isChecked (); clear_DX_ = ui_->clear_DX_check_box->isChecked (); miles_ = ui_->miles_check_box->isChecked (); + quick_call_ = ui_->quick_call_check_box->isChecked (); disable_TX_on_73_ = ui_->disable_TX_on_73_check_box->isChecked (); watchdog_ = ui_->tx_watchdog_spin_box->value (); TX_messages_ = ui_->TX_messages_check_box->isChecked (); diff --git a/Configuration.ui b/Configuration.ui index 63f487265..2c1f9b173 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -450,6 +450,16 @@ quiet period when decoding is done. + + + Automatic transmission mode. + + + Doubl&e-click on call sets Tx enable + + + + Turns off automatic transmissions after sending a 73 or any other free @@ -2614,6 +2624,7 @@ soundcard changes decoded_text_font_push_button monitor_off_check_box monitor_last_used_check_box + quick_call_check_box tx_watchdog_spin_box CW_id_after_73_check_box enable_VHF_features_check_box diff --git a/displaytext.cpp b/displaytext.cpp index 4f3c36737..0fa3682d7 100644 --- a/displaytext.cpp +++ b/displaytext.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include "qt_helpers.hpp" @@ -33,8 +32,6 @@ DisplayText::DisplayText(QWidget *parent) delete menu; }); connect (erase_action_, &QAction::triggered, this, &DisplayText::erase); - qTimerMouseClick=new QTimer(); - connect(qTimerMouseClick,SIGNAL(timeout()),this,SLOT(mouseTimeout())); } void DisplayText::erase () @@ -64,40 +61,9 @@ void DisplayText::setContentFont(QFont const& font) ensureCursorVisible (); } -void DisplayText::mouseTimeout() -{ - qTimerMouseClick->stop(); - Q_EMIT selectCallsignSingleClick(mouseKeyboardModifiers); -} - -void DisplayText::mousePressEvent(QMouseEvent *e) -{ - qTimerMouseClick->stop(); - mouseStartPos = QCursor::pos(); - mouseKeyboardModifiers = e->modifiers(); - selectedLength = textCursor().selectedText().length(); - QTextEdit::mousePressEvent(e); -} - -void DisplayText::mouseReleaseEvent(QMouseEvent *e) -{ - // If our mouse doesn't move then it's the single click event we want - QPoint mouseChanged = mouseStartPos-QCursor::pos(); - if (e->button() == Qt::LeftButton - && mouseKeyboardModifiers == Qt::NoModifier - && selectedLength == 0 - && mouseChanged.x() == 0 - && mouseChanged.y() == 0) - { - qTimerMouseClick->start(500); - } - QTextEdit::mouseReleaseEvent(e); -} - void DisplayText::mouseDoubleClickEvent(QMouseEvent *e) { - qTimerMouseClick->stop(); - Q_EMIT selectCallsignDoubleClick(e->modifiers ()); + Q_EMIT selectCallsign(e->modifiers ()); QTextEdit::mouseDoubleClickEvent(e); } diff --git a/displaytext.h b/displaytext.h index a6871b75c..0e027d9eb 100644 --- a/displaytext.h +++ b/displaytext.h @@ -27,16 +27,13 @@ public: void displayQSY(QString text); void displayFoxToBeCalled(QString t, QColor bg); - Q_SIGNAL void selectCallsignDoubleClick (Qt::KeyboardModifiers); - Q_SIGNAL void selectCallsignSingleClick (Qt::KeyboardModifiers); + Q_SIGNAL void selectCallsign (Qt::KeyboardModifiers); Q_SIGNAL void erased (); Q_SLOT void appendText (QString const& text, QColor bg = Qt::white); Q_SLOT void erase (); protected: - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); void mouseDoubleClickEvent(QMouseEvent *e); private: @@ -46,13 +43,6 @@ private: QFont char_font_; QAction * erase_action_; - QTimer *qTimerMouseClick; - QPoint mouseStartPos; - int selectedLength; - Qt::KeyboardModifiers mouseKeyboardModifiers; -private slots: - void mouseTimeout (); - }; #endif // DISPLAYTEXT_H diff --git a/mainwindow.cpp b/mainwindow.cpp index a996006b8..647f12459 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -557,13 +557,11 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, txMsgButtonGroup->addButton(ui->txrb6,6); set_dateTimeQSO(-1); connect(txMsgButtonGroup,SIGNAL(buttonClicked(int)),SLOT(set_ntx(int))); - connect (ui->decodedTextBrowser2, &DisplayText::selectCallsignDoubleClick, this, &MainWindow::doubleClickOnCall2); - connect (ui->decodedTextBrowser2, &DisplayText::selectCallsignSingleClick, this, &MainWindow::singleClickOnCall2); - connect (ui->decodedTextBrowser, &DisplayText::selectCallsignDoubleClick, this, &MainWindow::doubleClickOnCall); - connect (ui->decodedTextBrowser, &DisplayText::selectCallsignSingleClick, this, &MainWindow::singleClickOnCall); - connect (ui->decodedTextBrowser, &DisplayText::erased, this, &MainWindow::band_activity_cleared); + connect (ui->decodedTextBrowser, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnCall2); + connect (ui->decodedTextBrowser2, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnCall); + connect (ui->textBrowser4, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnFoxQueue); + connect (ui->decodedTextBrowser, &DisplayText::erased, this, &MainWindow::band_activity_cleared); connect (ui->decodedTextBrowser2, &DisplayText::erased, this, &MainWindow::rx_frequency_activity_cleared); - connect (ui->textBrowser4, &DisplayText::selectCallsignDoubleClick, this, &MainWindow::doubleClickOnFoxQueue); // initialize decoded text font and hook up font change signals // defer initialization until after construction otherwise menu @@ -3922,37 +3920,15 @@ void MainWindow::on_txb6_clicked() if (m_transmitting) m_restart=true; } -void MainWindow::singleClickOnCall(Qt::KeyboardModifiers modifiers) -{ - m_bSingleClicked = true; - m_bDoubleClicked = false; - clickOnCall(modifiers); -} - -void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers) -{ - m_bSingleClicked = false; - m_bDoubleClicked = true; - clickOnCall(modifiers); -} - -void MainWindow::singleClickOnCall2(Qt::KeyboardModifiers modifiers) -{ - m_decodedText2=true; - clickOnCall(modifiers); - m_decodedText2=false; -} - void MainWindow::doubleClickOnCall2(Qt::KeyboardModifiers modifiers) { set_dateTimeQSO(-1); // reset our QSO start time - m_bDoubleClicked=true; m_decodedText2=true; - clickOnCall(modifiers); + doubleClickOnCall(modifiers); m_decodedText2=false; } -void MainWindow::clickOnCall(Qt::KeyboardModifiers modifiers) +void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers) { QTextCursor cursor; if(m_mode=="ISCAT") { @@ -3960,9 +3936,9 @@ void MainWindow::clickOnCall(Qt::KeyboardModifiers modifiers) "Double-click not presently implemented for ISCAT mode"); } if(m_decodedText2) { - cursor=ui->decodedTextBrowser2->textCursor(); - } else { cursor=ui->decodedTextBrowser->textCursor(); + } else { + cursor=ui->decodedTextBrowser2->textCursor(); } if(modifiers==(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)) { @@ -3980,6 +3956,7 @@ void MainWindow::clickOnCall(Qt::KeyboardModifiers modifiers) } DecodedText message {cursor.block().text(), ("MSK144" == m_mode || "FT8" == m_mode) && ui->cbVHFcontest->isChecked(), m_config.my_grid ()}; + m_bDoubleClicked = true; processMessage (message, modifiers); } @@ -4112,7 +4089,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie && firstcall != m_config.my_callsign () && firstcall != m_baseCall && firstcall != "DE") || "CQ" == firstcall || "QRZ" == firstcall || ctrl || shift) { - if (!m_holdTxFreq or (m_holdTxFreq and (shift or ctrl))) { + if (!m_holdTxFreq and (shift or ctrl)) { ui->TxFreqSpinBox->setValue(frequency); } if(m_mode != "JT4" && m_mode != "JT65" && !m_mode.startsWith ("JT9") && @@ -4358,10 +4335,9 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie } if(m_transmitting) m_restart=true; - if (ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked () && !m_bDoubleClicked && !m_bSingleClicked) return; - if(m_bDoubleClicked) auto_tx_mode(true); + if (ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked () && !m_bDoubleClicked) return; + if(m_config.quick_call()) auto_tx_mode(true); m_bDoubleClicked=false; - m_bSingleClicked=false; } void MainWindow::genCQMsg () diff --git a/mainwindow.h b/mainwindow.h index 2b36f5e2d..0898ba252 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -107,11 +107,8 @@ public slots: void diskDat(); void freezeDecode(int n); void guiUpdate(); - void clickOnCall (Qt::KeyboardModifiers); void doubleClickOnCall (Qt::KeyboardModifiers); void doubleClickOnCall2(Qt::KeyboardModifiers); - void singleClickOnCall(Qt::KeyboardModifiers); - void singleClickOnCall2(Qt::KeyboardModifiers); void doubleClickOnFoxQueue(Qt::KeyboardModifiers); void readFromStdout(); void p1ReadFromStdout(); @@ -483,7 +480,6 @@ private: bool m_bNoMoreFiles; bool m_bQRAsyncWarned; bool m_bDoubleClicked; - bool m_bSingleClicked; bool m_bCallingCQ; bool m_bAutoReply; bool m_bCheckedContest;