From 51265e1adf071483b99efb35e39e4e32898bff51 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 17 Apr 2013 15:53:43 +0000 Subject: [PATCH] Temporary updates... must still improve the Tune-button logic. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3194 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 39 ++++++++++++++++++++++----------------- mainwindow.h | 2 +- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 0b84f5074..d683670ee 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -124,6 +124,11 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QWidget *parent) : logQSOTimer->setSingleShot(true); connect(logQSOTimer, SIGNAL(timeout()), this, SLOT(on_logQSOButton_clicked())); + tuneButtonTimer= new QTimer(this); + tuneButtonTimer->setSingleShot(true); + connect(tuneButtonTimer, SIGNAL(timeout()), this, + SLOT(on_stopTxButton_clicked())); + killFileTimer = new QTimer(this); killFileTimer->setSingleShot(true); connect(killFileTimer, SIGNAL(timeout()), this, SLOT(killFile())); @@ -723,14 +728,6 @@ void MainWindow::on_autoButton_clicked() //Auto } } -void MainWindow::on_stopTxButton_clicked() //Stop Tx -{ - if(m_tune) on_tuneButton_clicked(); - if(m_auto) on_autoButton_clicked(); - btxok=false; - m_repeatMsg=0; -} - void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent { int n; @@ -1667,7 +1664,6 @@ void MainWindow::startTx2() soundInThread.setMonitoring(false); btxok=true; m_transmitting=true; - ui->tuneButton->setEnabled(true); } } @@ -2563,15 +2559,24 @@ void MainWindow::on_actionTx2QSO_triggered(bool checked) void MainWindow::on_tuneButton_clicked() { - m_tune=!m_tune; - m_repeatMsg=0; - soundOutThread.setTune(m_tune); if(m_tune) { - ui->tuneButton->setStyleSheet(m_pbTune_style); - ui->tuneButton->setEnabled(false); + m_tune=false; + tuneButtonTimer->start(1000); } else { - btxok=false; - ui->tuneButton->setStyleSheet(""); - on_monitorButton_clicked(); + m_tune=true; + soundOutThread.setTune(m_tune); + m_repeatMsg=0; + ui->tuneButton->setStyleSheet(m_pbTune_style); } } + +void MainWindow::on_stopTxButton_clicked() //Stop Tx +{ + if(m_tune) { + on_tuneButton_clicked(); + } + if(m_auto) on_autoButton_clicked(); + btxok=false; + m_repeatMsg=0; + ui->tuneButton->setStyleSheet(""); +} diff --git a/mainwindow.h b/mainwindow.h index 680d76909..2c354ec74 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -277,7 +277,7 @@ private: QTimer* ptt0Timer; //StopTx delay QTimer* logQSOTimer; QTimer* killFileTimer; - + QTimer* tuneButtonTimer; QString m_path; QString m_pbdecoding_style1;