commit
3f09857cb7
@ -48,6 +48,7 @@
|
||||
|
||||
#include <kpmcore/core/device.h>
|
||||
#include <kpmcore/core/partition.h>
|
||||
#include <kpmcore/core/softwareraid.h>
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QButtonGroup>
|
||||
@ -1182,6 +1183,11 @@ ChoicePage::setupActions()
|
||||
bool atLeastOneCanBeResized = false;
|
||||
bool atLeastOneCanBeReplaced = false;
|
||||
bool atLeastOneIsMounted = false; // Suppress 'erase' if so
|
||||
bool isInactiveRAID = false;
|
||||
|
||||
if ( currentDevice->type() == Device::Type::SoftwareRAID_Device &&
|
||||
static_cast< SoftwareRAID* >(currentDevice)->status() == SoftwareRAID::Status::Inactive )
|
||||
isInactiveRAID = true;
|
||||
|
||||
for ( auto it = PartitionIterator::begin( currentDevice );
|
||||
it != PartitionIterator::end( currentDevice ); ++it )
|
||||
@ -1305,7 +1311,7 @@ ChoicePage::setupActions()
|
||||
else
|
||||
force_uncheck( m_grp, m_alongsideButton );
|
||||
|
||||
if ( !atLeastOneIsMounted )
|
||||
if ( !atLeastOneIsMounted && !isInactiveRAID )
|
||||
m_eraseButton->show(); // None mounted
|
||||
else
|
||||
force_uncheck( m_grp, m_eraseButton );
|
||||
|
@ -72,7 +72,7 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par
|
||||
m_ui->encryptWidget->setText( tr( "En&crypt" ) );
|
||||
m_ui->encryptWidget->hide();
|
||||
|
||||
if (m_device->type() == Device::Type::Disk_Device) {
|
||||
if (m_device->type() != Device::Type::LVM_Device) {
|
||||
m_ui->lvNameLabel->hide();
|
||||
m_ui->lvNameLineEdit->hide();
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||
* Copyright 2018, Andrius Štikonas <andrius@stikonas.eu>
|
||||
* Copyright 2018, Caio Jordão Carvalho <caiojcarvalho@gmail.com>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -47,6 +48,7 @@
|
||||
// KPMcore
|
||||
#include <kpmcore/core/device.h>
|
||||
#include <kpmcore/core/partition.h>
|
||||
#include <kpmcore/core/softwareraid.h>
|
||||
#include <kpmcore/ops/deactivatevolumegroupoperation.h>
|
||||
#include <kpmcore/ops/removevolumegroupoperation.h>
|
||||
|
||||
@ -146,6 +148,7 @@ PartitionPage::updateButtons()
|
||||
bool isInVG = m_core->isInVG( partition );
|
||||
|
||||
create = isFree;
|
||||
|
||||
// Keep it simple for now: do not support editing extended partitions as
|
||||
// it does not work with our current edit implementation which is
|
||||
// actually remove + add. This would not work with extended partitions
|
||||
@ -160,8 +163,17 @@ PartitionPage::updateButtons()
|
||||
if ( m_ui->deviceComboBox->currentIndex() >= 0 )
|
||||
{
|
||||
QModelIndex deviceIndex = m_core->deviceModel()->index( m_ui->deviceComboBox->currentIndex(), 0 );
|
||||
if ( m_core->deviceModel()->deviceForIndex( deviceIndex )->type() != Device::Type::LVM_Device )
|
||||
auto device = m_core->deviceModel()->deviceForIndex( deviceIndex );
|
||||
if ( device->type() != Device::Type::LVM_Device )
|
||||
{
|
||||
createTable = true;
|
||||
|
||||
if ( device->type() == Device::Type::SoftwareRAID_Device &&
|
||||
static_cast< SoftwareRAID* >(device)->status() == SoftwareRAID::Status::Inactive ) {
|
||||
createTable = false;
|
||||
create = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
currentDeviceIsVG = true;
|
||||
|
Loading…
Reference in New Issue
Block a user