[netinstall] Simplify slots in the UI page
This commit is contained in:
parent
6556f96442
commit
8e8525a941
@ -33,8 +33,12 @@ NetInstallPage::NetInstallPage( Config* c, QWidget* parent )
|
|||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
ui->groupswidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
|
ui->groupswidget->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
|
||||||
ui->groupswidget->setModel( c->model() );
|
ui->groupswidget->setModel( c->model() );
|
||||||
connect( c, &Config::statusChanged, this, &NetInstallPage::setStatus );
|
connect( c, &Config::statusChanged, ui->netinst_status, &QLabel::setText );
|
||||||
connect( c, &Config::titleLabelChanged, this, &NetInstallPage::setTitle );
|
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 );
|
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
|
void
|
||||||
NetInstallPage::onActivate()
|
NetInstallPage::onActivate()
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,6 @@ public:
|
|||||||
|
|
||||||
void onActivate();
|
void onActivate();
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setStatus( QString s );
|
|
||||||
void setTitle( QString title );
|
|
||||||
|
|
||||||
/** @brief Expand entries that should be pre-expanded.
|
/** @brief Expand entries that should be pre-expanded.
|
||||||
*
|
*
|
||||||
* Follows the *expanded* key / the startExpanded field in the
|
* Follows the *expanded* key / the startExpanded field in the
|
||||||
|
Loading…
Reference in New Issue
Block a user