Showing SoftwareRAID device properties and allowing to create RAID device partition table.
This commit is contained in:
parent
e7589702b9
commit
a606306e79
|
@ -129,6 +129,8 @@ void DevicePropsDialog::setupDialog()
|
||||||
} else {
|
} else {
|
||||||
if (device().type() == Device::Type::LVM_Device)
|
if (device().type() == Device::Type::LVM_Device)
|
||||||
dialogWidget().type().setText(xi18nc("@label device", "LVM Volume Group"));
|
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
|
else
|
||||||
dialogWidget().type().setText(xi18nc("@label device", "Volume Manager Device"));
|
dialogWidget().type().setText(xi18nc("@label device", "Volume Manager Device"));
|
||||||
//TODO: add Volume Manger Device info
|
//TODO: add Volume Manger Device info
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <core/diskdevice.h>
|
#include <core/diskdevice.h>
|
||||||
#include <core/lvmdevice.h>
|
#include <core/lvmdevice.h>
|
||||||
#include <core/partition.h>
|
#include <core/partition.h>
|
||||||
|
#include <core/softwareraid.h>
|
||||||
|
|
||||||
#include <fs/filesystem.h>
|
#include <fs/filesystem.h>
|
||||||
#include <fs/luks.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", "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", "Allocated PE:"), QString::number(lvm.allocatedPE()), cols(area), x, y);
|
||||||
createLabels(i18nc("@label device", "Free PE:"), QString::number(lvm.freePE()), 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -484,7 +484,8 @@ void MainWindow::enableActions()
|
||||||
actionCollection()->action(QStringLiteral("createNewPartitionTable"))
|
actionCollection()->action(QStringLiteral("createNewPartitionTable"))
|
||||||
->setEnabled(CreatePartitionTableOperation::canCreate(pmWidget().selectedDevice()));
|
->setEnabled(CreatePartitionTableOperation::canCreate(pmWidget().selectedDevice()));
|
||||||
actionCollection()->action(QStringLiteral("createNewPartitionTable"))
|
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"))
|
actionCollection()->action(QStringLiteral("exportPartitionTable"))
|
||||||
->setEnabled(pmWidget().selectedDevice() &&
|
->setEnabled(pmWidget().selectedDevice() &&
|
||||||
pmWidget().selectedDevice()->partitionTable() &&
|
pmWidget().selectedDevice()->partitionTable() &&
|
||||||
|
|
Loading…
Reference in New Issue