Changeset 10972


Ignore:
Timestamp:
03/02/10 04:39:03 (2 years ago)
Author:
azawawi
Message:

Fixed ticket:807 "F2 is broken"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Wx/Dialog/HelpSearch.pm

    r10971 r10972  
    276276            sub { 
    277277                $self->_index(undef); 
    278                 $self->_update_list_box; 
    279                 $self->_search_text->Enable(1); 
    280                 $self->_topic_selector->Enable(1); 
    281                 $self->_list->Enable(1); 
    282                 $self->_search_text->SetFocus(); 
     278                if( $self->_update_list_box ) { 
     279                    $self->_search_text->Enable(1); 
     280                    $self->_topic_selector->Enable(1); 
     281                    $self->_list->Enable(1); 
     282                    $self->_search_text->SetFocus(); 
     283                } else { 
     284                    $self->_search_text->ChangeValue(''); 
     285                } 
    283286                Wx::Event::EVT_IDLE( $self, undef ); 
    284287            } 
     
    296299    my $self = shift; 
    297300 
    298     # a default.. 
    299     my @empty = (); 
    300     $self->_index( \@empty ); 
    301  
    302     # TODO: If the _help_provide call crashes then this _search seem to be called in a recursive loop 
    303     # until the whole applications freezes. 
    304301    # Generate a sorted file-list based on filename 
    305302    if ( not $self->_help_provider ) { 
     
    371368    my $self = shift; 
    372369 
    373     if ( not $self->_index ) { 
    374         $self->_search; 
    375     } 
     370    # Clear the list 
     371    $self->_list->Clear(); 
     372 
     373    # Try to fetch a help index and return nothing if otherwise 
     374    $self->_search unless $self->_index; 
     375    return unless $self->_index; 
    376376 
    377377    my $search_expr = $self->_search_text->GetValue(); 
     
    379379 
    380380    #Populate the list box now 
    381     $self->_list->Clear(); 
    382381    my $pos = 0; 
    383382    foreach my $target ( @{ $self->_index } ) { 
     
    396395    $self->_display_help_in_viewer; 
    397396 
    398     return; 
     397    return 1; 
    399398} 
    400399 
Note: See TracChangeset for help on using the changeset viewer.