Make LocalePage retranslatable.
This commit is contained in:
parent
2617ef369e
commit
dec452f9b5
@ -43,23 +43,23 @@ LocalePage::LocalePage( QWidget* parent )
|
||||
QBoxLayout* bottomLayout = new QHBoxLayout;
|
||||
mainLayout->addLayout( bottomLayout );
|
||||
|
||||
QLabel* cityLabel = new QLabel( tr( "Region:" ), this );
|
||||
bottomLayout->addWidget( cityLabel );
|
||||
m_cityLabel = new QLabel( this );
|
||||
bottomLayout->addWidget( m_cityLabel );
|
||||
|
||||
m_regionCombo = new QComboBox( this );
|
||||
bottomLayout->addWidget( m_regionCombo );
|
||||
m_regionCombo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||
cityLabel->setBuddy( m_regionCombo );
|
||||
m_cityLabel->setBuddy( m_regionCombo );
|
||||
|
||||
bottomLayout->addSpacing( 20 );
|
||||
|
||||
QLabel* timezoneLabel = new QLabel( tr( "Zone:" ), this );
|
||||
bottomLayout->addWidget( timezoneLabel );
|
||||
m_timezoneLabel = new QLabel( this );
|
||||
bottomLayout->addWidget( m_timezoneLabel );
|
||||
|
||||
m_timezoneCombo = new QComboBox( this );
|
||||
m_timezoneCombo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||
bottomLayout->addWidget( m_timezoneCombo );
|
||||
timezoneLabel->setBuddy( m_timezoneCombo );
|
||||
m_timezoneLabel->setBuddy( m_timezoneCombo );
|
||||
|
||||
mainLayout->addStretch();
|
||||
|
||||
@ -192,3 +192,27 @@ LocalePage::createJobs()
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LocalePage::changeEvent( QEvent* e )
|
||||
{
|
||||
QWidget::changeEvent( e );
|
||||
switch ( e->type() )
|
||||
{
|
||||
case QEvent::LanguageChange:
|
||||
retranslate();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LocalePage::retranslate()
|
||||
{
|
||||
m_cityLabel->setText( tr( "Region:" ) );
|
||||
m_timezoneLabel->setText( tr( "Zone:" ) );
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
class QComboBox;
|
||||
class QLabel;
|
||||
class TimeZoneWidget;
|
||||
|
||||
class LocalePage : public QWidget
|
||||
@ -38,11 +39,19 @@ public:
|
||||
|
||||
QList< Calamares::job_ptr > createJobs();
|
||||
|
||||
protected:
|
||||
void changeEvent( QEvent* e ) override;
|
||||
|
||||
private:
|
||||
void retranslate();
|
||||
|
||||
TimeZoneWidget* m_tzWidget;
|
||||
QComboBox* m_regionCombo;
|
||||
QComboBox* m_timezoneCombo;
|
||||
|
||||
QLabel* m_cityLabel;
|
||||
QLabel* m_timezoneLabel;
|
||||
|
||||
bool m_blockTzWidgetSet;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user