Show efi mountpoint when creating/editing partitions

This commit is contained in:
Ramon Buldó 2015-03-16 10:50:34 +01:00
parent d41ba1da79
commit 6a52811c30
4 changed files with 22 additions and 60 deletions

View file

@ -27,6 +27,8 @@
#include <ui_EditExistingPartitionDialog.h>
#include <utils/Logger.h>
#include "GlobalStorage.h"
#include "JobQueue.h"
// CalaPM
#include <core/device.h>
@ -35,6 +37,7 @@
// Qt
#include <QComboBox>
#include <QDir>
EditExistingPartitionDialog::EditExistingPartitionDialog( Device* device, Partition* partition, QWidget* parentWidget )
: QDialog( parentWidget )
@ -45,6 +48,14 @@ EditExistingPartitionDialog::EditExistingPartitionDialog( Device* device, Partit
{
m_ui->setupUi( this );
QStringList mountPoints;
mountPoints << "/" << "/boot" << "/home" << "/opt" << "/usr" << "/var";
if ( QDir( "/sys/firmware/efi/efivars" ).exists() )
mountPoints << Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString();
mountPoints.removeDuplicates();
mountPoints.sort();
m_ui->mountPointComboBox->addItems( mountPoints );
QColor color = ColorUtils::colorForPartition( m_partition );
m_partitionSizeController->init( m_device, m_partition, color );
m_partitionSizeController->setSpinBox( m_ui->sizeSpinBox );