Display warning message when trying to remove VG with existing LV.

This commit is contained in:
Chantara Tith 2016-07-16 05:10:55 +07:00 committed by Andrius Štikonas
parent 5f364befd8
commit 100277b0e1
1 changed files with 5 additions and 1 deletions

View File

@ -1073,7 +1073,11 @@ void MainWindow::onRemoveVolumeGroup()
{
Device* tmpDev = pmWidget().selectedDevice();
if (tmpDev->type() == Device::LVM_Device) {
operationStack().push(new RemoveVolumeGroupOperation( *(dynamic_cast<LvmDevice*>(tmpDev)) ));
if (LvmDevice::getLVs(tmpDev->name()).count()) {
KMessageBox::error(this, xi18nc("@info", "Could not remove <filename>%1</filename>. There are still Logical Volumes on the Volume Group.", tmpDev->name()), i18nc("@title:window", "Error Removing Volume Group"));
} else {
operationStack().push(new RemoveVolumeGroupOperation( *(dynamic_cast<LvmDevice*>(tmpDev)) ));
}
}
}