mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
Merge branch 'master' into fix-swap-ui
This commit is contained in:
commit
29bae61610
35 changed files with 934 additions and 154 deletions
|
@ -50,6 +50,9 @@
|
|||
|
||||
#include <kpmcore/core/device.h>
|
||||
#include <kpmcore/core/partition.h>
|
||||
#ifdef WITH_KPMCOREGT33
|
||||
#include <kpmcore/core/softwareraid.h>
|
||||
#endif
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QButtonGroup>
|
||||
|
@ -1230,6 +1233,13 @@ ChoicePage::setupActions()
|
|||
bool atLeastOneCanBeResized = false;
|
||||
bool atLeastOneCanBeReplaced = false;
|
||||
bool atLeastOneIsMounted = false; // Suppress 'erase' if so
|
||||
bool isInactiveRAID = false;
|
||||
|
||||
#ifdef WITH_KPMCOREGT33
|
||||
if ( currentDevice->type() == Device::Type::SoftwareRAID_Device &&
|
||||
static_cast< SoftwareRAID* >(currentDevice)->status() == SoftwareRAID::Status::Inactive )
|
||||
isInactiveRAID = true;
|
||||
#endif
|
||||
|
||||
for ( auto it = PartitionIterator::begin( currentDevice );
|
||||
it != PartitionIterator::end( currentDevice ); ++it )
|
||||
|
@ -1353,7 +1363,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,9 @@
|
|||
// KPMcore
|
||||
#include <kpmcore/core/device.h>
|
||||
#include <kpmcore/core/partition.h>
|
||||
#ifdef WITH_KPMCOREGT33
|
||||
#include <kpmcore/core/softwareraid.h>
|
||||
#endif
|
||||
#include <kpmcore/ops/deactivatevolumegroupoperation.h>
|
||||
#include <kpmcore/ops/removevolumegroupoperation.h>
|
||||
|
||||
|
@ -146,6 +150,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 +165,20 @@ 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;
|
||||
|
||||
#ifdef WITH_KPMCOREGT33
|
||||
if ( device->type() == Device::Type::SoftwareRAID_Device &&
|
||||
static_cast< SoftwareRAID* >(device)->status() == SoftwareRAID::Status::Inactive )
|
||||
{
|
||||
createTable = false;
|
||||
create = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
currentDeviceIsVG = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue