From f8e23e3b187ddc8d95e646e44e6a935ae9650874 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 25 Oct 2016 22:49:20 +0000 Subject: [PATCH] Prevents auto power tune from resetting attenuation to 0 by default. Fix autotune for tx pwr on band changes to keep current level if never set. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7233 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 915b97a0a..39fc3f338 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -4495,7 +4495,12 @@ void MainWindow::band_changed (Frequency f) // Set the attenuation value if options are checked QString curBand = ui->bandComboBox->currentText(); if (m_config.pwrBandTxMemory() && !m_tune) { - ui->outAttenuation->setValue(m_pwrBandTxMemory[curBand].toInt()); + if (m_pwrBandTxMemory.contains(curBand)) { + ui->outAttenuation->setValue(m_pwrBandTxMemory[curBand].toInt()); + } + else { + m_pwrBandTxMemory[curBand] = ui->outAttenuation->value(); + } } if (m_bandEdited) {