Author: aschnell
Date: Thu Nov 6 16:24:49 2008
New Revision: 53001
URL: http://svn.opensuse.org/viewcvs/yast?rev=53001&view=rev
Log:
- some final (joke) resize improvments
Modified:
trunk/storage/storage/src/include/ep-dialogs.ycp
trunk/storage/storage/src/include/ep-lvm-lib.ycp
Modified: trunk/storage/storage/src/include/ep-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-dialogs.ycp?rev=53001&r1=53000&r2=53001&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-dialogs.ycp Thu Nov 6 16:24:49 2008
@@ -502,6 +502,19 @@
{
map target_map = Storage::GetTargetMap();
+
+ map possible = Storage::IsResizable(data);
+ if (!data["format"]:false && !possible["shrink"]:false && !possible["extend"]:false)
+ {
+ // popup text
+ Popup::Message(_("
+You cannot resize the selected partition because the file system
+on this partition does not support resizing.
+"));
+ return false;
+ }
+
+
integer cyl_size = disk["cyl_size"]:1;
integer free_cyl_after = Storage::FreeCylAfter(disk, data);
@@ -510,11 +523,19 @@
integer used_k = FileSystems::MinFsSizeK(used_fs);
- if (!data["create"]:false)
+ if (!data["format"]:false)
{
if (used_fs != `swap)
{
map free_data = Storage::GetFreeSpace(device, 0, used_fs, true);
+ if (size(free_data) == 0 || !free_data["ok"]:false)
+ {
+ y2error("Failed to retrieve FreeSpace %1, filesystem %2", device, data["used_fs"]:`none);
+ //FIXME: Really?
+ Popup::Error(sformat(_("Partition %1 cannot be resized\nbecause the filesystem seems to be inconsistent"), device));
+ return false;
+ }
+
used_k = Integer::Max([ used_k, free_data["used"]:0 / 1024 ]);
}
}
@@ -601,17 +622,6 @@
// Heading for dialog
heading = sformat(_("Resize Partition %1"), device);
- /*
- if (size( size_data ) == 0 || !size_data["ok"]:false)
- {
- y2error("Failed to retrieve FreeSpace %1, filesystem %2", device, data["used_fs"]:`none);
- //FIXME: Really?
- Popup::Error( sformat( _("Partition %1 cannot be resized\nbecause the filesystem seems to be inconsistent"), device ));
- return false;
- }
- }
- */
-
min_size_k = Integer::Max([ min_size_k, cyl_size / 1024 ]);
max_size_k = (cyl_size * free_cyl_after) / 1024;
}
Modified: trunk/storage/storage/src/include/ep-lvm-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lvm-lib.ycp?rev=53001&r1=53000&r2=53001&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-lvm-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-lvm-lib.ycp Thu Nov 6 16:24:49 2008
@@ -242,17 +242,6 @@
map lv_data = Storage::GetPartition(target_map, device);
map vg_data = Storage::GetDisk(target_map, device);
- map possible = Storage::IsResizable(lv_data);
- if (!lv_data["format"]:false && !possible["shrink"]:false && !possible["extend"]:false)
- {
- // popup text
- Popup::Message(_("
-You cannot resize the selected partition because the file system
-on this partition does not support resizing.
-"));
- return;
- }
-
if (DlgResizeLogicalVolumeNew(lv_data, vg_data))
{
Storage::ResizeVolume(device, vg_data["device"]:"error", lv_data["size_k"]:0);
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org