[yast-commit] r58239 - in /trunk/storage: package/yast2-storage.changes storage/src/include/ep-hd-lib.ycp

Author: aschnell Date: Fri Jul 31 12:52:33 2009 New Revision: 58239 URL: http://svn.opensuse.org/viewcvs/yast?rev=58239&view=rev Log: - readded warning when trying to edit/delete partitions used for installation (bug #445484) Modified: trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/include/ep-hd-lib.ycp Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.cha... ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Fri Jul 31 12:52:33 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Jul 31 12:50:36 CEST 2009 - aschnell@suse.de + +- readded warning when trying to edit/delete partitions used for + installation (bug #445484) + +------------------------------------------------------------------- Fri Jul 31 11:02:57 CEST 2009 - aschnell@suse.de - new module StorageUpdate with update related functions Modified: trunk/storage/storage/src/include/ep-hd-lib.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-hd... ============================================================================== --- trunk/storage/storage/src/include/ep-hd-lib.ycp (original) +++ trunk/storage/storage/src/include/ep-hd-lib.ycp Fri Jul 31 12:52:33 2009 @@ -238,9 +238,12 @@ } map<string, map> target_map = Storage::GetTargetMap(); - map<string, any> data = Storage::GetPartition(target_map, device); + map<string, any> part = Storage::GetPartition(target_map, device); - if (!isempty(data["used_by_device"]:"")) + if (!Storage::CanEdit(part, true)) + return; + + if (!isempty(part["used_by_device"]:"")) { // error popup, %1 is replace by partition device name e.g. /dev/sdb1 Popup::Error(sformat(_("The partition %1 is in use. It cannot be @@ -248,16 +251,16 @@ return; } - if (data["type"]:`primary == `extended) + if (part["type"]:`primary == `extended) { // error popup text Popup::Error(_("An extended partition cannot be edited.")); return; } - if (DlgEditPartition(data)) + if (DlgEditPartition(part)) { - Storage::ChangeVolumeProperties(data); + Storage::ChangeVolumeProperties(part); UpdateMainStatus(); UpdateNavigationTree(nil); @@ -278,7 +281,7 @@ map<string, map> target_map = Storage::GetTargetMap(); map<string, any> disk = Storage::GetDisk(target_map, device); - map<string, any> data = Storage::GetPartition(target_map, device); + map<string, any> part = Storage::GetPartition(target_map, device); if (disk["readonly"]:false) { @@ -286,7 +289,7 @@ return; } - if (!isempty(data["used_by_device"]:"")) + if (!isempty(part["used_by_device"]:"")) { // error popup, %1 is replace by partition device name, e.g. /dev/sdb1 Popup::Error(sformat(_("The partition %1 is in use. It cannot be @@ -294,17 +297,17 @@ return; } - if (data["type"]:`primary == `extended) + if (part["type"]:`primary == `extended) { // error popup text Popup::Error(_("An extended partition cannot be resized.")); return; } - //Need to pass data on the whole disk, to determine free/available space - if (DlgResizePartition(data, disk)) + // Need to pass data on the whole disk, to determine free/available space + if (DlgResizePartition(part, disk)) { - Storage::ResizePartition(device, disk["device"]:"error", data["region", 1]:0); + Storage::ResizePartition(device, disk["device"]:"error", part["region", 1]:0); UpdateMainStatus(); TreePanel::Create(); @@ -322,6 +325,13 @@ return; } + map<string, map> target_map = Storage::GetTargetMap(); + map<string, any> disk = Storage::GetDisk(target_map, device); + map<string, any> part = Storage::GetPartition(target_map, device); + + if (!Storage::CanDelete(part, disk, true)) + return; + string parent = ParentDevice(device); string next = NextDeviceAfterDelete(device); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org