[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.
main
Adriaan de Groot 6 years ago
parent 0877a994f1
commit 4ae484dbca

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

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

Loading…
Cancel
Save