From 089f4f2bfa7b18c91059ed8477afde569b7183b8 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 28 Oct 2016 14:33:00 +0000 Subject: [PATCH] Add a status bar label for configuration name (if other than "Default"). git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7252 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 20 +++++++++++++++++--- mainwindow.h | 2 ++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index f2dad3fd4..fdb5b030f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -666,6 +666,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->decodedTextLabel2->setText(t); readSettings(); //Restore user's setup params + m_configName = m_multi_settings->common_value("CurrentName").toString(); createStatusBar(); m_audioThread.start (m_audioThreadPriority); @@ -1400,8 +1401,8 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog m_msAudioOutputBuffered); } - auto_tx_label.setText (m_config.quick_call () ? "Auto-Tx-Enable Armed" : - "Auto-Tx-Enable Disarmed"); + auto_tx_label.setText (m_config.quick_call () ? "Auto-Tx-Enable Armed" : "Auto-Tx-Enable Disarmed"); + displayDialFrequency (); bool vhf {m_config.enable_VHF_features()}; m_wideGraph->setVHF(vhf); @@ -1699,6 +1700,14 @@ void MainWindow::createStatusBar() //createStatusBar tx_status_label.setFrameStyle (QFrame::Panel | QFrame::Sunken); statusBar()->addWidget (&tx_status_label); + if(m_configName!="Default") { + config_label.setAlignment (Qt::AlignHCenter); + config_label.setMinimumSize (QSize {80, 18}); + config_label.setFrameStyle (QFrame::Panel | QFrame::Sunken); + config_label.setText(m_configName); + statusBar()->addWidget (&config_label); + } + mode_label.setAlignment (Qt::AlignHCenter); mode_label.setMinimumSize (QSize {80, 18}); mode_label.setFrameStyle (QFrame::Panel | QFrame::Sunken); @@ -2785,7 +2794,7 @@ void MainWindow::guiUpdate() m_currentMessage = "TUNE"; m_currentMessageType = -1; } - last_tx_label.setText("Last Tx: " + m_currentMessage); + last_tx_label.setText("Last Tx: " + m_currentMessage.trimmed()); if(m_restart) { QFile f {m_dataDir.absoluteFilePath ("ALL.TXT")}; if (f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) @@ -2942,6 +2951,11 @@ void MainWindow::guiUpdate() //Once per second: if(nsec != m_sec0) { + if(m_multi_settings->common_value("CurrentName").toString() != m_configName && + m_configName!="Default") { + m_configName=m_multi_settings->common_value("CurrentName").toString(); + config_label.setText(m_configName); + } if(m_auto and m_mode=="Echo" and m_bEchoTxOK) { progressBar.setMaximum(6); progressBar.setValue(int(m_s6)); diff --git a/mainwindow.h b/mainwindow.h index 853999e19..a766fa6d2 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -436,6 +436,7 @@ private: // labels in status bar QLabel tx_status_label; + QLabel config_label; QLabel mode_label; QLabel last_tx_label; QLabel auto_tx_label; @@ -488,6 +489,7 @@ private: QString m_msgSent0; QString m_fileToSave; QString m_calls; + QString m_configName; QSet m_pfx; QSet m_sfx;