[netinstall] Simplify slots in the UI page

This commit is contained in:
Adriaan de Groot 2021-03-16 13:10:09 +01:00
parent 6556f96442
commit 8e8525a941
2 changed files with 6 additions and 26 deletions

View File

@ -33,8 +33,12 @@ NetInstallPage::NetInstallPage( Config* c, QWidget* parent )
ui->setupUi( this );
ui->groupswidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
ui->groupswidget->setModel( c->model() );
connect( c, &Config::statusChanged, this, &NetInstallPage::setStatus );
connect( c, &Config::titleLabelChanged, this, &NetInstallPage::setTitle );
connect( c, &Config::statusChanged, ui->netinst_status, &QLabel::setText );
connect( c, &Config::titleLabelChanged, [ui = this->ui]( const QString title ) {
ui->label->setVisible( !title.isEmpty() );
ui->label->setText( title );
} );
connect( c, &Config::statusReady, this, &NetInstallPage::expandGroups );
}
@ -55,26 +59,6 @@ NetInstallPage::expandGroups()
}
}
void
NetInstallPage::setStatus( QString s )
{
ui->netinst_status->setText( s );
}
void
NetInstallPage::setTitle( QString title )
{
if ( title.isEmpty() )
{
ui->label->hide();
}
else
{
ui->label->setText( title ); // That's get() on the TranslatedString
ui->label->show();
}
}
void
NetInstallPage::onActivate()
{

View File

@ -39,10 +39,6 @@ public:
void onActivate();
public slots:
void setStatus( QString s );
void setTitle( QString title );
/** @brief Expand entries that should be pre-expanded.
*
* Follows the *expanded* key / the startExpanded field in the