Make sure to update GlobalStorage on every timezone change.

This commit is contained in:
Teo Mrnjavac 2015-07-15 17:48:59 +02:00
parent 45aac4ea78
commit b75b13b466
2 changed files with 14 additions and 4 deletions

View File

@ -116,6 +116,8 @@ LocalePage::LocalePage( QWidget* parent )
if ( !m_blockTzWidgetSet )
m_tzWidget->setCurrentLocation( m_regionCombo->currentData().toString(),
m_zoneCombo->currentData().toString() );
updateGlobalStorage();
} );
connect( m_tzWidget, &TimeZoneWidget::locationChanged,
@ -139,10 +141,7 @@ LocalePage::LocalePage( QWidget* parent )
m_blockTzWidgetSet = false;
Calamares::JobQueue::instance()->globalStorage()
->insert( "locationRegion", location.region );
Calamares::JobQueue::instance()->globalStorage()
->insert( "locationZone", location.zone );
updateGlobalStorage();
} );
connect( m_localeChangeButton, &QPushButton::clicked,
@ -370,3 +369,13 @@ LocalePage::prettyLCLocale( const QString& lcLocale )
localeString.remove( " UTF-8" );
return localeString;
}
void
LocalePage::updateGlobalStorage()
{
LocaleGlobal::Location location = m_tzWidget->getCurrentLocation();
Calamares::JobQueue::instance()->globalStorage()
->insert( "locationRegion", location.region );
Calamares::JobQueue::instance()->globalStorage()
->insert( "locationZone", location.zone );
}

View File

@ -50,6 +50,7 @@ public:
private:
QString guessLCLocale();
QString prettyLCLocale( const QString& lcLocale );
void updateGlobalStorage();
TimeZoneWidget* m_tzWidget;
QComboBox* m_regionCombo;