[welcome] Shuffle code

- things that can be done in the designer file should be there,
  not weirdly repeated in code elsewhere
- drop the insertion of an extra spacer (why not include it in the
  designer file?)
- shuffle all the connect() calls down to the end of the constructor
main
Adriaan de Groot 5 years ago
parent be86561913
commit c3941b6e65

@ -51,34 +51,12 @@ WelcomePage::WelcomePage( Config* conf, QWidget* parent )
, m_languages( nullptr )
, m_conf( conf )
{
connect( Calamares::ModuleManager::instance(),
&Calamares::ModuleManager::requirementsComplete,
m_checkingWidget,
&CheckerContainer::requirementsComplete );
connect( Calamares::ModuleManager::instance(),
&Calamares::ModuleManager::requirementsProgress,
m_checkingWidget,
&CheckerContainer::requirementsProgress );
ui->setupUi( this );
const int defaultFontHeight = CalamaresUtils::defaultFontHeight();
ui->verticalLayout->insertSpacing( 1, defaultFontHeight * 2 );
initLanguages();
ui->mainText->setAlignment( Qt::AlignCenter );
ui->mainText->setWordWrap( true );
ui->mainText->setOpenExternalLinks( true );
cDebug() << "Welcome string" << Calamares::Branding::instance()->welcomeStyleCalamares()
<< *Calamares::Branding::VersionedName;
CALAMARES_RETRANSLATE_SLOT( &WelcomePage::retranslate )
ui->setupUi( this );
ui->aboutButton->setIcon( CalamaresUtils::defaultPixmap(
CalamaresUtils::Information,
CalamaresUtils::Original,
2 * QSize( defaultFontHeight, defaultFontHeight ) ) );
connect( ui->aboutButton, &QPushButton::clicked, this, &WelcomePage::showAboutBox );
// insert system-check widget below welcome text
const int welcome_text_idx = ui->verticalLayout->indexOf( ui->mainText );
@ -100,6 +78,22 @@ WelcomePage::WelcomePage( Config* conf, QWidget* parent )
ui->verticalLayout->insertWidget( welcome_text_idx, bannerLabel );
}
}
initLanguages();
cDebug() << "Welcome string" << Calamares::Branding::instance()->welcomeStyleCalamares()
<< *Calamares::Branding::VersionedName;
CALAMARES_RETRANSLATE_SLOT( &WelcomePage::retranslate )
connect( ui->aboutButton, &QPushButton::clicked, this, &WelcomePage::showAboutBox );
connect( Calamares::ModuleManager::instance(),
&Calamares::ModuleManager::requirementsComplete,
m_checkingWidget,
&CheckerContainer::requirementsComplete );
connect( Calamares::ModuleManager::instance(),
&Calamares::ModuleManager::requirementsProgress,
m_checkingWidget,
&CheckerContainer::requirementsProgress );
}
void

@ -43,6 +43,12 @@
<property name="text">
<string notr="true">&lt;Calamares welcome text&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -78,15 +84,15 @@
</item>
<item>
<widget class="QComboBox" name="languageWidget">
<property name="toolTip">
<string>Select application and system language</string>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Select application and system language</string>
</property>
</widget>
</item>
<item>

Loading…
Cancel
Save