# # # patch "lib/perl/FindFiles.pm" # from [9b922ea5249ac3d0a7ed34ab6546aa3905063edc] # to [e597fc549bb07ff954304865451efdb25b94fc47] # # patch "lib/perl/Preferences.pm" # from [c6fc2f1148d3f22fb064cfa27ad7fec2174ca351] # to [cc6cf881c0843db848e916482b81fd9891968125] # ============================================================ --- lib/perl/FindFiles.pm 9b922ea5249ac3d0a7ed34ab6546aa3905063edc +++ lib/perl/FindFiles.pm e597fc549bb07ff954304865451efdb25b94fc47 @@ -1221,23 +1221,14 @@ sub save_query_from_gui($) else { - # The following fix is needed so as to get the correct value out of - # the spinbutton. There seems to be a bug with the widget in that - # it needs to loose focus before it realises the user has changed - # its value via its entry widget. Therefore if it has the focus, - # temporarily change the focus to the execute button and then - # switch it back again. Please note, remember that the buttons on - # this page are set to not have the focus on click (which would - # also fix the problem but it doesn't look as nice). + # Please note that the update method needs to be called on the + # spinbutton so as to make sure that it's internal state is + # completely up to date (the user might have entered a value + # directly into the entry field). Updates are usually done when it + # looses the focus, however this window does not make use of any + # focus stealing buttons. - if ($instance->{time_spinbutton}->has_focus()) - { - my $pos = $instance->{time_spinbutton}->get_position(); - $instance->{search_files_button}->grab_focus(); - $instance->{time_spinbutton}->grab_focus(); - $instance->{time_spinbutton}->set_position($pos); - } - + $instance->{time_spinbutton}->update(); $query{period} = $instance->{time_spinbutton}->get_value_as_int(); $query{period_units} = ============================================================ --- lib/perl/Preferences.pm c6fc2f1148d3f22fb064cfa27ad7fec2174ca351 +++ lib/perl/Preferences.pm cc6cf881c0843db848e916482b81fd9891968125 @@ -1395,6 +1395,13 @@ sub save_preferences_from_gui($) my $instance = $_[0]; + # Please note that the update method needs to be called on all spinbuttons + # so as to make sure that it's internal state is completely up to date (the + # user might have entered a value directly into the entry field). Updates + # are usually done when it looses the focus, which is fine for the + # preferences dialog window as it stands but it's probably best not to rely + # on the presence of any focus stealing buttons. + # Do the general page. $instance->{preferences}->{default_mtn_db} = @@ -1405,16 +1412,19 @@ sub save_preferences_from_gui($) $instance->{auto_select_checkbutton}->get_active() ? 1 : 0; $instance->{preferences}->{auto_select_head} = $instance->{auto_select_head_checkbutton}->get_active() ? 1 : 0; + $instance->{tagged_lists_limit_spinbutton}->update(); $instance->{preferences}->{query}->{tagged}->{limit} = $instance->{tagged_lists_limit_spinbutton}->get_value_as_int(); $instance->{preferences}->{query}->{tagged}->{sort_chronologically} = $instance->{tagged_lists_sort_chronologically_radiobutton}-> get_active() ? 1 : 0; + $instance->{id_lists_limit_spinbutton}->update(); $instance->{preferences}->{query}->{id}->{limit} = $instance->{id_lists_limit_spinbutton}->get_value_as_int(); $instance->{preferences}->{query}->{id}->{sort_chronologically} = $instance->{id_lists_sort_chronologically_radiobutton}->get_active() ? 1 : 0; + $instance->{history_size_spinbutton}->update(); $instance->{preferences}->{history_size} = $instance->{history_size_spinbutton}->get_value_as_int(); $instance->{preferences}->{show_suspended} =