[netinstall] Initial work for configurable sidebar label

- Now that multiple netinstall pages may be supported, it's annoying
  that they all have the same name. Copy the approach from other
  modules (e.g. notesQML) of having the sidebar and other labels
  configured in the config file.
This commit is contained in:
Adriaan de Groot 2020-02-18 17:46:56 +01:00
parent 0877a994f1
commit 4ae484dbca
2 changed files with 8 additions and 6 deletions

View file

@ -34,6 +34,7 @@ NetInstallViewStep::NetInstallViewStep( QObject* parent )
: Calamares::ViewStep( parent )
, m_widget( new NetInstallPage() )
, m_nextEnabled( false )
, m_sidebarLabel( nullptr )
{
emit nextStatusChanged( true );
connect( m_widget, &NetInstallPage::checkReady, this, &NetInstallViewStep::nextIsReady );
@ -46,13 +47,14 @@ NetInstallViewStep::~NetInstallViewStep()
{
m_widget->deleteLater();
}
delete m_sidebarLabel;
}
QString
NetInstallViewStep::prettyName() const
{
return tr( "Package selection" );
return m_sidebarLabel ? m_sidebarLabel->get() : tr( "Package selection" );
}

View file

@ -20,10 +20,10 @@
#ifndef NETINSTALLVIEWSTEP_H
#define NETINSTALLVIEWSTEP_H
#include <utils/PluginFactory.h>
#include <viewpages/ViewStep.h>
#include <DllMacro.h>
#include "DllMacro.h"
#include "locale/TranslatableConfiguration.h"
#include "utils/PluginFactory.h"
#include "viewpages/ViewStep.h"
#include <QVariant>
@ -64,7 +64,7 @@ private:
NetInstallPage* m_widget;
bool m_nextEnabled;
QString m_prettyStatus;
CalamaresUtils::Locale::TranslatedString* m_sidebarLabel; // As it appears in the sidebar
QList< Calamares::job_ptr > m_jobs;
};