# # # patch "lib/perl/AdvancedFind.pm" # from [f432e438049bfb004421bb6f0d11cf95f1b7af21] # to [e3ce97c9351db9db17644f5902f2edb8ae28b2c5] # # patch "lib/perl/FindFiles.pm" # from [d5c2aea4c55ed1cbab71eab77c50c0e9654d99ca] # to [9b922ea5249ac3d0a7ed34ab6546aa3905063edc] # ============================================================ --- lib/perl/AdvancedFind.pm f432e438049bfb004421bb6f0d11cf95f1b7af21 +++ lib/perl/AdvancedFind.pm e3ce97c9351db9db17644f5902f2edb8ae28b2c5 @@ -680,13 +680,6 @@ sub get_advanced_find_window($) create_format_tags($instance->{details_textview}->get_buffer()); $instance->{details_textview}->modify_font($mono_font); - # Update the advanced find dialog's state. - - $instance->{window}->set_transient_for($browser->{window}); - $instance->{branch_combo_details}->{preset} = 0; - $instance->{revision_combo_details}->{preset} = 0; - &{$instance->{update_handler}}($instance, NEW_FIND); - local $instance->{in_cb} = 1; $instance->{window}->show_all(); @@ -705,6 +698,13 @@ sub get_advanced_find_window($) {widget => undef, help_ref => __("mtnb-mcqc-the-advanced-find-dialog-window")}); + # Update the advanced find dialog's state. + + $instance->{window}->set_transient_for($browser->{window}); + $instance->{branch_combo_details}->{preset} = 0; + $instance->{revision_combo_details}->{preset} = 0; + &{$instance->{update_handler}}($instance, NEW_FIND); + } else { @@ -763,14 +763,9 @@ sub update_advanced_find_state($$) my($advanced_find, $changed) = @_; my $matches; - my $made_busy = 0; my $wm = WindowManager->instance(); - if ($advanced_find->{window}->realized()) - { - $made_busy = 1; - $wm->make_busy($advanced_find, 1); - } + $wm->make_busy($advanced_find, 1); $advanced_find->{appbar}-> push($advanced_find->{appbar}->get_status()->get_text()); $wm->update_gui(); @@ -1159,8 +1154,6 @@ sub update_advanced_find_state($$) } $advanced_find->{appbar}->pop(); - $wm->make_busy($advanced_find, 0) if ($made_busy); - if (defined($matches)) { if ($matches > 0) @@ -1176,6 +1169,7 @@ sub update_advanced_find_state($$) $advanced_find->{appbar}->set_status(__("Nothing found")); } } + $wm->make_busy($advanced_find, 0); } ============================================================ --- lib/perl/FindFiles.pm d5c2aea4c55ed1cbab71eab77c50c0e9654d99ca +++ lib/perl/FindFiles.pm 9b922ea5249ac3d0a7ed34ab6546aa3905063edc @@ -324,6 +324,10 @@ sub search_files_button_clicked_cb($$) $query = save_query_from_gui($instance); return if (! validate_query($instance, $query)); + $wm->make_busy($instance, 1); + $instance->{appbar}->push($instance->{appbar}->get_status()->get_text()); + $wm->update_gui(); + # Update the comboxentries histories. handle_comboxentry_history($instance->{files_named_comboboxentry}, @@ -491,10 +495,6 @@ sub search_files_button_clicked_cb($$) } } - $wm->make_busy($instance, 1); - $instance->{appbar}->push($instance->{appbar}->get_status()->get_text()); - $wm->update_gui(); - $instance->{appbar}->set_status(__("Finding matching files")); $instance->{results_liststore}->clear(); set_label_value($instance->{author_value_label}, ""); @@ -856,7 +856,7 @@ sub get_find_files_window() $instance->{window} = $instance->{glade}->get_widget($window_type); foreach my $widget ("appbar", - "execute_button", + "search_files_button", "stop_button", "searching_from_value_label", @@ -1220,10 +1220,29 @@ 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). + + 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); + } + $query{period} = $instance->{time_spinbutton}->get_value_as_int(); $query{period_units} = $instance->{time_units_combobox}->get_active(); + } } if ($instance->{size_comparitor_combobox}->get_active() != CMP_ANY_SIZE)