From 4b7344c1ead388e3fbdc117c7fc5fa43d9469e69 Mon Sep 17 00:00:00 2001 From: QwertyChouskie Date: Thu, 27 Apr 2023 01:40:27 -0700 Subject: [PATCH] UI/UX: Fix update button label bug `setLabel()` does not work in `beforeAddingWidgets()`, use `setText()` instead as was originally used when the code was written. This fixes a regression introduced in https://github.com/supertuxkart/stk-code/commit/0ace825d5fc325dedfd29188add7c5d9ee7fc010 (almost exactly 10 years ago!) --- src/states_screens/dialogs/addons_loading.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/states_screens/dialogs/addons_loading.cpp b/src/states_screens/dialogs/addons_loading.cpp index 1d0d96926..0e34f235d 100644 --- a/src/states_screens/dialogs/addons_loading.cpp +++ b/src/states_screens/dialogs/addons_loading.cpp @@ -111,12 +111,12 @@ void AddonsLoading::beforeAddingWidgets() if (m_addon.isInstalled()) { - /* only keep the button as "update" if allowed to access the net - * and not in error state + /* Turn "Install" button into "Update" if allowed to access the internet + * and not in an errored state */ if (m_addon.needsUpdate() && !addons_manager->wasError() && UserConfigParams::m_internet_status==RequestManager::IPERM_ALLOWED) - getWidget ("install")->setLabel( _("Update") ); + getWidget ("install")->setText( _("Update") ); else r->removeChildNamed("install"); }