From d3b6ac4ba2884806be381df467b2b905f69ea807 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 4 Jun 2015 17:16:55 +0000 Subject: [PATCH] Some cleanup of interaction between GUI and Echo mode. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5523 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- echograph.cpp | 6 ++++++ echograph.h | 3 +++ mainwindow.cpp | 12 ++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/echograph.cpp b/echograph.cpp index c2fc9c665..8134389c6 100644 --- a/echograph.cpp +++ b/echograph.cpp @@ -39,6 +39,12 @@ EchoGraph::~EchoGraph() delete ui; } +void EchoGraph::closeEvent (QCloseEvent * e) +{ + saveSettings (); + QDialog::closeEvent (e); +} + void EchoGraph::saveSettings() { //Save user's settings diff --git a/echograph.h b/echograph.h index 25657265d..72153e49c 100644 --- a/echograph.h +++ b/echograph.h @@ -10,6 +10,9 @@ class EchoGraph : public QDialog { Q_OBJECT +protected: + void closeEvent (QCloseEvent *) override; + public: explicit EchoGraph(QWidget *parent = 0); ~EchoGraph(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 8b2ed0767..079856676 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -168,6 +168,8 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme SLOT(setXIT(int))); connect (this, &MainWindow::finished, m_wideGraph.data (), &WideGraph::close); + connect (this, &MainWindow::finished, m_echoGraph.data (), &EchoGraph::close); + // setup the log QSO dialog connect (m_logDlg.data (), &LogQSO::acceptQSO, this, &MainWindow::acceptQSO2); connect (this, &MainWindow::finished, m_logDlg.data (), &LogQSO::close); @@ -495,8 +497,9 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme genStdMsgs(m_rpt); m_ntx=6; ui->txrb6->setChecked(true); - if(m_mode!="JT9" and m_mode!="JT9W-1" and m_mode!="JT65" and m_mode!="JT9+JT65" and - m_mode!="JT4" and m_mode!="WSPR-2" and m_mode!="WSPR-15") m_mode="JT9"; + if(m_mode!="JT9" and m_mode!="JT9W-1" and m_mode!="JT65" and m_mode!="JT9+JT65" + and m_mode!="JT4" and m_mode!="WSPR-2" and m_mode!="WSPR-15" and + m_mode!="Echo") m_mode="JT9"; on_actionWide_Waterfall_triggered(); //### connect(m_wideGraph.data (), SIGNAL(setFreq3(int,int)),this, @@ -509,6 +512,7 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme if(m_mode=="JT9+JT65") on_actionJT9_JT65_triggered(); if(m_mode=="WSPR-2") on_actionWSPR_2_triggered(); if(m_mode=="WSPR-15") on_actionWSPR_15_triggered(); + if(m_mode=="Echo") on_actionEcho_triggered(); m_wideGraph->setLockTxFreq(m_lockTxFreq); m_wideGraph->setMode(m_mode); @@ -3172,7 +3176,11 @@ void MainWindow::on_actionEcho_triggered() { m_mode="Echo"; switch_mode(Modes::Echo); + m_modeTx="Echo"; + statusChanged(); if(!m_echoGraph->isVisible()) m_echoGraph->show(); + mode_label->setStyleSheet("QLabel{background-color: #7cfc00}"); + mode_label->setText(m_mode); } void MainWindow::switch_mode (Mode mode)