Author: sh-sh-sh Date: Fri May 16 12:33:48 2008 New Revision: 47605 URL: http://svn.opensuse.org/viewcvs/yast?rev=47605&view=rev Log: Handle nonexistent widgets in UI::SetFocus() more gracefully 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/YCP_UI.cc Modified: trunk/ycp-ui-bindings/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/VERSION?rev=47605&r1=47604&r2=47605&view=diff ============================================================================== --- trunk/ycp-ui-bindings/VERSION (original) +++ trunk/ycp-ui-bindings/VERSION Fri May 16 12:33:48 2008 @@ -1 +1 @@ -2.16.46 +2.16.47 Modified: trunk/ycp-ui-bindings/examples/Events.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/examples/Events.ycp?rev=47605&r1=47604&r2=47605&view=diff ============================================================================== --- trunk/ycp-ui-bindings/examples/Events.ycp (original) +++ trunk/ycp-ui-bindings/examples/Events.ycp Fri May 16 12:33:48 2008 @@ -253,6 +253,10 @@ UI::ChangeWidget(`send_mafioso, `Value, nil ); UI::DumpWidgetTree(); } + else if ( event["ID"]:nil == `info ) + { + UI::SetFocus(`bogus); + } // // Help text is displayed automatically (because of `opt(`helpButton) // 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-ui-bindings.changes?rev=47605&r1=47604&r2=47605&view=diff ============================================================================== --- trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes (original) +++ trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes Fri May 16 12:33:48 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri May 16 12:32:24 CEST 2008 - sh@suse.de + +- Handle nonexistent widgets in UI::SetFocus() more gracefully + (bnc #389126) +- V 2.16.47 + +------------------------------------------------------------------- Wed Apr 30 15:08:14 CEST 2008 - lslezak@suse.cz - added support for `repoMgr option in Modified: trunk/ycp-ui-bindings/src/YCP_UI.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/src/YCP_UI.cc?rev=47605&r1=47604&r2=47605&view=diff ============================================================================== --- trunk/ycp-ui-bindings/src/YCP_UI.cc (original) +++ trunk/ycp-ui-bindings/src/YCP_UI.cc Fri May 16 12:33:48 2008 @@ -906,13 +906,25 @@ if ( ! YCPDialogParser::isSymbolOrId( idValue ) ) return YCPNull(); - YCPValue id = YCPDialogParser::parseIdTerm( idValue ); - YWidget *widget = YCPDialogParser::findWidgetWithId( id ); + YCPBoolean result = YCPNull(); + + try + { + YCPValue id = YCPDialogParser::parseIdTerm( idValue ); + YWidget * widget = YCPDialogParser::findWidgetWithId( id ); - if ( ! widget ) - return YCPBoolean( false ); + if ( ! widget ) + return YCPBoolean( false ); + + result = YCPBoolean( widget->setKeyboardFocus() ); + } + catch ( YUIException & exception ) + { + YUI_CAUGHT( exception ); + ycperror( "UI::SetFocus() failed" ); + } - return YCPBoolean( widget->setKeyboardFocus() ); + return result; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org