mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 18:05:36 -04:00
[partition] Refactor setting the flags UI
- Setup the lsit of flags consistently, by providing the available and to-be-checked flags. - In CreatePartitionDialog, assume that ~0 is all the flags.
This commit is contained in:
parent
4f451eece5
commit
ca03dad67b
6 changed files with 25 additions and 47 deletions
|
@ -121,7 +121,8 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par
|
|||
m_ui->fsComboBox->setCurrentIndex( defaultFsIndex );
|
||||
updateMountPointUi();
|
||||
|
||||
setupFlagsList();
|
||||
setFlagList( *(m_ui->m_listFlags), static_cast< PartitionTable::Flags >( ~PartitionTable::Flags::Int(0) ), PartitionTable::Flags() );
|
||||
|
||||
// Checks the initial selection.
|
||||
checkMountPointSelection();
|
||||
}
|
||||
|
@ -136,25 +137,6 @@ CreatePartitionDialog::newFlags() const
|
|||
return flagsFromList( *(m_ui->m_listFlags) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CreatePartitionDialog::setupFlagsList()
|
||||
{
|
||||
int f = 1;
|
||||
QString s;
|
||||
while ( !( s = PartitionTable::flagName( static_cast< PartitionTable::Flag >( f ) ) ).isEmpty() )
|
||||
{
|
||||
QListWidgetItem* item = new QListWidgetItem( s );
|
||||
m_ui->m_listFlags->addItem( item );
|
||||
item->setFlags( Qt::ItemIsUserCheckable | Qt::ItemIsEnabled );
|
||||
item->setData( Qt::UserRole, f );
|
||||
item->setCheckState( Qt::Unchecked );
|
||||
|
||||
f <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CreatePartitionDialog::initMbrPartitionTypeUi()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue