Make freqs in mainwindow properly follow mouse clicks on waterfall.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2764 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-11-23 16:44:40 +00:00
parent 7a43d28e68
commit e541f7fd4a
3 changed files with 34 additions and 28 deletions

View File

@ -9,7 +9,7 @@ DisplayText::DisplayText(QWidget *parent) :
void DisplayText::mouseDoubleClickEvent(QMouseEvent *e) void DisplayText::mouseDoubleClickEvent(QMouseEvent *e)
{ {
bool ctrl = (e->modifiers() & 0x4000000); bool ctrl = (e->modifiers() & Qt::ControlModifier);
emit(selectCallsign(ctrl)); emit(selectCallsign(ctrl));
QTextBrowser::mouseDoubleClickEvent(e); QTextBrowser::mouseDoubleClickEvent(e);
} }

View File

@ -553,17 +553,16 @@ void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent
void MainWindow::bumpFqso(int n) //bumpFqso() void MainWindow::bumpFqso(int n) //bumpFqso()
{ {
if((n%100)==11) { int i;
int i=g_pWideGraph->QSOfreq(); bool ctrl = (n>=100);
i--; n=n%100;
g_pWideGraph->setQSOfreq(i); i=g_pWideGraph->QSOfreq();
if(n<100) g_pWideGraph->setTxFreq(i); if(n==11) i--;
} if(n==12) i++;
if((n%100)==12) { g_pWideGraph->setQSOfreq(i);
int i=g_pWideGraph->QSOfreq(); if(!ctrl) {
i++; ui->TxFreqSpinBox->setValue(i);
g_pWideGraph->setQSOfreq(i); g_pWideGraph->setTxFreq(i);
if(n<100) g_pWideGraph->setTxFreq(i);
} }
} }
@ -866,20 +865,24 @@ void MainWindow::on_DecodeButton_clicked() //Decode request
void MainWindow::freezeDecode(int n) //freezeDecode() void MainWindow::freezeDecode(int n) //freezeDecode()
{ {
static int ntol[] = {1,2,5,10,20,50,100,200,500}; if(n==1) {
if(!m_decoderBusy) { bumpFqso(0);
jt9com_.newdat=0; } else {
jt9com_.nagain=1; static int ntol[] = {1,2,5,10,20,50,100,200,500};
int i; if(!m_decoderBusy) {
if(m_mode=="JT9-1") i=4; jt9com_.newdat=0;
if(m_mode=="JT9-2") i=4; jt9com_.nagain=1;
if(m_mode=="JT9-5") i=3; int i;
if(m_mode=="JT9-10") i=2; if(m_mode=="JT9-1") i=4;
if(m_mode=="JT9-30") i=1; if(m_mode=="JT9-2") i=4;
m_tol=ntol[i]; if(m_mode=="JT9-5") i=3;
g_pWideGraph->setTol(m_tol); if(m_mode=="JT9-10") i=2;
ui->tolSpinBox->setValue(i); if(m_mode=="JT9-30") i=1;
decode(); m_tol=ntol[i];
g_pWideGraph->setTol(m_tol);
ui->tolSpinBox->setValue(i);
decode();
}
} }
} }

View File

@ -427,8 +427,11 @@ void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent
{ {
int x=event->x(); int x=event->x();
setFQSO(x,false); // Wideband waterfall setFQSO(x,false); // Wideband waterfall
bool ctrl = (event->modifiers() & 0x4000000); bool ctrl = (event->modifiers() & Qt::ControlModifier);
if(!ctrl) setTxFreq(m_fQSO); if(!ctrl) {
setTxFreq(m_fQSO);
emit freezeDecode1(1); //### ???
}
} }
void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click