[yast-commit] r60461 - in /trunk/printer/src: basicadd.ycp basicmodify.ycp
Author: jsmeix Date: Wed Jan 20 16:18:24 2010 New Revision: 60461 URL: http://svn.opensuse.org/viewcvs/yast?rev=60461&view=rev Log: Fixed search usability in basicadd.ycp and basicmodify.ycp in each run of the user input while loop directly before UI::UserInput() by first replacing the [Search for] button with itself with `opt(`default) to enforce this default regardless whatever function call or UI bug may have changed it and then setting the focus to the InputField for the driver search string so that the user can just start typing (it does not work the other way round, i.e. first set the focus then the default widget because it seems setting the default widget sets also the focus to it). Modified: trunk/printer/src/basicadd.ycp trunk/printer/src/basicmodify.ycp Modified: trunk/printer/src/basicadd.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/basicadd.ycp?rev=60461&r1=60460&r2=60461&view=diff ============================================================================== --- trunk/printer/src/basicadd.ycp (original) +++ trunk/printer/src/basicadd.ycp Wed Jan 20 16:18:24 2010 @@ -134,18 +134,21 @@ ) ), `HBox - ( `PushButton - ( `id(`apply_driver_filter), - // This button must be the default - // (it is activated when the user pressed the Enter key) - // because when the user has clicked into TextEntry to enter something - // it is normal to finish entering by pressing the Enter key - // but if the Enter key was linked to 'Next' or 'Back', - // the user would get the wrong action. - `opt(`default), - // Label of a PushButton to search a list for a search string - // and then show the search result: - _("&Search for") + ( `ReplacePoint + ( `id(`apply_driver_filter_replace_point), + `PushButton + ( `id(`apply_driver_filter), + // This button must be the default + // (it is activated when the user pressed the Enter key) + // because when the user has clicked into InputField to enter something + // it is normal to finish entering by pressing the Enter key + // but if the Enter key was linked to 'Next' or 'Back', + // the user would get the wrong action. + `opt(`default), + // Label of a PushButton to search a list for a search string + // and then show the search result: + _("&Search for") + ) ), `ReplacePoint ( `id(`driver_filter_input_replace_point), @@ -274,13 +277,28 @@ UI::FakeUserInput( `connection_selection ); any user_input = nil; while( true ) - { // The [Search for] button must be the default - // (it is activated when the user pressed the Enter key) - // because when the user has clicked into TextEntry to enter something - // it is normal to finish entering by pressing the Enter key - // but if the Enter key was linked to 'Next' or 'Back', - // the user would get the wrong action. - UI::SetFocus( `apply_driver_filter ); + { // Replace the [Search for] button with itself to enforce it is the default widget + // (the default widget is the result of UI::UserInput when the user pressed the Enter key) + // regardless whatever function call or UI bug (e.g. bnc#558900) may have changed the default widget: + UI::ReplaceWidget( `id(`apply_driver_filter_replace_point), + `PushButton + ( `id(`apply_driver_filter), + // This button must be the default + // (it is activated when the user pressed the Enter key) + // because when the user has clicked into InputField to enter something + // it is normal to finish entering by pressing the Enter key + // but if the Enter key was linked to 'Next' or 'Back', + // the user would get the wrong action. + `opt(`default), + // Label of a PushButton to search a list for a search string + // and then show the search result: + _("&Search for") + ) + ); + // Set the focus to the InputField for the driver search string + // so that the user can just start typing: + UI::SetFocus( `driver_filter_input ); + // Wait for user input: user_input = UI::UserInput(); if( `abort == user_input || `cancel == user_input || `back == user_input ) break; if( `next == user_input ) Modified: trunk/printer/src/basicmodify.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/basicmodify.ycp?rev=60461&r1=60460&r2=60461&view=diff ============================================================================== --- trunk/printer/src/basicmodify.ycp (original) +++ trunk/printer/src/basicmodify.ycp Wed Jan 20 16:18:24 2010 @@ -337,18 +337,21 @@ ) ), `HBox - ( `PushButton - ( `id(`apply_driver_filter), - // This button must be the default - // (it is activated when the user pressed the Enter key) - // because when the user has clicked into TextEntry to enter something - // it is normal to finish entering by pressing the Enter key - // but if the Enter key was linked to 'Next' or 'Back', - // the user would get the wrong action. - `opt(`default), - // Label of a PushButton to search a list for a search string - // and then show the search result: - _("&Search for") + ( `ReplacePoint + ( `id(`apply_driver_filter_replace_point), + `PushButton + ( `id(`apply_driver_filter), + // This button must be the default + // (it is activated when the user pressed the Enter key) + // because when the user has clicked into InputField to enter something + // it is normal to finish entering by pressing the Enter key + // but if the Enter key was linked to 'Next' or 'Back', + // the user would get the wrong action. + `opt(`default), + // Label of a PushButton to search a list for a search string + // and then show the search result: + _("&Search for") + ) ), `ReplacePoint ( `id(`driver_filter_input_replace_point), @@ -472,13 +475,28 @@ } any user_input = nil; while( true ) - { // The [Search for] button must be the default - // (it is activated when the user pressed the Enter key) - // because when the user has clicked into TextEntry to enter something - // it is normal to finish entering by pressing the Enter key - // but if the Enter key was linked to 'Next' or 'Back', - // the user would get the wrong action. - UI::SetFocus( `apply_driver_filter ); + { // Replace the [Search for] button with itself to enforce it is the default widget + // (the default widget is the result of UI::UserInput when the user pressed the Enter key) + // regardless whatever function call or UI bug (e.g. bnc#558900) may have changed the default widget: + UI::ReplaceWidget( `id(`apply_driver_filter_replace_point), + `PushButton + ( `id(`apply_driver_filter), + // This button must be the default + // (it is activated when the user pressed the Enter key) + // because when the user has clicked into InputField to enter something + // it is normal to finish entering by pressing the Enter key + // but if the Enter key was linked to 'Next' or 'Back', + // the user would get the wrong action. + `opt(`default), + // Label of a PushButton to search a list for a search string + // and then show the search result: + _("&Search for") + ) + ); + // Set the focus to the InputField for the driver search string + // so that the user can just start typing: + UI::SetFocus( `driver_filter_input ); + // Wait for user input: user_input = UI::UserInput(); if( `abort == user_input || `cancel == user_input || `back == user_input ) break; if( `next == user_input ) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsmeix@svn.opensuse.org