Ticket #43: padre.open-multiple-files.patch

File padre.open-multiple-files.patch, 1.1 KB (added by jquelin, 5 years ago)

patch allowing opening multiple files

  • lib/Padre/Wx/MainWindow.pm

     
    10931093        $default_dir, 
    10941094        "", 
    10951095        "*.*", 
    1096         Wx::wxFD_OPEN, 
     1096        Wx::wxFD_MULTIPLE, 
    10971097    ); 
    10981098    unless ( Padre::Util::WIN32 ) { 
    10991099        $dialog->SetWildcard("*"); 
     
    11011101    if ( $dialog->ShowModal == Wx::wxID_CANCEL ) { 
    11021102        return; 
    11031103    } 
    1104     my $filename = $dialog->GetFilename; 
     1104    my @filenames = $dialog->GetFilenames; 
    11051105    $default_dir = $dialog->GetDirectory; 
    11061106 
    1107     my $file = File::Spec->catfile($default_dir, $filename); 
    1108     Padre::DB->add_recent_files($file); 
    1109  
    11101107    # If and only if there is only one current file, 
    11111108    # and it is unused, close it. 
    11121109    if ( $self->{notebook}->GetPageCount == 1 ) { 
     
    11151112        } 
    11161113    } 
    11171114 
    1118     $self->setup_editor($file); 
     1115    foreach my $filename ( @filenames ) { 
     1116        my $file = File::Spec->catfile($default_dir, $filename); 
     1117        Padre::DB->add_recent_files($file); 
     1118 
     1119        $self->setup_editor($file); 
     1120    } 
    11191121    $self->refresh_all; 
    11201122 
    11211123    return;