[netinstall] Support selecting visible groups by default.
In other words, support: hidden: false selected: true groups. This was supposed to work according to README.md, but not actually implemented. Now it should be working.
This commit is contained in:
parent
c09e7030db
commit
075577d948
@ -111,7 +111,7 @@ NetInstallPage::dataIsHere( QNetworkReply* reply )
|
||||
continue;
|
||||
}
|
||||
|
||||
GroupSelectionWidget* groupWidget = new GroupSelectionWidget( group.name, group.description, group.packages, this );
|
||||
GroupSelectionWidget* groupWidget = new GroupSelectionWidget( group.name, group.description, group.packages, group.selected, this );
|
||||
m_groupWidgets.insert( groupKey, groupWidget );
|
||||
ui->groupswidget->layout()->addWidget( groupWidget );
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
GroupSelectionWidget::GroupSelectionWidget( QString name, QString description, QStringList packages, QWidget* parent ) :
|
||||
GroupSelectionWidget::GroupSelectionWidget( QString name, QString description, QStringList packages, bool selected, QWidget* parent ) :
|
||||
QWidget( parent ),
|
||||
m_isToggled( false )
|
||||
{
|
||||
@ -29,6 +29,7 @@ GroupSelectionWidget::GroupSelectionWidget( QString name, QString description, Q
|
||||
connect( ui.group, &QCheckBox::toggled, this, &GroupSelectionWidget::toggleGroup );
|
||||
|
||||
ui.group->setText( name );
|
||||
ui.group->setChecked( selected ); // also triggers the toggleGroup slot
|
||||
ui.description->setText( description );
|
||||
const int columns = 4;
|
||||
const int rows = ( packages.size() - 1 ) / columns + 1;
|
||||
|
@ -29,7 +29,7 @@ class GroupSelectionWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GroupSelectionWidget( QString name, QString description, QStringList packages, QWidget* parent = nullptr );
|
||||
explicit GroupSelectionWidget( QString name, QString description, QStringList packages, bool selected, QWidget* parent = nullptr );
|
||||
|
||||
// Current status of the group: is it selected in the view?
|
||||
bool isToggled() const;
|
||||
|
Loading…
Reference in New Issue
Block a user