From 05931313b38996842d88f6da3e6f21b8dd636bdf Mon Sep 17 00:00:00 2001 From: Uwe Risse Date: Wed, 6 Dec 2023 13:18:25 +0100 Subject: [PATCH] Make some right-click mouse press events more intuitive and consistent. --- widgets/mainwindow.cpp | 46 ++++++++++++++++++++++++++---------------- widgets/mainwindow.ui | 7 +++++-- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index b82430a11..faba65863 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3303,7 +3303,7 @@ void MainWindow::on_actionSpecial_mouse_commands_triggered() Click to set Rx frequency.
Shift-click to set Tx frequency.
Ctrl-click or Right-click to set Rx and Tx frequencies.
- Double-click to also decode at Rx frequency.
+ Double-click to also decode at Rx frequency. @@ -3314,7 +3314,7 @@ void MainWindow::on_actionSpecial_mouse_commands_triggered() messages.
If Hold Tx Freq is checked or first callsign in message
is your own call, Tx frequency is not changed unless
- Ctrl is held down.
+ Ctrl is held down. @@ -3323,6 +3323,18 @@ void MainWindow::on_actionSpecial_mouse_commands_triggered() Double-click to erase QSO and Band Activity windows. + + Q65 Button: + Click to switch to Q65 Mode.
+ Right-click to switch to Q65 Pileup Mode. + + + + JT65 Button: + Click to switch to JT65 Mode.
+ Right-click to switch to JT9 Mode. + + )"), font}); } m_mouseCmnds->showNormal (); @@ -6601,18 +6613,14 @@ void MainWindow::on_RoundRobin_currentTextChanged(QString text) void MainWindow::mousePressEvent(QMouseEvent *event) { - if(ui->q65Button->hasFocus() && (event->button() & Qt::RightButton)) { - m_specOp=m_config.special_op_id(); - if (m_specOp==SpecOp::Q65_PILEUP) { - m_config.setSpecial_None(); - ui->tx1->setEnabled(true); - ui->txb1->setEnabled(true); - } else { - m_config.setSpecial_Q65_Pileup(); - } + if(ui->q65Button->hasFocus() && (event->button() & Qt::RightButton)) { // switch to Q65_Pileup mode + m_config.setSpecial_Q65_Pileup(); m_specOp=m_config.special_op_id(); on_actionQ65_triggered(); } + if(ui->jt65Button->hasFocus() && (event->button() & Qt::RightButton)) { // switch to JT9 mode + on_actionJT9_triggered(); + } } void MainWindow::on_dxCallEntry_textChanged (QString const& call) @@ -10776,29 +10784,33 @@ void MainWindow::on_houndButton_clicked (bool checked) void MainWindow::on_ft8Button_clicked() { - if(m_specOp==SpecOp::HOUND) { + if (m_specOp==SpecOp::HOUND) { m_config.setSpecial_None(); m_specOp=m_config.special_op_id(); } - on_actionFT8_triggered(); + on_actionFT8_triggered(); } void MainWindow::on_ft4Button_clicked() { - on_actionFT4_triggered(); + on_actionFT4_triggered(); } void MainWindow::on_msk144Button_clicked() { - on_actionMSK144_triggered(); + on_actionMSK144_triggered(); } void MainWindow::on_q65Button_clicked() { - on_actionQ65_triggered(); + if (m_specOp==SpecOp::Q65_PILEUP) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } + on_actionQ65_triggered(); } void MainWindow::on_jt65Button_clicked() { - on_actionJT65_triggered(); + on_actionJT65_triggered(); } diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index e36aa078c..021062705 100644 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -3017,7 +3017,7 @@ QLabel[oob="true"] { Qt::StrongFocus - <html><head/><body><p>Switch to Q65 mode. Right-click to toggle Q65 Pileup mode On/Off.</p></body></html> + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> Q65 @@ -3038,8 +3038,11 @@ QLabel[oob="true"] { 16777215 + + Qt::StrongFocus + - Switch to JT65 mode + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> JT65