[locale] Drop LocalePage:;init

- setting the initial location is something the Config-object should do
- setting up the combo-boxes can be done in the constructor
This commit is contained in:
Adriaan de Groot 2020-07-21 00:11:16 +02:00
parent 726f882185
commit 98f912f80a
3 changed files with 5 additions and 16 deletions

View File

@ -115,6 +115,10 @@ LocalePage::LocalePage( Config* config, QWidget* parent )
connect( m_formatsChangeButton, &QPushButton::clicked, this, &LocalePage::changeFormats ); connect( m_formatsChangeButton, &QPushButton::clicked, this, &LocalePage::changeFormats );
CALAMARES_RETRANSLATE_SLOT( &LocalePage::updateLocaleLabels ) CALAMARES_RETRANSLATE_SLOT( &LocalePage::updateLocaleLabels )
m_regionCombo->setModel( m_config->regionModel() );
m_regionCombo->currentIndexChanged( m_regionCombo->currentIndex() );
updateGlobalStorage();
} }
@ -136,19 +140,6 @@ LocalePage::updateLocaleLabels()
m_formatsLabel->setText( labels.second ); m_formatsLabel->setText( labels.second );
} }
void
LocalePage::init( const QString& initialRegion, const QString& initialZone )
{
using namespace CalamaresUtils::Locale;
m_regionCombo->setModel( m_config->regionModel() );
m_regionCombo->currentIndexChanged( m_regionCombo->currentIndex() );
m_config->setCurrentLocation( initialRegion, initialZone );
updateGlobalStorage();
}
std::pair< QString, QString > std::pair< QString, QString >
LocalePage::prettyLocaleStatus( const LocaleConfiguration& lc ) const LocalePage::prettyLocaleStatus( const LocaleConfiguration& lc ) const
{ {

View File

@ -43,8 +43,6 @@ public:
explicit LocalePage( class Config* config, QWidget* parent = nullptr ); explicit LocalePage( class Config* config, QWidget* parent = nullptr );
virtual ~LocalePage(); virtual ~LocalePage();
void init( const QString& initialRegion, const QString& initialZone );
QString prettyStatus() const; QString prettyStatus() const;
QMap< QString, QString > localesMap(); QMap< QString, QString > localesMap();

View File

@ -70,7 +70,7 @@ LocaleViewStep::setUpPage()
{ {
m_actualWidget = new LocalePage( m_config.get() ); m_actualWidget = new LocalePage( m_config.get() );
} }
m_actualWidget->init( m_startingTimezone.first, m_startingTimezone.second ); m_config->setCurrentLocation( m_startingTimezone.first, m_startingTimezone.second );
m_widget->layout()->addWidget( m_actualWidget ); m_widget->layout()->addWidget( m_actualWidget );
ensureSize( m_actualWidget->sizeHint() ); ensureSize( m_actualWidget->sizeHint() );