Changeset 10602

Show
Ignore:
Timestamp:
02/07/10 10:46:27 (7 months ago)
Author:
azawawi
Message:

Added "Open with Default System Editor" in "File -> Open..." sub-menu. This is only implemented for Win32. Other platform implementations are welcome

Location:
trunk/Padre/lib/Padre
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Action/File.pm

    r10589 r10602  
    123123                menu_event => sub { 
    124124                        $_[0]->on_open_url; 
     125                }, 
     126        ); 
     127 
     128        Padre::Action->new( 
     129                name       => 'file.open_with_default_system_editor', 
     130                label      => Wx::gettext('Open with Default System Editor'), 
     131                comment    => Wx::gettext('Opens the file with the default system editor'), 
     132                menu_event => sub { 
     133                        $_[0]->on_open_with_default_system_editor; 
    125134                }, 
    126135        ); 
  • trunk/Padre/lib/Padre/Wx/Main.pm

    r10589 r10602  
    36583658} 
    36593659 
     3660sub on_open_with_default_system_editor { 
     3661        my $self = shift; 
     3662        my $document = $self->current->document or return; 
     3663        my $filename = $document->filename or return; 
     3664 
     3665        if(Padre::Constant::WIN32) { 
     3666                # Win32 
     3667                require Padre::Util::Win32; 
     3668                Padre::Util::Win32::ExecuteProcessAndWait( 
     3669                        directory  => $self->{cwd}, 
     3670                        file       => $document->filename, 
     3671                        parameters => '', 
     3672                        show       => 1); 
     3673        } else { 
     3674                #TODO please implement for other platforms 
     3675                $self->error(Wx::gettext("Not implemented!")); 
     3676        } 
     3677} 
     3678 
    36603679sub on_open_example { 
    36613680        $_[0]->open_file_dialog( Padre::Util::sharedir('examples') ); 
  • trunk/Padre/lib/Padre/Wx/Menu/File.pm

    r10588 r10602  
    102102                $file_open, 
    103103                'file.open_in_file_browser', 
     104        ); 
     105 
     106        $self->{open_with_default_system_editor} = $self->add_menu_action( 
     107                $file_open, 
     108                'file.open_with_default_system_editor', 
    104109        ); 
    105110