[yast-commit] r65586 - /trunk/storage/storage/src/include/custom_part_lib.ycp
Author: aschnell Date: Tue Sep 6 18:02:37 2011 New Revision: 65586 URL: http://svn.opensuse.org/viewcvs/yast?rev=65586&view=rev Log: - warn user about illegal file system id Modified: trunk/storage/storage/src/include/custom_part_lib.ycp 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=65586&r1=65585&r2=65586&view=diff ============================================================================== --- trunk/storage/storage/src/include/custom_part_lib.ycp (original) +++ trunk/storage/storage/src/include/custom_part_lib.ycp Tue Sep 6 18:02:37 2011 @@ -715,16 +715,25 @@ { //////////////////////////////////////////////// // modify map new - string fs_string = (string)UI::QueryWidget(`id(`fsid_point), `Value); + string fs_string = String::CutBlanks((string) UI::QueryWidget(`id(`fsid_point), `Value)); y2milestone("HandlePartWidgetChanges fs_string:%1", fs_string ); - fs_string = substring( fs_string, 0, 5 ); - integer fs_int = tointeger( fs_string ); - integer old_id = new["fsid"]:0; - y2milestone( "HandlePartWidgetChanges fs_int:%1 old_id:%2", - fs_int, old_id ); + integer pos = search(fs_string, " "); + if (pos != nil) + fs_string = substring(fs_string, 0, pos); - if( fs_int != old_id ) + integer fs_int = tointeger(fs_string); + if (!isempty(fs_string) && fs_int == nil) + { + // error popup text + Popup::Error(_("Illegal file system ID.")); + } + + integer old_id = new["fsid"]:0; + + y2milestone( "HandlePartWidgetChanges fs_int:%1 old_id:%2", fs_int, old_id ); + + if (fs_int != nil && fs_int != old_id) { new["fsid"] = fs_int; boolean no_fs = contains( [ Partitions::fsid_lvm, -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn2.opensuse.org