From 5bb9603ea2c8a28093efd295b868e2a7caa4f680 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 1 Mar 2013 21:25:33 +0000 Subject: [PATCH] Shift-double-click on decoded line does NOT change the frequencies. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3032 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- displaytext.cpp | 3 ++- displaytext.h | 2 +- mainwindow.cpp | 16 +++++++++------- mainwindow.h | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/displaytext.cpp b/displaytext.cpp index 91562a2e5..0b8181e45 100644 --- a/displaytext.cpp +++ b/displaytext.cpp @@ -10,6 +10,7 @@ DisplayText::DisplayText(QWidget *parent) : void DisplayText::mouseDoubleClickEvent(QMouseEvent *e) { bool ctrl = (e->modifiers() & Qt::ControlModifier); - emit(selectCallsign(ctrl)); + bool shift = (e->modifiers() & Qt::ShiftModifier); + emit(selectCallsign(shift,ctrl)); QTextBrowser::mouseDoubleClickEvent(e); } diff --git a/displaytext.h b/displaytext.h index 4553d53fb..c07f00eca 100644 --- a/displaytext.h +++ b/displaytext.h @@ -10,7 +10,7 @@ public: explicit DisplayText(QWidget *parent = 0); signals: - void selectCallsign(bool ctrl); + void selectCallsign(bool shift, bool ctrl); public slots: diff --git a/mainwindow.cpp b/mainwindow.cpp index d73ac3db2..a30982160 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -72,8 +72,8 @@ MainWindow::MainWindow(QWidget *parent) : txMsgButtonGroup->addButton(ui->txrb5,5); txMsgButtonGroup->addButton(ui->txrb6,6); connect(txMsgButtonGroup,SIGNAL(buttonClicked(int)),SLOT(set_ntx(int))); - connect(ui->decodedTextBrowser,SIGNAL(selectCallsign(bool)),this, - SLOT(doubleClickOnCall(bool))); + connect(ui->decodedTextBrowser,SIGNAL(selectCallsign(bool,bool)),this, + SLOT(doubleClickOnCall(bool,bool))); setWindowTitle(Program_Title_Version); connect(&soundInThread, SIGNAL(readyForFFT(int)), @@ -1253,7 +1253,7 @@ void MainWindow::on_txb6_clicked() //txb6 m_restart=true; } -void MainWindow::doubleClickOnCall(bool ctrl) +void MainWindow::doubleClickOnCall(bool shift, bool ctrl) { QTextCursor cursor=ui->decodedTextBrowser->textCursor(); cursor.select(QTextCursor::LineUnderCursor); @@ -1266,10 +1266,12 @@ void MainWindow::doubleClickOnCall(bool ctrl) if(i4>60) i4=60; QString t3=t.mid(i1,i4); QStringList t4=t3.split(" ",QString::SkipEmptyParts); - if(t4.length() <7) return; - int nfreq=int(t4.at(4).toFloat()); - ui->TxFreqSpinBox->setValue(nfreq); - g_pWideGraph->setQSOfreq(nfreq); + if(t4.length() <7) return; //Skip the rest if no decoded text + if(!shift) { //Don't change freqs if Shift key down + int nfreq=int(t4.at(4).toFloat()); + ui->TxFreqSpinBox->setValue(nfreq); + g_pWideGraph->setQSOfreq(nfreq); + } QString hiscall=t4.at(7); ui->dxCallEntry->setText(hiscall); int n = 60*t2.mid(0,2).toInt() + t2.mid(2,2).toInt(); diff --git a/mainwindow.h b/mainwindow.h index 19ab074bb..98ab62b87 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -28,7 +28,7 @@ public slots: void diskWriteFinished(); void freezeDecode(int n); void guiUpdate(); - void doubleClickOnCall(bool ctrl); + void doubleClickOnCall(bool shift, bool ctrl); void readFromStdout(); void readFromStderr(); void jt9_error();