From 395fb340b7579775f0d45b864149a08210b42c56 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Fri, 10 Jun 2016 15:37:11 +0200 Subject: [PATCH] Make the Create Partition dialog obey the default FS type setting. --- .../partition/gui/CreatePartitionDialog.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/gui/CreatePartitionDialog.cpp b/src/modules/partition/gui/CreatePartitionDialog.cpp index 61cb85bb1..80b02dab9 100644 --- a/src/modules/partition/gui/CreatePartitionDialog.cpp +++ b/src/modules/partition/gui/CreatePartitionDialog.cpp @@ -77,11 +77,23 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par initGptPartitionTypeUi(); // File system + FileSystem::Type defaultFsType = FileSystem::typeForName( + Calamares::JobQueue::instance()-> + globalStorage()-> + value( "defaultFileSystemType" ).toString() ); + int defaultFsIndex = -1; + int fsCounter = 0; QStringList fsNames; for ( auto fs : FileSystemFactory::map() ) { - if ( fs->supportCreate() != FileSystem::cmdSupportNone && fs->type() != FileSystem::Extended ) + if ( fs->supportCreate() != FileSystem::cmdSupportNone && + fs->type() != FileSystem::Extended ) + { fsNames << fs->name(); + if ( fs->type() == defaultFsType ) + defaultFsIndex = fsCounter; + fsCounter++; + } } m_ui->fsComboBox->addItems( fsNames ); @@ -89,6 +101,9 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par connect( m_ui->fsComboBox, SIGNAL( activated( int ) ), SLOT( updateMountPointUi() ) ); connect( m_ui->extendedRadioButton, SIGNAL( toggled( bool ) ), SLOT( updateMountPointUi() ) ); + // Select a default + m_ui->fsComboBox->setCurrentIndex( defaultFsIndex ); + setupFlagsList(); }