[summary] Make widgets-use explicit
This commit is contained in:
parent
2fdb6fdf37
commit
87af923638
@ -96,7 +96,7 @@ Config::retranslate()
|
||||
}
|
||||
|
||||
void
|
||||
Config::collectSummaries( const Calamares::ViewStep* upToHere )
|
||||
Config::collectSummaries( const Calamares::ViewStep* upToHere, Widgets withWidgets )
|
||||
{
|
||||
Calamares::ViewStepList steps;
|
||||
for ( Calamares::ViewStep* step : Calamares::ViewManager::instance()->viewSteps() )
|
||||
@ -123,11 +123,11 @@ Config::collectSummaries( const Calamares::ViewStep* upToHere )
|
||||
steps.append( step );
|
||||
}
|
||||
|
||||
m_summary->setSummaryList( steps );
|
||||
m_summary->setSummaryList( steps, withWidgets == Widgets::Enabled );
|
||||
}
|
||||
|
||||
void
|
||||
Config::clearSummaries()
|
||||
{
|
||||
m_summary->setSummaryList( {} );
|
||||
m_summary->setSummaryList( {}, false );
|
||||
}
|
||||
|
@ -72,8 +72,15 @@ class Config : public QObject
|
||||
public:
|
||||
explicit Config( QObject* parent = nullptr );
|
||||
|
||||
///@brief Include widgets in the model?
|
||||
enum class Widgets
|
||||
{
|
||||
Disabled,
|
||||
Enabled
|
||||
};
|
||||
|
||||
///@brief Called later, to load the model once all viewsteps are there
|
||||
void collectSummaries( const Calamares::ViewStep* upToHere );
|
||||
void collectSummaries( const Calamares::ViewStep* upToHere, Widgets withWidgets );
|
||||
///@brief Clear the model of steps (to avoid dangling widgets)
|
||||
void clearSummaries();
|
||||
|
||||
|
@ -84,7 +84,7 @@ SummaryViewStep::jobs() const
|
||||
void
|
||||
SummaryViewStep::onActivate()
|
||||
{
|
||||
m_config->collectSummaries( this );
|
||||
m_config->collectSummaries( this, Config::Widgets::Enabled );
|
||||
m_widget->onActivate();
|
||||
}
|
||||
|
||||
|
@ -69,5 +69,5 @@ SummaryQmlViewStep::onActivate()
|
||||
{
|
||||
// Collect the steps before this one: those need to have their
|
||||
// summary (text or widget) displayed.
|
||||
m_config->collectSummaries( this );
|
||||
m_config->collectSummaries( this, Config::Widgets::Disabled );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user