Author: sh-sh-sh Date: Thu Apr 3 15:25:40 2008 New Revision: 46033 URL: http://svn.opensuse.org/viewcvs/yast?rev=46033&view=rev Log: help handling Modified: trunk/ycp-ui-bindings/VERSION trunk/ycp-ui-bindings/examples/Events.ycp trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes trunk/ycp-ui-bindings/src/YCPDialogParser.cc trunk/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in Modified: trunk/ycp-ui-bindings/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/VERSION?rev=46033... ============================================================================== --- trunk/ycp-ui-bindings/VERSION (original) +++ trunk/ycp-ui-bindings/VERSION Thu Apr 3 15:25:40 2008 @@ -1 +1 @@ -2.16.40 +2.16.41 Modified: trunk/ycp-ui-bindings/examples/Events.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/examples/Events.y... ============================================================================== --- trunk/ycp-ui-bindings/examples/Events.ycp (original) +++ trunk/ycp-ui-bindings/examples/Events.ycp Thu Apr 3 15:25:40 2008 @@ -201,7 +201,7 @@ `RichText(`id(`event_display), event_display ) ), `HBox( - `PushButton(`id(`help), "&Help" ), + `PushButton(`id(`help), `opt(`helpButton), "&Help" ), `HStretch(), `PushButton(`id(`close), "C&lose" ) ) @@ -253,14 +253,17 @@ UI::ChangeWidget(`send_mafioso, `Value, nil ); UI::DumpWidgetTree(); } - else if ( event["ID"]:nil == `help ) - { - string helpText = (string) UI::QueryWidget(`mainLayout, `HelpText ); - UI::OpenDialog(`VBox(`MinSize( 35, 7, `RichText( helpText ) ), - `PushButton("&OK" ) ) ); - UI::UserInput(); - UI::CloseDialog(); - } + // + // Help text is displayed automatically (because of `opt(`helpButton) + // + // else if ( event["ID"]:nil == `help ) + // { + // string helpText = (string) UI::QueryWidget(`mainLayout, `HelpText ); + // UI::OpenDialog(`VBox(`MinSize( 35, 7, `RichText( helpText ) ), + // `PushButton("&OK" ) ) ); + // UI::UserInput(); + // UI::CloseDialog(); + // } else if ( event["ID"]:nil == `cancel_order ) { y2milestone( "Cancelling order" ); Modified: trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/package/yast2-ycp... ============================================================================== --- trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes (original) +++ trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes Thu Apr 3 15:25:40 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Apr 3 15:25:08 CEST 2008 - sh@suse.de + +- Added `opt(`helpButton) for PushButton widgets +- V 2.16.41 + +------------------------------------------------------------------- Wed Mar 26 17:14:18 CET 2008 - sh@suse.de - Added UI::TextMode() (bnc #222948) Modified: trunk/ycp-ui-bindings/src/YCPDialogParser.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/src/YCPDialogPars... ============================================================================== --- trunk/ycp-ui-bindings/src/YCPDialogParser.cc (original) +++ trunk/ycp-ui-bindings/src/YCPDialogParser.cc Thu Apr 3 15:25:40 2008 @@ -1147,6 +1147,7 @@ * @arg string iconName (IconButton only) * @arg string label * @option default makes this button the dialogs default button + * @option helpButton automatically shows topmost `HelpText * @usage `PushButton( `id( `click ), `opt( `default, `hstretch ), "Click me" ) * @examples PushButton1.ycp PushButton2.ycp IconButton1.ycp * @@ -1170,6 +1171,15 @@ * Icons are (at the time of this writing) loaded from the <em>theme</em> * directory, /usr/share/YaST2/theme/current. * + * If a button has `opt(`helpButton) set, it is the official help button of + * this dialog. When activated, this will open a new dialog with the topmost + * help text in this dialog (the topmost widget that has a property `HelpText) + * in a pop-up dialog with a local event loop. Note that this is not done + * during UI::PollInput() to prevent the application from blocking as long as + * the help dialog is open. + * + * Since a help button is handled internally by the UI, UI::UserInput() and + * related will never return this button's ID. **/ YWidget * @@ -1180,6 +1190,7 @@ string label; string iconName; bool isDefaultButton = false; + bool isHelpButton = false; if ( isIconButton ) { @@ -1212,7 +1223,8 @@ { string sym = optList->value(o)->asSymbol()->symbol(); - if ( sym == YUIOpt_default ) isDefaultButton = true; + if ( sym == YUIOpt_default ) isDefaultButton = true; + if ( sym == YUIOpt_helpButton ) isHelpButton = true; else logUnknownOption( term, optList->value(o) ); } else logUnknownOption( term, optList->value(o) ); @@ -1223,6 +1235,9 @@ if ( isDefaultButton ) button->setDefaultButton(); + if ( isHelpButton ) + button->setHelpButton(); + if ( isIconButton ) button->setIcon( iconName ); Modified: trunk/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/yast2-ycp-ui-bind... ============================================================================== --- trunk/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in (original) +++ trunk/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in Thu Apr 3 15:25:40 2008 @@ -19,8 +19,8 @@ # libycp includes crypto built-ins BuildRequires: libxcrypt-devel -Requires: yast2-libyui >= 2.16.39 -BuildRequires: yast2-libyui-devel >= 2.16.39 +Requires: yast2-libyui >= 2.16.41 +BuildRequires: yast2-libyui-devel >= 2.16.41 # libyui ImplPtr BuildRequires: boost-devel -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org