[yast-commit] r46451 - in /trunk/yast2: library/wizard/src/Wizard.ycp package/yast2.changes
Author: locilka Date: Fri Apr 11 18:37:42 2008 New Revision: 46451 URL: http://svn.opensuse.org/viewcvs/yast?rev=46451&view=rev Log: - New Wizard::OpenOKDialog() (FATE #120373). Modified: trunk/yast2/library/wizard/src/Wizard.ycp trunk/yast2/package/yast2.changes Modified: trunk/yast2/library/wizard/src/Wizard.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/wizard/src/Wizard.ycp?rev=46451&r1=46450&r2=46451&view=diff ============================================================================== --- trunk/yast2/library/wizard/src/Wizard.ycp (original) +++ trunk/yast2/library/wizard/src/Wizard.ycp Fri Apr 11 18:37:42 2008 @@ -113,6 +113,19 @@ ); } + /** + * Returns a button box with buttons "Cancel", "OK" + * @return a widget tree + **/ + global term CancelOKButtonBox() { + return `HBox( + `HWeight(1, `Empty() ), // Layout trick to make sure the center button is centered + `HStretch(), + `HWeight(1, `PushButton(`id(`cancel ), `opt (`key_F9), Label::CancelButton() ) ), + `HStretch(), + `HWeight(1, `PushButton(`id(`ok ), `opt (`key_F10, `default), Label::OKButton() ) ) + ); + } /** * Returns a button box with buttons "Abort", "Accept" @@ -254,6 +267,16 @@ return GenericDialog( CancelAcceptButtonBox() ); } + /** + * Returns a standard wizard dialog with buttons "Cancel", "OK" + * + * @stable + * + * @return term describing the dialog. + **/ + global term OKDialog() { + return GenericDialog( CancelOKButtonBox() ); + } /** * Open any wizard dialog. @@ -311,6 +334,29 @@ } } + /** + * Open a dialog with "OK", "Cancel" + * and set the keyboard focus to "OK". + **/ + global void OpenOKDialog() + { + if ( haveFancyUI() ) + { + UI::OpenDialog(`opt(`defaultsize ), + `Wizard(`no_back_button, "", + `cancel, Label::CancelButton(), + `ok, Label::OKButton() ) ); + + // Don't let sloppy calls to Wizard::SetContents() disable this button by accident + UI::WizardCommand(`ProtectNextButton( true ) ); + } + else + { + Wizard::OpenDialog( OKDialog() ); + UI::SetFocus(`id(`ok) ); + } + } + /** * Open a dialog with "Accept", "Cancel" Modified: trunk/yast2/package/yast2.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=46451&r1=46450&r2=46451&view=diff ============================================================================== --- trunk/yast2/package/yast2.changes (original) +++ trunk/yast2/package/yast2.changes Fri Apr 11 18:37:42 2008 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Fri Apr 11 18:38:02 CEST 2008 - locilka@suse.cz + +- New Wizard::OpenOKDialog() (FATE #120373). + +------------------------------------------------------------------- Fri Apr 11 10:50:20 CEST 2008 - mvidner@suse.cz - FileChanges::FileChangedFromPackage: fixed to actually consider the -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn.opensuse.org