Author: kmachalkova Date: Wed Dec 17 18:22:29 2008 New Revision: 54245 URL: http://svn.opensuse.org/viewcvs/yast?rev=54245&view=rev Log: Suggest max size for extended partitions (custom value or custom region for the rest) + some additional focusing of widgets with failed validation Modified: branches/SuSE-Code-11-Branch/storage/storage/src/include/ep-hd-dialogs.ycp Modified: branches/SuSE-Code-11-Branch/storage/storage/src/include/ep-hd-dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/storage/storage/src/include/ep-hd-dialogs.ycp?rev=54245&r1=54244&r2=54245&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/storage/storage/src/include/ep-hd-dialogs.ycp (original) +++ branches/SuSE-Code-11-Branch/storage/storage/src/include/ep-hd-dialogs.ycp Wed Dec 17 18:22:29 2008 @@ -105,7 +105,19 @@ integer min_size_k = tointeger(float::ceil(cyl_size / 1024.0)); integer max_size_k = (slot[1]:0 * cyl_size) / 1024; - symbol what = (region == slot) ? `max_size : `manual_region; + symbol type = data["type"]:`unknown; + symbol what = `nothing; // ;-) + + //prefer max size for extended partition (#428337) + //cascaded triple operators would do, but this is more readable + if (region == slot) + { + what = (type == `extended) ? `max_size: `manual_size; + } + else + { + what = `manual_region; + } term contents = `HVSquash( // frame heading @@ -134,9 +146,10 @@ )); MiniWorkflow::SetContents(Greasemonkey::Transform(contents), MiniWorkflowStepPartitionSizeHelptext()); - MiniWorkflow::SetLastStep(data["type"]:`unknown == `extended); + MiniWorkflow::SetLastStep( type == `extended); UI::ChangeWidget(`id(`size), `Value, what); + UI::SetFocus(`id(what)); UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, what == `manual_size); UI::ChangeWidget(`id(`size_input), `Value, Storage::KByteToHumanString(size_k)); UI::ChangeWidget(`id(`manual_region_attachment), `Enabled, what == `manual_region); @@ -157,11 +170,13 @@ case `manual_size: UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, true); UI::ChangeWidget(`id(`manual_region_attachment), `Enabled, false); + UI::SetFocus(`id(`size_input)); break; case `manual_region: UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, false); UI::ChangeWidget(`id(`manual_region_attachment), `Enabled, true); + UI::SetFocus(`id(`end_cyl)); // or `start_cyl, who cares break; case `next: @@ -178,6 +193,7 @@ Popup::Error(sformat(_("The size entered is invalid. Enter a value like \"%1\" or \"%2\"."), Storage::KByteToHumanString(500*1024), Storage::KByteToHumanString(1024*1024))); + UI::SetFocus(`id(`size_input)); widget = `again; continue; } @@ -187,6 +203,7 @@ Popup::Error(sformat(_("The size entered is invalid. Enter a size between %1 and %2."), Storage::KByteToHumanString(min_size_k), Storage::KByteToHumanString(max_size_k))); + UI::SetFocus(`id(`size_input)); widget = `again; continue; } @@ -207,6 +224,7 @@ { // error popup Popup::Error(_("The region entered is invalid.")); + UI::SetFocus(`id(`end_cyl)); widget = `again; continue; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org