As a trial: single-click on a decode to select a new DX Call; double-click to also Enable Tx.

Thanks to W9MDB for this patch, which also removes the option *Double-click on
call sets Tx Enable*.  Please test and report any perceived issues!


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8462 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2018-02-06 20:27:00 +00:00
parent 2c564af7fd
commit ebd7f465fd
7 changed files with 93 additions and 39 deletions

View File

@ -558,7 +558,6 @@ 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_;
@ -659,7 +658,6 @@ 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_;}
@ -1147,7 +1145,6 @@ 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_);
@ -1384,7 +1381,6 @@ 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 ();
@ -1482,7 +1478,6 @@ 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_);
@ -1889,7 +1884,6 @@ 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,16 +450,6 @@ 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
@ -2624,7 +2614,6 @@ 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,6 +7,7 @@
#include <QTextBlock> #include <QTextBlock>
#include <QMenu> #include <QMenu>
#include <QAction> #include <QAction>
#include <QTimer>
#include "qt_helpers.hpp" #include "qt_helpers.hpp"
@ -32,6 +33,8 @@ 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 ()
@ -61,9 +64,40 @@ 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)
{ {
Q_EMIT selectCallsign(e->modifiers ()); qTimerMouseClick->stop();
Q_EMIT selectCallsignDoubleClick(e->modifiers ());
QTextEdit::mouseDoubleClickEvent(e); QTextEdit::mouseDoubleClickEvent(e);
} }

View File

@ -27,13 +27,16 @@ public:
void displayQSY(QString text); void displayQSY(QString text);
void displayFoxToBeCalled(QString t, QColor bg); void displayFoxToBeCalled(QString t, QColor bg);
Q_SIGNAL void selectCallsign (Qt::KeyboardModifiers); Q_SIGNAL void selectCallsignDoubleClick (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:
@ -43,6 +46,13 @@ 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

@ -40,8 +40,8 @@ try clicking with the mouse on the decoded text lines and on the
waterfall spectral display. You should be able to confirm the waterfall spectral display. You should be able to confirm the
following behavior: following behavior:
- Double-click on either of the decoded lines highlighted in - Click or double-click on either of the decoded lines highlighted in
green. This action produces the following results: green. These actions produce the following results:
** Callsign and locator of a station calling CQ are copied to the *DX ** Callsign and locator of a station calling CQ are copied to the *DX
Call* and *DX Grid* entry fields. Call* and *DX Grid* entry fields.
@ -57,9 +57,8 @@ station.
** The *Gen Msg* ("`generated message`") radio button at bottom right ** The *Gen Msg* ("`generated message`") radio button at bottom right
of the main window is selected. of the main window is selected.
** If you had checked *Double-click on call sets Tx Enable* on the ** *Double-click* does all of the above and also activates *Enable Tx*
*Setup* menu, *Enable Tx* would be activated and a transmission would so that a transmission will start automatically at the proper time.
start automatically at the proper time.
** You can modify the double-click behavior by holding down the ** You can modify the double-click behavior by holding down the
*Shift* key to move only the Tx frequency or the *Ctrl* key to move *Shift* key to move only the Tx frequency or the *Ctrl* key to move

View File

@ -557,11 +557,13 @@ 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->decodedTextBrowser, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnCall2); connect (ui->decodedTextBrowser2, &DisplayText::selectCallsignDoubleClick, this, &MainWindow::doubleClickOnCall2);
connect (ui->decodedTextBrowser2, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnCall); connect (ui->decodedTextBrowser2, &DisplayText::selectCallsignSingleClick, this, &MainWindow::singleClickOnCall2);
connect (ui->textBrowser4, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnFoxQueue); 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::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
@ -3910,15 +3912,37 @@ void MainWindow::on_txb6_clicked()
if (m_transmitting) m_restart=true; if (m_transmitting) m_restart=true;
} }
void MainWindow::doubleClickOnCall2(Qt::KeyboardModifiers modifiers) void MainWindow::singleClickOnCall(Qt::KeyboardModifiers modifiers)
{ {
set_dateTimeQSO(-1); // reset our QSO start time m_bSingleClicked = true;
m_decodedText2=true; m_bDoubleClicked = false;
doubleClickOnCall(modifiers); clickOnCall(modifiers);
m_decodedText2=false;
} }
void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers 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);
m_decodedText2=false;
}
void MainWindow::clickOnCall(Qt::KeyboardModifiers modifiers)
{ {
QTextCursor cursor; QTextCursor cursor;
if(m_mode=="ISCAT") { if(m_mode=="ISCAT") {
@ -3926,9 +3950,9 @@ void MainWindow::doubleClickOnCall(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->decodedTextBrowser->textCursor();
} else {
cursor=ui->decodedTextBrowser2->textCursor(); cursor=ui->decodedTextBrowser2->textCursor();
} else {
cursor=ui->decodedTextBrowser->textCursor();
} }
if(modifiers==(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)) { if(modifiers==(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)) {
@ -3946,7 +3970,6 @@ void MainWindow::doubleClickOnCall(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);
} }
@ -4079,7 +4102,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 and (shift or ctrl)) { if (!m_holdTxFreq or (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") &&
@ -4325,9 +4348,10 @@ 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) return; if (ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked () && !m_bDoubleClicked && !m_bSingleClicked) return;
if(m_config.quick_call()) auto_tx_mode(true); if(m_bDoubleClicked) auto_tx_mode(true);
m_bDoubleClicked=false; m_bDoubleClicked=false;
m_bSingleClicked=false;
} }
void MainWindow::genCQMsg () void MainWindow::genCQMsg ()

View File

@ -107,8 +107,11 @@ 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();
@ -480,6 +483,7 @@ 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;