Author: aschnell
Date: Thu Mar 29 18:34:11 2012
New Revision: 67832
URL: http://svn.opensuse.org/viewcvs/yast?rev=67832&view=rev
Log:
- improved mount checks and feedback during resize (bnc#732766)
Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/custom_part_check_generated.ycp
trunk/storage/storage/src/include/custom_part_dialogs.ycp
trunk/storage/storage/src/include/custom_part_lib.ycp
trunk/storage/storage/src/include/ep-dialogs.ycp
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=67832&r1=67831&r2=67832&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Thu Mar 29 18:34:11 2012
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Thu Mar 29 18:30:25 CEST 2012 - aschnell@suse.de
+
+- improved mount checks and feedback during resize (bnc#732766)
+
+-------------------------------------------------------------------
Thu Mar 29 12:14:35 CEST 2012 - fehr@suse.de
- patch proofread text back into ycp
Modified: trunk/storage/storage/src/include/custom_part_check_generated.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_check_generated.ycp?rev=67832&r1=67831&r2=67832&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_check_generated.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_check_generated.ycp Thu Mar 29 18:34:11 2012
@@ -585,49 +585,10 @@
if( !installation )
{
- string mounts = Storage::DeviceMounted( part_name );
- if( mounts != "" )
- {
- // popup text %1 is directory name
- string message = sformat(_("The selected device is currently mounted on %1.
-We *strongly* recommend to unmount it manually
-before deleting it.
-
-Click Cancel unless you know exactly what you are doing.
-
-If you proceed, YaST will try unmounting before deleting it.
-"), mounts );
-
-
- if( !Popup::ContinueCancel(message))
- {
- return false;
- }
- else
- {
- symbol ret = `none;
- do
- {
- if( !Storage::Umount( part_name ) )
- {
- // popup text %1 is directory name
- message = sformat(_("Unmount of %1 failed.
-Remove the device anyway?
-"), mounts );
- ret = Popup::AnyQuestion3( Label::WarningMsg(), message,
- Label::YesButton(),
- Label::NoButton(),
- // button text
- _("&Retry umount"),
- `focus_yes );
- }
- }
- while( ret == `retry );
- if( ret == `no )
- return false;
- }
- }
+ if (!TryUmount(part_name, _("It cannot be deleted while mounted."), true))
+ return false;
}
+
if( !installation && curr_part["type"]:`unknown==`logical )
{
boolean ok = true;
Modified: trunk/storage/storage/src/include/custom_part_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_dialogs.ycp?rev=67832&r1=67831&r2=67832&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_dialogs.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_dialogs.ycp Thu Mar 29 18:34:11 2012
@@ -1102,18 +1102,6 @@
return( ret );
}
-define void FsysCannotResizeMountPopup( boolean lvm, string mount )
- ``{
- // %1 is either replaced by "logical volume" or by "partition"
- string txt = sformat( _("
-The file system is currently mounted on %1.
-It is not possible to resize the file system while it is mounted.
-
-Unmount the file system and retry resizing.
-"),
- mount );
- Popup::Error( txt );
- }
define boolean FsysShrinkReiserWarning( boolean lvm )
``{
Modified: trunk/storage/storage/src/include/custom_part_lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_lib.ycp?rev=67832&r1=67831&r2=67832&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_lib.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_lib.ycp Thu Mar 29 18:34:11 2012
@@ -820,30 +820,81 @@
}
-define boolean CheckResizePossible( boolean ask, boolean lvm, integer resize,
- symbol fsys, string mount )
- ``{
- map poss = FileSystems::IsResizable( fsys );
+boolean TryUmount(string device, string text, boolean allow_ignore)
+{
+ while (true)
+ {
+ string mountpoint = Storage::DeviceMounted(device);
+ if (isempty(mountpoint))
+ return true;
+
+ if (allow_ignore)
+ {
+ string full_text = sformat(_("The file system is currently mounted on %1."), mountpoint) + "\n\n" +
+ _("You can try to unmount it now, continue without unmounting or cancel.
+Click Cancel unless you know exactly what you are doing.");
+
+ symbol ret = Popup::AnyQuestion3(Label::WarningMsg(), full_text,
+ Label::ContinueButton(),
+ Label::CancelButton(),
+ // button text
+ _("Unmount"),
+ `focus_no);
+
+ if (ret == `no)
+ return false;
+
+ if (ret == `yes)
+ return true;
+ }
+ else
+ {
+ string full_text = sformat(_("The file system is currently mounted on %1."), mountpoint) + "\n\n" +
+ _("You can try to unmount it now or cancel.
+Click Cancel unless you know exactly what you are doing.");
+
+ boolean ret = Popup::AnyQuestion(Label::WarningMsg(), full_text,
+ // button text
+ _("Unmount"),
+ Label::CancelButton(), `focus_no);
+
+ if (ret == false)
+ return false;
+ }
+
+ if (Storage::Umount(device))
+ return true;
+ }
+}
+
+
+boolean CheckResizePossible(string device, boolean ask, boolean lvm, integer resize,
+ symbol fsys)
+{
+ map