From 45c15de623cd7c7adf76d5884e3f9071f99cb8d4 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 18 Feb 2020 17:59:34 +0100 Subject: [PATCH] [netinstall] Configurable name in the sidebar --- src/modules/netinstall/NetInstallViewStep.cpp | 23 ++++++++++++++----- src/modules/netinstall/netinstall.conf | 14 +++++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/modules/netinstall/NetInstallViewStep.cpp b/src/modules/netinstall/NetInstallViewStep.cpp index 6456e6f96..178862aa7 100644 --- a/src/modules/netinstall/NetInstallViewStep.cpp +++ b/src/modules/netinstall/NetInstallViewStep.cpp @@ -173,6 +173,12 @@ NetInstallViewStep::onLeave() } } +void +NetInstallViewStep::nextIsReady( bool b ) +{ + m_nextEnabled = b; + emit nextStatusChanged( b ); +} void NetInstallViewStep::setConfigurationMap( const QVariantMap& configurationMap ) @@ -187,11 +193,16 @@ NetInstallViewStep::setConfigurationMap( const QVariantMap& configurationMap ) Calamares::JobQueue::instance()->globalStorage()->insert( "groupsUrl", groupsUrl ); m_widget->loadGroupList( groupsUrl ); } -} -void -NetInstallViewStep::nextIsReady( bool b ) -{ - m_nextEnabled = b; - emit nextStatusChanged( b ); + bool bogus = false; + auto label = CalamaresUtils::getSubMap( configurationMap, "label", bogus ); + + if ( label.contains( "sidebar" ) ) + { + m_sidebarLabel = new CalamaresUtils::Locale::TranslatedString( label, "sidebar" ); + } + if ( label.contains( "title" ) ) + { + // Set that label on the page + } } diff --git a/src/modules/netinstall/netinstall.conf b/src/modules/netinstall/netinstall.conf index fd59c24c6..ab600326e 100644 --- a/src/modules/netinstall/netinstall.conf +++ b/src/modules/netinstall/netinstall.conf @@ -21,3 +21,17 @@ # This only has an effect if the netinstall data cannot be retrieved, # or is corrupt: having "required" set, means the install cannot proceed. required: false + +# To support multiple instances of this module, +# some strings are configurable and translatable here. +# - *sidebar* This is the name of the module in the progress-tree / sidebar +# in Calamares. +# - *title* This is displayed above the list of packages. +# If no *sidebar* values are provided, defaults to "Package selection" +# and existing translations. If no *title* values are provided, no string +# is displayed. +label: + sidebar: "Package selection" + sidebar[nl]: "Pakketkeuze" + title: "Office Package" + title[nl]: "Kantoorsoftware"