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
This commit is contained in:
Joe Taylor 2018-02-06 21:49:57 +00:00
parent b51807df05
commit da7da823cb
6 changed files with 31 additions and 86 deletions

View File

@ -558,6 +558,7 @@ private:
bool ppfx_; bool ppfx_;
bool clear_DX_; bool clear_DX_;
bool miles_; bool miles_;
bool quick_call_;
bool disable_TX_on_73_; bool disable_TX_on_73_;
int watchdog_; int watchdog_;
bool TX_messages_; bool TX_messages_;
@ -658,6 +659,7 @@ bool Configuration::DXCC () const {return m_->DXCC_;}
bool Configuration::ppfx() const {return m_->ppfx_;} bool Configuration::ppfx() const {return m_->ppfx_;}
bool Configuration::clear_DX () const {return m_->clear_DX_;} bool Configuration::clear_DX () const {return m_->clear_DX_;}
bool Configuration::miles () const {return m_->miles_;} 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_;} bool Configuration::disable_TX_on_73 () const {return m_->disable_TX_on_73_;}
int Configuration::watchdog () const {return m_->watchdog_;} int Configuration::watchdog () const {return m_->watchdog_;}
bool Configuration::TX_messages () const {return m_->TX_messages_;} 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_->ppfx_check_box->setChecked (ppfx_);
ui_->clear_DX_check_box->setChecked (clear_DX_); ui_->clear_DX_check_box->setChecked (clear_DX_);
ui_->miles_check_box->setChecked (miles_); 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_->disable_TX_on_73_check_box->setChecked (disable_TX_on_73_);
ui_->tx_watchdog_spin_box->setValue (watchdog_); ui_->tx_watchdog_spin_box->setValue (watchdog_);
ui_->TX_messages_check_box->setChecked (TX_messages_); ui_->TX_messages_check_box->setChecked (TX_messages_);
@ -1381,6 +1384,7 @@ void Configuration::impl::read_settings ()
ppfx_ = settings_->value ("PrincipalPrefix", false).toBool (); ppfx_ = settings_->value ("PrincipalPrefix", false).toBool ();
clear_DX_ = settings_->value ("ClearCallGrid", false).toBool (); clear_DX_ = settings_->value ("ClearCallGrid", false).toBool ();
miles_ = settings_->value ("Miles", false).toBool (); miles_ = settings_->value ("Miles", false).toBool ();
quick_call_ = settings_->value ("QuickCall", false).toBool ();
disable_TX_on_73_ = settings_->value ("73TxDisable", false).toBool (); disable_TX_on_73_ = settings_->value ("73TxDisable", false).toBool ();
watchdog_ = settings_->value ("TxWatchdog", 6).toInt (); watchdog_ = settings_->value ("TxWatchdog", 6).toInt ();
TX_messages_ = settings_->value ("Tx2QSO", true).toBool (); TX_messages_ = settings_->value ("Tx2QSO", true).toBool ();
@ -1478,6 +1482,7 @@ void Configuration::impl::write_settings ()
settings_->setValue ("PrincipalPrefix", ppfx_); settings_->setValue ("PrincipalPrefix", ppfx_);
settings_->setValue ("ClearCallGrid", clear_DX_); settings_->setValue ("ClearCallGrid", clear_DX_);
settings_->setValue ("Miles", miles_); settings_->setValue ("Miles", miles_);
settings_->setValue ("QuickCall", quick_call_);
settings_->setValue ("73TxDisable", disable_TX_on_73_); settings_->setValue ("73TxDisable", disable_TX_on_73_);
settings_->setValue ("TxWatchdog", watchdog_); settings_->setValue ("TxWatchdog", watchdog_);
settings_->setValue ("Tx2QSO", TX_messages_); settings_->setValue ("Tx2QSO", TX_messages_);
@ -1884,6 +1889,7 @@ void Configuration::impl::accept ()
ppfx_ = ui_->ppfx_check_box->isChecked (); ppfx_ = ui_->ppfx_check_box->isChecked ();
clear_DX_ = ui_->clear_DX_check_box->isChecked (); clear_DX_ = ui_->clear_DX_check_box->isChecked ();
miles_ = ui_->miles_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 (); disable_TX_on_73_ = ui_->disable_TX_on_73_check_box->isChecked ();
watchdog_ = ui_->tx_watchdog_spin_box->value (); watchdog_ = ui_->tx_watchdog_spin_box->value ();
TX_messages_ = ui_->TX_messages_check_box->isChecked (); TX_messages_ = ui_->TX_messages_check_box->isChecked ();

View File

@ -450,6 +450,16 @@ quiet period when decoding is done.</string>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QCheckBox" name="quick_call_check_box">
<property name="toolTip">
<string>Automatic transmission mode.</string>
</property>
<property name="text">
<string>Doubl&amp;e-click on call sets Tx enable</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="disable_TX_on_73_check_box"> <widget class="QCheckBox" name="disable_TX_on_73_check_box">
<property name="toolTip"> <property name="toolTip">
<string>Turns off automatic transmissions after sending a 73 or any other free <string>Turns off automatic transmissions after sending a 73 or any other free
@ -2614,6 +2624,7 @@ soundcard changes</string>
<tabstop>decoded_text_font_push_button</tabstop> <tabstop>decoded_text_font_push_button</tabstop>
<tabstop>monitor_off_check_box</tabstop> <tabstop>monitor_off_check_box</tabstop>
<tabstop>monitor_last_used_check_box</tabstop> <tabstop>monitor_last_used_check_box</tabstop>
<tabstop>quick_call_check_box</tabstop>
<tabstop>tx_watchdog_spin_box</tabstop> <tabstop>tx_watchdog_spin_box</tabstop>
<tabstop>CW_id_after_73_check_box</tabstop> <tabstop>CW_id_after_73_check_box</tabstop>
<tabstop>enable_VHF_features_check_box</tabstop> <tabstop>enable_VHF_features_check_box</tabstop>

View File

@ -7,7 +7,6 @@
#include <QTextBlock> #include <QTextBlock>
#include <QMenu> #include <QMenu>
#include <QAction> #include <QAction>
#include <QTimer>
#include "qt_helpers.hpp" #include "qt_helpers.hpp"
@ -33,8 +32,6 @@ DisplayText::DisplayText(QWidget *parent)
delete menu; delete menu;
}); });
connect (erase_action_, &QAction::triggered, this, &DisplayText::erase); connect (erase_action_, &QAction::triggered, this, &DisplayText::erase);
qTimerMouseClick=new QTimer();
connect(qTimerMouseClick,SIGNAL(timeout()),this,SLOT(mouseTimeout()));
} }
void DisplayText::erase () void DisplayText::erase ()
@ -64,40 +61,9 @@ void DisplayText::setContentFont(QFont const& font)
ensureCursorVisible (); 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) void DisplayText::mouseDoubleClickEvent(QMouseEvent *e)
{ {
qTimerMouseClick->stop(); Q_EMIT selectCallsign(e->modifiers ());
Q_EMIT selectCallsignDoubleClick(e->modifiers ());
QTextEdit::mouseDoubleClickEvent(e); QTextEdit::mouseDoubleClickEvent(e);
} }

View File

@ -27,16 +27,13 @@ public:
void displayQSY(QString text); void displayQSY(QString text);
void displayFoxToBeCalled(QString t, QColor bg); void displayFoxToBeCalled(QString t, QColor bg);
Q_SIGNAL void selectCallsignDoubleClick (Qt::KeyboardModifiers); Q_SIGNAL void selectCallsign (Qt::KeyboardModifiers);
Q_SIGNAL void selectCallsignSingleClick (Qt::KeyboardModifiers);
Q_SIGNAL void erased (); Q_SIGNAL void erased ();
Q_SLOT void appendText (QString const& text, QColor bg = Qt::white); Q_SLOT void appendText (QString const& text, QColor bg = Qt::white);
Q_SLOT void erase (); Q_SLOT void erase ();
protected: protected:
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void mouseDoubleClickEvent(QMouseEvent *e); void mouseDoubleClickEvent(QMouseEvent *e);
private: private:
@ -46,13 +43,6 @@ private:
QFont char_font_; QFont char_font_;
QAction * erase_action_; QAction * erase_action_;
QTimer *qTimerMouseClick;
QPoint mouseStartPos;
int selectedLength;
Qt::KeyboardModifiers mouseKeyboardModifiers;
private slots:
void mouseTimeout ();
}; };
#endif // DISPLAYTEXT_H #endif // DISPLAYTEXT_H

View File

@ -557,13 +557,11 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
txMsgButtonGroup->addButton(ui->txrb6,6); txMsgButtonGroup->addButton(ui->txrb6,6);
set_dateTimeQSO(-1); set_dateTimeQSO(-1);
connect(txMsgButtonGroup,SIGNAL(buttonClicked(int)),SLOT(set_ntx(int))); connect(txMsgButtonGroup,SIGNAL(buttonClicked(int)),SLOT(set_ntx(int)));
connect (ui->decodedTextBrowser2, &DisplayText::selectCallsignDoubleClick, this, &MainWindow::doubleClickOnCall2); connect (ui->decodedTextBrowser, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnCall2);
connect (ui->decodedTextBrowser2, &DisplayText::selectCallsignSingleClick, this, &MainWindow::singleClickOnCall2); connect (ui->decodedTextBrowser2, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnCall);
connect (ui->decodedTextBrowser, &DisplayText::selectCallsignDoubleClick, this, &MainWindow::doubleClickOnCall); connect (ui->textBrowser4, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnFoxQueue);
connect (ui->decodedTextBrowser, &DisplayText::selectCallsignSingleClick, this, &MainWindow::singleClickOnCall); connect (ui->decodedTextBrowser, &DisplayText::erased, this, &MainWindow::band_activity_cleared);
connect (ui->decodedTextBrowser, &DisplayText::erased, this, &MainWindow::band_activity_cleared);
connect (ui->decodedTextBrowser2, &DisplayText::erased, this, &MainWindow::rx_frequency_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 // initialize decoded text font and hook up font change signals
// defer initialization until after construction otherwise menu // defer initialization until after construction otherwise menu
@ -3922,37 +3920,15 @@ void MainWindow::on_txb6_clicked()
if (m_transmitting) m_restart=true; 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) void MainWindow::doubleClickOnCall2(Qt::KeyboardModifiers modifiers)
{ {
set_dateTimeQSO(-1); // reset our QSO start time set_dateTimeQSO(-1); // reset our QSO start time
m_bDoubleClicked=true;
m_decodedText2=true; m_decodedText2=true;
clickOnCall(modifiers); doubleClickOnCall(modifiers);
m_decodedText2=false; m_decodedText2=false;
} }
void MainWindow::clickOnCall(Qt::KeyboardModifiers modifiers) void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers)
{ {
QTextCursor cursor; QTextCursor cursor;
if(m_mode=="ISCAT") { if(m_mode=="ISCAT") {
@ -3960,9 +3936,9 @@ void MainWindow::clickOnCall(Qt::KeyboardModifiers modifiers)
"Double-click not presently implemented for ISCAT mode"); "Double-click not presently implemented for ISCAT mode");
} }
if(m_decodedText2) { if(m_decodedText2) {
cursor=ui->decodedTextBrowser2->textCursor();
} else {
cursor=ui->decodedTextBrowser->textCursor(); cursor=ui->decodedTextBrowser->textCursor();
} else {
cursor=ui->decodedTextBrowser2->textCursor();
} }
if(modifiers==(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)) { 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) && DecodedText message {cursor.block().text(), ("MSK144" == m_mode || "FT8" == m_mode) &&
ui->cbVHFcontest->isChecked(), m_config.my_grid ()}; ui->cbVHFcontest->isChecked(), m_config.my_grid ()};
m_bDoubleClicked = true;
processMessage (message, modifiers); processMessage (message, modifiers);
} }
@ -4112,7 +4089,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
&& firstcall != m_config.my_callsign () && firstcall != m_baseCall && firstcall != m_config.my_callsign () && firstcall != m_baseCall
&& firstcall != "DE") && firstcall != "DE")
|| "CQ" == firstcall || "QRZ" == firstcall || ctrl || shift) { || "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); ui->TxFreqSpinBox->setValue(frequency);
} }
if(m_mode != "JT4" && m_mode != "JT65" && !m_mode.startsWith ("JT9") && 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(m_transmitting) m_restart=true;
if (ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked () && !m_bDoubleClicked && !m_bSingleClicked) return; if (ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked () && !m_bDoubleClicked) return;
if(m_bDoubleClicked) auto_tx_mode(true); if(m_config.quick_call()) auto_tx_mode(true);
m_bDoubleClicked=false; m_bDoubleClicked=false;
m_bSingleClicked=false;
} }
void MainWindow::genCQMsg () void MainWindow::genCQMsg ()

View File

@ -107,11 +107,8 @@ public slots:
void diskDat(); void diskDat();
void freezeDecode(int n); void freezeDecode(int n);
void guiUpdate(); void guiUpdate();
void clickOnCall (Qt::KeyboardModifiers);
void doubleClickOnCall (Qt::KeyboardModifiers); void doubleClickOnCall (Qt::KeyboardModifiers);
void doubleClickOnCall2(Qt::KeyboardModifiers); void doubleClickOnCall2(Qt::KeyboardModifiers);
void singleClickOnCall(Qt::KeyboardModifiers);
void singleClickOnCall2(Qt::KeyboardModifiers);
void doubleClickOnFoxQueue(Qt::KeyboardModifiers); void doubleClickOnFoxQueue(Qt::KeyboardModifiers);
void readFromStdout(); void readFromStdout();
void p1ReadFromStdout(); void p1ReadFromStdout();
@ -483,7 +480,6 @@ private:
bool m_bNoMoreFiles; bool m_bNoMoreFiles;
bool m_bQRAsyncWarned; bool m_bQRAsyncWarned;
bool m_bDoubleClicked; bool m_bDoubleClicked;
bool m_bSingleClicked;
bool m_bCallingCQ; bool m_bCallingCQ;
bool m_bAutoReply; bool m_bAutoReply;
bool m_bCheckedContest; bool m_bCheckedContest;