From 340ec6b38a32f1e34ec0c5868f5118afd5b81c44 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 31 May 2015 12:47:15 +0000 Subject: [PATCH] Allow nummeric only band names in band hopping setup This change allows the old and new format to coexist. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5476 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 9cfcc5393..380bc3459 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -4295,9 +4295,17 @@ void MainWindow::bandHopping() if(isun==2) s=m_sunsetBands; if(isun==3) s=m_nightBands; + // allow numeric only band names + for (auto& item : s) { + if (!item.endsWith ('m')) { + item += 'm'; + } + } + QString new_band; - if (s.contains (hopping_bands[iband0])) { //See if designated band is active - new_band = hopping_bands[iband0]; + int index; + if ((index = s.indexOf (hopping_bands[iband0])) >= 0) { //See if designated band is active + new_band = hopping_bands[index]; } else { // If designated band is not active, choose one that is active @@ -4343,7 +4351,14 @@ void MainWindow::bandHopping() // Produce a short tuneup signal m_tuneup = false; - if (m_tuneBands.contains (m_band00)) { + auto tu_bands = m_tuneBands; + // allow numeric only band names + for (auto& item : tu_bands) { + if (!item.endsWith ('m')) { + item += 'm'; + } + } + if (tu_bands.contains (m_band00)) { m_tuneup = true; on_tuneButton_clicked (true); tuneATU_Timer->start (2500);