Showing SoftwareRAID device properties and allowing to create RAID device partition table.

This commit is contained in:
Caio Carvalho 2018-07-11 12:23:10 -03:00
parent e7589702b9
commit a606306e79
3 changed files with 13 additions and 1 deletions

View File

@ -129,6 +129,8 @@ void DevicePropsDialog::setupDialog()
} else {
if (device().type() == Device::Type::LVM_Device)
dialogWidget().type().setText(xi18nc("@label device", "LVM Volume Group"));
else if (device().type() == Device::Type::SoftwareRAID_Device)
dialogWidget().type().setText(xi18nc("@label device", "Software RAID Device"));
else
dialogWidget().type().setText(xi18nc("@label device", "Volume Manager Device"));
//TODO: add Volume Manger Device info

View File

@ -22,6 +22,7 @@
#include <core/diskdevice.h>
#include <core/lvmdevice.h>
#include <core/partition.h>
#include <core/softwareraid.h>
#include <fs/filesystem.h>
#include <fs/luks.h>
@ -193,6 +194,14 @@ void InfoPane::showDevice(Qt::DockWidgetArea area, const Device& d)
createLabels(i18nc("@label device", "Total PE:"),QString::number(lvm.totalPE()), cols(area), x, y);
createLabels(i18nc("@label device", "Allocated PE:"), QString::number(lvm.allocatedPE()), cols(area), x, y);
createLabels(i18nc("@label device", "Free PE:"), QString::number(lvm.freePE()), cols(area), x, y);
} else if (d.type() == Device::Type::SoftwareRAID_Device) {
const SoftwareRAID& raid = dynamic_cast<const SoftwareRAID&>(d);
createLabels(i18nc("@label device", "Volume Type:"), QStringLiteral("RAID"), cols(area), x, y);
createLabels(i18nc("@label device", "Capacity:"), Capacity::formatByteSize(raid.capacity()), cols(area), x, y);
createLabels(i18nc("@label device", "RAID Level:"), QString::number(raid.raidLevel()), cols(area), x, y);
createLabels(i18nc("@label device", "Chunk Size:"),Capacity::formatByteSize(raid.chunkSize()), cols(area), x, y);
createLabels(i18nc("@label device", "Total Chunk:"), Capacity::formatByteSize(raid.totalChunk()), cols(area), x, y);
createLabels(i18nc("@label device", "Array Size:"), Capacity::formatByteSize(raid.arraySize()), cols(area), x, y);
}
}

View File

@ -484,7 +484,8 @@ void MainWindow::enableActions()
actionCollection()->action(QStringLiteral("createNewPartitionTable"))
->setEnabled(CreatePartitionTableOperation::canCreate(pmWidget().selectedDevice()));
actionCollection()->action(QStringLiteral("createNewPartitionTable"))
->setVisible(pmWidget().selectedDevice() && pmWidget().selectedDevice()->type() == Device::Type::Disk_Device);
->setVisible(pmWidget().selectedDevice() && (pmWidget().selectedDevice()->type() == Device::Type::Disk_Device ||
pmWidget().selectedDevice()->type() == Device::Type::SoftwareRAID_Device));
actionCollection()->action(QStringLiteral("exportPartitionTable"))
->setEnabled(pmWidget().selectedDevice() &&
pmWidget().selectedDevice()->partitionTable() &&