From 440ca82bca843779a0808fd0c7510184dff6b746 Mon Sep 17 00:00:00 2001
From: James Turner <zakalawe@mac.com>
Date: Fri, 10 Apr 2020 19:09:54 +0100
Subject: [PATCH] Launcher: fix a bug setting combo box state

Fix for callsign broke settings where the default value of setting is
not that of the control.
---
 src/GUI/qml/SettingControl.qml   | 4 ++--
 src/GUI/qml/SettingsComboBox.qml | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/GUI/qml/SettingControl.qml b/src/GUI/qml/SettingControl.qml
index a17304c03..35edfe8ab 100644
--- a/src/GUI/qml/SettingControl.qml
+++ b/src/GUI/qml/SettingControl.qml
@@ -91,8 +91,8 @@ Item {
         var defaultValue = ("defaultValue" in root) ? root.defaultValue : undefined;
         var rawValue = _config.getValueForKey("", root.setting, defaultValue);
 
-        // console.warn("restoring state for " + root.setting + ", got raw value " + rawValue + " with type " + typeof(rawValue))
-        if (rawValue !== defaultValue) {
+        //console.warn("restoring state for " + root.setting + ", got raw value " + rawValue + " with type " + typeof(rawValue))
+        if (rawValue !== undefined) {
             setValue(rawValue);
         }
     }
diff --git a/src/GUI/qml/SettingsComboBox.qml b/src/GUI/qml/SettingsComboBox.qml
index 18c9996be..e6e156030 100644
--- a/src/GUI/qml/SettingsComboBox.qml
+++ b/src/GUI/qml/SettingsComboBox.qml
@@ -30,4 +30,9 @@ SettingControl {
         anchors.topMargin: Style.margin
         width: root.width
     }
+
+     function setValue(newValue)
+     {
+         popup.currentIndex =  newValue;
+     }
 }