# # # patch "lib/perl/AdvancedFind.pm" # from [4ecd24f16f0b9b03790c321de932ef0feb773a2f] # to [729bf841d7d56c0c15c9024f8d422c965a3bb4d0] # # patch "lib/perl/ComboAutoCompletion.pm" # from [d4c849b5553fa05b897d026ae411d1bbdb28df78] # to [6a8346abff1c9b80e2fbddfa944c84e53d045285] # # patch "lib/perl/Common.pm" # from [57dd6913d5e258aff37e2bb9601aa81e0572e950] # to [78f19156ab9e2edb5ed71f099b05347ffa4806df] # # patch "mtn-browse" # from [d7724d1cf5c29bbbdc938800b211641c9dbce8e9] # to [b478c609c11f2908a8d91acc154f453a1440f6ee] # ============================================================ --- lib/perl/AdvancedFind.pm 4ecd24f16f0b9b03790c321de932ef0feb773a2f +++ lib/perl/AdvancedFind.pm 729bf841d7d56c0c15c9024f8d422c965a3bb4d0 @@ -846,7 +846,9 @@ sub update_advanced_find_state($$) if ($changed & BRANCH) { - my @branch_list; + my(@branch_list, + $counter, + $update_interval); # Reset the query mode. @@ -879,12 +881,13 @@ sub update_advanced_find_state($$) $advanced_find->{appbar}->set_status(__("Populating branch list")); $wm->update_gui(); - my $counter = 1; + $counter = 1; + $update_interval = calculate_update_interval(address@hidden); $advanced_find->{branch_comboboxentry}->get_model()->clear(); foreach my $branch (@branch_list) { $advanced_find->{branch_comboboxentry}->append_text($branch); - if (($counter % 10) == 0) + if (($counter % $update_interval) == 0) { $advanced_find->{appbar}->set_progress_percentage ($counter / scalar(@branch_list)); @@ -896,6 +899,7 @@ sub update_advanced_find_state($$) $wm->update_gui(); $advanced_find->{branch_comboboxentry}->child()-> set_text($advanced_find->{branch_combo_details}->{value}); + $advanced_find->{branch_comboboxentry}->child()->set_position(-1); $advanced_find->{appbar}->set_progress_percentage(0); $advanced_find->{appbar}->set_status(""); $wm->update_gui(); @@ -907,7 +911,9 @@ sub update_advanced_find_state($$) if ($changed & REVISION) { - my @revision_list; + my($counter, + @revision_list, + $update_interval); # Reset the revision selection. @@ -943,12 +949,13 @@ sub update_advanced_find_state($$) $advanced_find->{appbar}->set_progress_percentage(0); $advanced_find->{appbar}->set_status(__("Populating revision list")); $wm->update_gui(); - my $counter = 1; + $counter = 1; + $update_interval = calculate_update_interval(address@hidden); $advanced_find->{revision_comboboxentry}->get_model()->clear(); foreach my $revision (@revision_list) { $advanced_find->{revision_comboboxentry}->append_text($revision); - if (($counter % 10) == 0) + if (($counter % $update_interval) == 0) { $advanced_find->{appbar}->set_progress_percentage ($counter / scalar(@revision_list)); ============================================================ --- lib/perl/ComboAutoCompletion.pm d4c849b5553fa05b897d026ae411d1bbdb28df78 +++ lib/perl/ComboAutoCompletion.pm 6a8346abff1c9b80e2fbddfa944c84e53d045285 @@ -221,9 +221,9 @@ sub auto_completion_comboboxentry_change $combo_details->{value} = $value; $combo_details->{complete} = 1; $instance->{appbar}->clear_stack(); - &{$instance->{update_handler}}($instance, $change_state); hide_tooltip_window(); $widget->child()->set_position(-1) if ($move_to_end); + &{$instance->{update_handler}}($instance, $change_state); last; } } @@ -376,8 +376,8 @@ sub auto_completion_comboboxentry_key_re my @item_list; + $wm->make_busy($instance, 1); $busy = 1; - $wm->make_busy($instance, 1); $wm->update_gui(); foreach my $item (@{$combo_details->{list}}) @@ -397,17 +397,22 @@ sub auto_completion_comboboxentry_key_re if (! $user_preferences->{static_lists}) { - my $counter = 1; + + my($counter, + $update_interval); + $instance->{appbar}->set_progress_percentage(0); $instance->{appbar}->push(__x("Populating {name} list", name => $name)); $wm->update_gui(); + $counter = 1; + $update_interval = calculate_update_interval(address@hidden); $widget->get_model()->clear() unless ($user_preferences->{static_lists}); foreach my $item (@item_list) { $widget->append_text($item); - if (($counter % 10) == 0) + if (($counter % $update_interval) == 0) { $instance->{appbar}->set_progress_percentage ($counter / scalar(@item_list)); @@ -420,6 +425,7 @@ sub auto_completion_comboboxentry_key_re $instance->{appbar}->set_progress_percentage(0); $instance->{appbar}->pop(); $wm->update_gui(); + } } @@ -432,8 +438,8 @@ sub auto_completion_comboboxentry_key_re { if (! $busy) { + $wm->make_busy($instance, 1); $busy = 1; - $wm->make_busy($instance, 1); } $wm->update_gui(); &{$instance->{update_handler}}($instance, $change_state); ============================================================ --- lib/perl/Common.pm 57dd6913d5e258aff37e2bb9601aa81e0572e950 +++ lib/perl/Common.pm 78f19156ab9e2edb5ed71f099b05347ffa4806df @@ -72,6 +72,7 @@ sub cache_extra_file_info($$$); # Public routines. sub cache_extra_file_info($$$); +sub calculate_update_interval($;$); sub colour_to_string($); sub create_format_tags($); sub data_is_binary($); @@ -2027,5 +2028,39 @@ sub build_help_ref_to_url_map() return; } +# +############################################################################## +# +# Routine - calculate_update_interval +# +# Description - Given a list of items to display or process, calculate the +# update interval (in number of items processed) for updating +# the display. +# +# Data - $list_ref : A reference to the list containing the items +# that are to be processed. +# $granularity : The number of times the display is to be +# updated whilst processing the list of items. +# This is optional. +# Return Value : The calculated update interval. +# +############################################################################## + + +sub calculate_update_interval($;$) +{ + + my($list_ref, $granularity) = @_; + + my $update_interval; + + $granularity = 20 unless (defined($granularity)); + $update_interval = int(scalar(@{$list_ref}) / $granularity); + $update_interval = 1 if ($update_interval < 1); + + return $update_interval; + +} + 1; ============================================================ --- mtn-browse d7724d1cf5c29bbbdc938800b211641c9dbce8e9 +++ mtn-browse b478c609c11f2908a8d91acc154f453a1440f6ee @@ -1195,7 +1195,8 @@ sub directory_up_button_clicked_cb($$) my($counter, @directory_list, - $len); + $len, + $update_interval); $len = length($value); $browser->{appbar}->set_progress_percentage(0); @@ -1207,13 +1208,14 @@ sub directory_up_button_clicked_cb($$) if ($value eq substr($item, 0, $len)); } $counter = 1; + $update_interval = calculate_update_interval(address@hidden); $browser->{directory_comboboxentry}->get_model()->clear(); $browser->{directory_comboboxentry}->child()->set_text($value); $browser->{directory_comboboxentry}->child()->set_position(-1); foreach my $item (@directory_list) { $browser->{directory_comboboxentry}->append_text($item); - if (($counter % 10) == 0) + if (($counter % $update_interval) == 0) { $browser->{appbar}->set_progress_percentage ($counter / scalar(@directory_list)); @@ -2488,7 +2490,9 @@ sub update_browser_state($$) if ($changed & BRANCH) { - my @branch_list; + my(@branch_list, + $counter, + $update_interval); # Reset the branch selection. @@ -2515,12 +2519,13 @@ sub update_browser_state($$) $browser->{appbar}->set_status(__("Populating branch list")); $wm->update_gui(); - my $counter = 1; + $counter = 1; + $update_interval = calculate_update_interval(address@hidden); $browser->{branch_comboboxentry}->get_model()->clear(); foreach my $branch (@branch_list) { $browser->{branch_comboboxentry}->append_text($branch); - if (($counter % 10) == 0) + if (($counter % $update_interval) == 0) { $browser->{appbar}->set_progress_percentage ($counter / scalar(@branch_list)); @@ -2544,7 +2549,9 @@ sub update_browser_state($$) if ($changed & REVISION) { - my @revision_list; + my($counter, + @revision_list, + $update_interval); # If auto-selection of the head revision is wanted by the user and it # is appropriate then preset the revision id. @@ -2683,12 +2690,13 @@ sub update_browser_state($$) $browser->{appbar}->set_progress_percentage(0); $browser->{appbar}->set_status(__("Populating revision list")); $wm->update_gui(); - my $counter = 1; + $counter = 1; + $update_interval = calculate_update_interval(address@hidden); $browser->{revision_comboboxentry}->get_model()->clear(); foreach my $revision (@revision_list) { $browser->{revision_comboboxentry}->append_text($revision); - if (($counter % 10) == 0) + if (($counter % $update_interval) == 0) { $browser->{appbar}->set_progress_percentage ($counter / scalar(@revision_list)); @@ -2711,8 +2719,10 @@ sub update_browser_state($$) if ($changed & DIRECTORY) { - my(@directory_list, - @manifest_list); + my($counter, + @directory_list, + @manifest_list, + $update_interval); # Reset the directory combo. @@ -2881,12 +2891,13 @@ sub update_browser_state($$) $browser->{appbar}->set_progress_percentage(0); $browser->{appbar}->set_status(__("Populating directory list")); $wm->update_gui(); - my $counter = 1; + $counter = 1; + $update_interval = calculate_update_interval(address@hidden); $browser->{directory_comboboxentry}->get_model()->clear(); foreach my $item (@directory_list) { $browser->{directory_comboboxentry}->append_text($item); - if (($counter % 10) == 0) + if (($counter % $update_interval) == 0) { $browser->{appbar}->set_progress_percentage ($counter / scalar(@directory_list));