diff --git a/src/modules/greeting/GreetingPage.cpp b/src/modules/greeting/GreetingPage.cpp index f24d9b212..5814753ff 100644 --- a/src/modules/greeting/GreetingPage.cpp +++ b/src/modules/greeting/GreetingPage.cpp @@ -21,6 +21,7 @@ #include "CalamaresVersion.h" #include "utils/Logger.h" #include "utils/CalamaresUtils.h" +#include "utils/Retranslator.h" #include "ViewManager.h" #include @@ -86,23 +87,15 @@ GreetingPage::GreetingPage( QWidget* parent ) mainLayout->addWidget( m_text ); mainLayout->addStretch(); - retranslate(); -} - - -void -GreetingPage::changeEvent( QEvent* e ) -{ - QWidget::changeEvent( e ); - switch ( e->type() ) - { - case QEvent::LanguageChange: - retranslate(); - break; - - default: - break; - } + CALAMARES_RETRANSLATE( + m_text->setText( tr( "

Welcome to the %1 installer.


" + "This program will ask you some questions and " + "set up %2 on your computer." ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::VersionedName ) ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::ProductName ) ) ); + ) } @@ -114,15 +107,3 @@ GreetingPage::focusInEvent( QFocusEvent* e ) e->accept(); } - -void -GreetingPage::retranslate() -{ - m_text->setText( tr( "

Welcome to the %1 installer.


" - "This program will ask you some questions and " - "set up %2 on your computer." ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::VersionedName ) ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::ProductName ) ) ); -} diff --git a/src/modules/greeting/GreetingPage.h b/src/modules/greeting/GreetingPage.h index 8c508e6ef..260cdbbdd 100644 --- a/src/modules/greeting/GreetingPage.h +++ b/src/modules/greeting/GreetingPage.h @@ -31,12 +31,9 @@ public: explicit GreetingPage( QWidget* parent = nullptr ); protected: - void changeEvent( QEvent* e ) override; void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus private: - void retranslate(); - QListWidget* m_languageWidget; QLabel* m_text; };