From 44c6ce7b0a2c629c3886ef74cd63d2c36362a1a2 Mon Sep 17 00:00:00 2001
From: Dimitris Panokostas <midwan@gmail.com>
Date: Thu, 9 Jan 2025 15:56:24 +0100
Subject: [PATCH] bugfix: Config description was not set when using WHDLoad
 (fixes #1580)

---
 src/osdep/gui/PanelConfig.cpp     | 1 +
 src/osdep/gui/PanelQuickstart.cpp | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/osdep/gui/PanelConfig.cpp b/src/osdep/gui/PanelConfig.cpp
index 7393d7863..f5d43db71 100644
--- a/src/osdep/gui/PanelConfig.cpp
+++ b/src/osdep/gui/PanelConfig.cpp
@@ -277,6 +277,7 @@ void RefreshPanelConfig()
 	if (last_active_config[0])
 	{
 		txtName->setText(last_active_config);
+		txtDesc->setText(changed_prefs.description);
 	}
 
 	// Search current entry
diff --git a/src/osdep/gui/PanelQuickstart.cpp b/src/osdep/gui/PanelQuickstart.cpp
index 82ec5b22c..55a52ee0b 100644
--- a/src/osdep/gui/PanelQuickstart.cpp
+++ b/src/osdep/gui/PanelQuickstart.cpp
@@ -445,8 +445,7 @@ class QSWHDLoadActionListener : public gcn::ActionListener
 				whdload_auto_prefs(&changed_prefs, whdload_prefs.whdload_filename.c_str());
 
 				AdjustDropDownControls();
-				if (!last_loaded_config[0])
-					set_last_active_config(whdload_prefs.whdload_filename.c_str());
+				set_last_active_config(whdload_prefs.whdload_filename.c_str());
 			}
 			cmdWhdloadSelect->requestFocus();
 		}
@@ -474,6 +473,9 @@ class QSWHDLoadActionListener : public gcn::ActionListener
 					bIgnoreListChange = false;
 				}
 				whdload_auto_prefs(&changed_prefs, whdload_prefs.whdload_filename.c_str());
+
+				AdjustDropDownControls();
+				set_last_active_config(whdload_prefs.whdload_filename.c_str());
 			}
 		}
 		refresh_all_panels();