[locale] Filter zones combo always

The drop-down of zones was initially unfiltered, so you could start
in Europe/Amsterdam and the zones drop-down would also show Australian
zones; picking Perth would have weird effects, since Europe/Perth
doesn't exist and so you'd end up in New York instead.

- set the filtering region immediately, rather than only when the
  region changes.
main
Adriaan de Groot 4 years ago
parent 83b2b95381
commit e5b7e66ee9

@ -91,10 +91,16 @@ LocalePage::LocalePage( Config* config, QWidget* parent )
// Set up the location before connecting signals, to avoid a signal
// storm as various parts interact.
m_regionCombo->setModel( m_config->regionModel() );
m_zoneCombo->setModel( m_config->regionalZonesModel() );
locationChanged( m_config->currentLocation() ); // doesn't inform TZ widget
m_tzWidget->setCurrentLocation( m_config->currentLocation() );
{
auto* regions = m_config->regionModel();
auto* zones = m_config->regionalZonesModel();
auto* location = m_config->currentLocation();
zones->setRegion( location->region() );
m_regionCombo->setModel( regions );
m_zoneCombo->setModel( zones );
m_tzWidget->setCurrentLocation( location );
locationChanged( location ); // doesn't inform TZ widget
}
connect( config, &Config::currentLCStatusChanged, m_formatsLabel, &QLabel::setText );
connect( config, &Config::currentLanguageStatusChanged, m_localeLabel, &QLabel::setText );

Loading…
Cancel
Save