Permalink
Browse files

Merge remote-tracking branch 'origin/update-lvm-support'

  • Loading branch information...
adriaandegroot committed Aug 8, 2018
2 parents b6077ce + ba639be commit 3b82e655d720179fe62901a620eb0796f50ef1d5
Showing with 1,736 additions and 13 deletions.
  1. +13 −0 src/modules/partition/CMakeLists.txt
  2. +41 −4 src/modules/partition/core/DeviceModel.cpp
  3. +4 −0 src/modules/partition/core/DeviceModel.h
  4. +236 −4 src/modules/partition/core/PartitionCoreModule.cpp
  5. +22 −0 src/modules/partition/core/PartitionCoreModule.h
  6. +4 −0 src/modules/partition/core/PartitionInfo.cpp
  7. +56 −0 src/modules/partition/gui/CreateVolumeGroupDialog.cpp
  8. +41 −0 src/modules/partition/gui/CreateVolumeGroupDialog.h
  9. +36 −0 src/modules/partition/gui/ListPhysicalVolumeWidgetItem.cpp
  10. +37 −0 src/modules/partition/gui/ListPhysicalVolumeWidgetItem.h
  11. +140 −3 src/modules/partition/gui/PartitionPage.cpp
  12. +4 −0 src/modules/partition/gui/PartitionPage.h
  13. +34 −2 src/modules/partition/gui/PartitionPage.ui
  14. +62 −0 src/modules/partition/gui/ResizeVolumeGroupDialog.cpp
  15. +40 −0 src/modules/partition/gui/ResizeVolumeGroupDialog.h
  16. +184 −0 src/modules/partition/gui/VolumeGroupBaseDialog.cpp
  17. +81 −0 src/modules/partition/gui/VolumeGroupBaseDialog.h
  18. +206 −0 src/modules/partition/gui/VolumeGroupBaseDialog.ui
  19. +84 −0 src/modules/partition/jobs/CreateVolumeGroupJob.cpp
  20. +47 −0 src/modules/partition/jobs/CreateVolumeGroupJob.h
  21. +69 −0 src/modules/partition/jobs/DeactivateVolumeGroupJob.cpp
  22. +40 −0 src/modules/partition/jobs/DeactivateVolumeGroupJob.h
  23. +66 −0 src/modules/partition/jobs/RemoveVolumeGroupJob.cpp
  24. +40 −0 src/modules/partition/jobs/RemoveVolumeGroupJob.h
  25. +101 −0 src/modules/partition/jobs/ResizeVolumeGroupJob.cpp
  26. +48 −0 src/modules/partition/jobs/ResizeVolumeGroupJob.h
@@ -12,6 +12,10 @@ set_package_properties(
)
if ( KPMcore_FOUND )
if ( KPMcore_VERSION VERSION_GREATER "3.3.0")
add_definitions(-DWITH_KPMCOREGT33) # kpmcore greater than 3.3
endif()
include_directories( ${KPMCORE_INCLUDE_DIR} )
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
@@ -35,9 +39,11 @@ if ( KPMcore_FOUND )
gui/BootInfoWidget.cpp
gui/ChoicePage.cpp
gui/CreatePartitionDialog.cpp
gui/CreateVolumeGroupDialog.cpp
gui/DeviceInfoWidget.cpp
gui/EditExistingPartitionDialog.cpp
gui/EncryptWidget.cpp
gui/ListPhysicalVolumeWidgetItem.cpp
gui/PartitionPage.cpp
gui/PartitionBarsView.cpp
gui/PartitionDialogHelpers.cpp
@@ -46,17 +52,23 @@ if ( KPMcore_FOUND )
gui/PartitionSplitterWidget.cpp
gui/PartitionViewStep.cpp
gui/PrettyRadioButton.cpp
gui/ResizeVolumeGroupDialog.cpp
gui/ScanningDialog.cpp
gui/ReplaceWidget.cpp
gui/VolumeGroupBaseDialog.cpp
jobs/ClearMountsJob.cpp
jobs/ClearTempMountsJob.cpp
jobs/CreatePartitionJob.cpp
jobs/CreatePartitionTableJob.cpp
jobs/CreateVolumeGroupJob.cpp
jobs/DeactivateVolumeGroupJob.cpp
jobs/DeletePartitionJob.cpp
jobs/FillGlobalStorageJob.cpp
jobs/FormatPartitionJob.cpp
jobs/PartitionJob.cpp
jobs/RemoveVolumeGroupJob.cpp
jobs/ResizePartitionJob.cpp
jobs/ResizeVolumeGroupJob.cpp
jobs/SetPartitionFlagsJob.cpp
UI
gui/ChoicePage.ui
@@ -66,6 +78,7 @@ if ( KPMcore_FOUND )
gui/EncryptWidget.ui
gui/PartitionPage.ui
gui/ReplaceWidget.ui
gui/VolumeGroupBaseDialog.ui
LINK_PRIVATE_LIBRARIES
kpmcore
calamaresui
@@ -29,6 +29,7 @@
// KF5
#include <KFormat>
#include <QStandardItemModel>
#include <QIcon>
// STL
@@ -77,10 +78,18 @@ DeviceModel::data( const QModelIndex& index, int role ) const
if ( device->name().isEmpty() )
return device->deviceNode();
else
return tr( "%1 - %2 (%3)" )
.arg( device->name() )
.arg( KFormat().formatByteSize( device->capacity() ) )
.arg( device->deviceNode() );
{
if ( device->logicalSize() >= 0 && device->totalLogical() >= 0 )
return tr( "%1 - %2 (%3)" )
.arg( device->name() )
.arg( KFormat().formatByteSize( device->capacity() ) )
.arg( device->deviceNode() );
// Newly LVM VGs don't have capacity property yet (i.e. always has 1B capacity), so don't show it for a while
else
return tr( "%1 - (%2)" )
.arg( device->name() )
.arg( device->deviceNode() );
}
case Qt::DecorationRole:
return CalamaresUtils::defaultPixmap( CalamaresUtils::PartitionDisk,
CalamaresUtils::Original,
@@ -116,3 +125,31 @@ DeviceModel::swapDevice( Device* oldDevice, Device* newDevice )
emit dataChanged( index( indexOfOldDevice ), index( indexOfOldDevice ) );
}
void
DeviceModel::addDevice( Device *device )
{
beginResetModel();
m_devices << device;
std::sort( m_devices.begin(), m_devices.end(), []( const Device* dev1, const Device* dev2 )
{
return dev1->deviceNode() < dev2->deviceNode();
} );
endResetModel();
}
void
DeviceModel::removeDevice( Device *device )
{
beginResetModel();
m_devices.removeAll( device );
std::sort( m_devices.begin(), m_devices.end(), []( const Device* dev1, const Device* dev2 )
{
return dev1->deviceNode() < dev2->deviceNode();
} );
endResetModel();
}
@@ -49,6 +49,10 @@ class DeviceModel : public QAbstractListModel
void swapDevice( Device* oldDevice, Device* newDevice );
void addDevice( Device* device );
void removeDevice( Device* device );
private:
QList< Device* > m_devices;
};
Oops, something went wrong.

0 comments on commit 3b82e65

Please sign in to comment.