mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
[partition] Adding resizing, deactivating and removing procedures for LVM VGs.
This commit is contained in:
parent
98a158c6e5
commit
295e14530e
18 changed files with 738 additions and 41 deletions
62
src/modules/partition/gui/ResizeVolumeGroupDialog.cpp
Normal file
62
src/modules/partition/gui/ResizeVolumeGroupDialog.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ResizeVolumeGroupDialog.h"
|
||||
|
||||
#include "gui/ListPhysicalVolumeWidgetItem.h"
|
||||
|
||||
#include <kpmcore/core/lvmdevice.h>
|
||||
#include <kpmcore/util/capacity.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
#include <QListWidgetItem>
|
||||
#include <QSpinBox>
|
||||
|
||||
ResizeVolumeGroupDialog::ResizeVolumeGroupDialog( LvmDevice *device,
|
||||
QVector< const Partition* > availablePVs,
|
||||
QVector< const Partition* >& selectedPVs,
|
||||
QWidget* parent )
|
||||
: VolumeGroupBaseDialog( device->name(), device->physicalVolumes(), parent )
|
||||
, m_selectedPVs( selectedPVs )
|
||||
{
|
||||
setWindowTitle( "Resize Volume Group" );
|
||||
|
||||
for ( int i = 0; i < pvList()->count(); i++ )
|
||||
pvList()->item(i)->setCheckState( Qt::Checked );
|
||||
|
||||
for ( const Partition* p : availablePVs )
|
||||
pvList()->addItem( new ListPhysicalVolumeWidgetItem( p, false ) );
|
||||
|
||||
peSize()->setValue( device->peSize() / Capacity::unitFactor(Capacity::Unit::Byte, Capacity::Unit::MiB) );
|
||||
|
||||
vgName()->setEnabled( false );
|
||||
peSize()->setEnabled( false );
|
||||
vgType()->setEnabled( false );
|
||||
|
||||
setUsedSizeValue( device->allocatedPE() * device->peSize() );
|
||||
setLVQuantity( device->partitionTable()->children().count() );
|
||||
}
|
||||
|
||||
void
|
||||
ResizeVolumeGroupDialog::accept()
|
||||
{
|
||||
m_selectedPVs << checkedItems();
|
||||
|
||||
QDialog::accept();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue