Changeset 8572


Ignore:
Timestamp:
10/03/09 06:31:44 (2 years ago)
Author:
Sewi
Message:

Perl tidy

Location:
trunk/Padre/lib/Padre
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Config.pm

    r8566 r8572  
    185185# Window 
    186186setting( 
    187     name    => 'window_title', 
    188     type    => Padre::Constant::ASCII, 
    189     store   => Padre::Constant::HUMAN, 
    190     default => 'Padre [%p]', 
     187    name    => 'window_title', 
     188    type    => Padre::Constant::ASCII, 
     189    store   => Padre::Constant::HUMAN, 
     190    default => 'Padre [%p]', 
    191191); 
    192192 
  • trunk/Padre/lib/Padre/Current.pm

    r8568 r8572  
    126126    unless ( exists $self->{editor} ) { 
    127127        my $notebook = $self->notebook; 
    128         if (defined($notebook)){ 
     128        if ( defined($notebook) ) { 
    129129            my $selected = $notebook->GetSelection; 
    130130            if ( $selected == -1 ) { 
     
    137137                    Carp::croak("Failed to find page"); 
    138138                } 
    139         }} 
     139            } 
     140        } 
    140141    } 
    141142    return $self->{editor}; 
  • trunk/Padre/lib/Padre/Wx/Dialog/Preferences.pm

    r8571 r8572  
    307307 
    308308    my %window_title_vars = ( 
    309      '%p' => 'Project name', 
    310      '%v' => 'Padre version', 
    311      '%f' => 'Current filename', 
    312      '%d' => 'Current files dirname', 
    313      '%b' => 'Current files basename', 
    314      '%F' => 'Current filename relative to project', 
    315     ); 
    316     my @window_title_keys = sort 
    317         { lc($a) cmp lc($b); } 
    318         (keys(%window_title_vars)); 
     309        '%p' => 'Project name', 
     310        '%v' => 'Padre version', 
     311        '%f' => 'Current filename', 
     312        '%d' => 'Current files dirname', 
     313        '%b' => 'Current files basename', 
     314        '%F' => 'Current filename relative to project', 
     315    ); 
     316    my @window_title_keys = sort { lc($a) cmp lc($b); } ( keys(%window_title_vars) ); 
    319317    my $window_title_left; 
    320318    my $window_title_right; 
    321     while ($#window_title_keys > -1) { 
     319 
     320    while ( $#window_title_keys > -1 ) { 
    322321 
    323322        my $key = shift @window_title_keys; 
    324         $window_title_left .=  
    325             $key . 
    326             ' => '. 
    327             Wx::gettext($window_title_vars{$key})."\n"; 
     323        $window_title_left .= $key . ' => ' . Wx::gettext( $window_title_vars{$key} ) . "\n"; 
    328324 
    329325        last if $#window_title_keys < 0; 
    330326 
    331327        $key = shift @window_title_keys; 
    332         $window_title_right .=  
    333             $key . 
    334             ' => '. 
    335             Wx::gettext($window_title_vars{$key})."\n"; 
     328        $window_title_right .= $key . ' => ' . Wx::gettext( $window_title_vars{$key} ) . "\n"; 
    336329 
    337330    } 
    338     $window_title_left =~ s/\n$//; 
     331    $window_title_left  =~ s/\n$//; 
    339332    $window_title_right =~ s/\n$//; 
    340333 
    341334    my $table = [ 
    342         [  [ 'Wx::StaticText',     'undef',       Wx::gettext('Window title:') ], 
    343             [ 'Wx::TextCtrl', 'window_title', $config->window_title ], 
    344         ], 
    345         [  [ 'Wx::StaticText',     'undef',      Wx::gettext($window_title_left) ], 
    346            [ 'Wx::StaticText',     'undef',      Wx::gettext($window_title_right) ], 
     335        [   [ 'Wx::StaticText', 'undef',        Wx::gettext('Window title:') ], 
     336            [ 'Wx::TextCtrl',   'window_title', $config->window_title ], 
     337        ], 
     338        [   [ 'Wx::StaticText', 'undef', Wx::gettext($window_title_left) ], 
     339            [ 'Wx::StaticText', 'undef', Wx::gettext($window_title_right) ], 
    347340        ], 
    348341        [   [   'Wx::CheckBox', 'main_output_ansi', ( $config->main_output_ansi ? 1 : 0 ), 
  • trunk/Padre/lib/Padre/Wx/Main.pm

    r8571 r8572  
    47374737    # The syntax string could be set in the preferences dialog. 
    47384738 
    4739     my $self = shift; 
     4739    my $self   = shift; 
    47404740    my $config = $self->{config}; 
    47414741 
    47424742    my %variable_data = ( 
    4743         '%' => '%', 
    4744         'v' => $Padre::VERSION, 
    4745         'f' => '', # Initlize space for filename 
    4746         'b' => '', # Initlize space for filename - basename 
    4747         'd' => '', # Initlize space for filename - dirname 
    4748         'F' => '', # Initlize space for filename relative to project dir 
    4749         'p' => '', # Initlize space for project name 
    4750         ); 
     4743        '%' => '%', 
     4744        'v' => $Padre::VERSION, 
     4745        'f' => '',            # Initlize space for filename 
     4746        'b' => '',            # Initlize space for filename - basename 
     4747        'd' => '',            # Initlize space for filename - dirname 
     4748        'F' => '',            # Initlize space for filename relative to project dir 
     4749        'p' => '',            # Initlize space for project name 
     4750    ); 
    47514751 
    47524752    # We may run within window startup, there may be no "current" or "document": 
    4753     if (defined($self->current) and defined($self->current->document)) { 
     4753    if ( defined( $self->current ) and defined( $self->current->document ) ) { 
    47544754        my $document = $self->current->document; 
    47554755        $variable_data{'f'} = $document->file->{filename}; 
     
    47734773    $self->{title} = $config->window_title; 
    47744774 
    4775     my $Vars = join('',keys(%variable_data)); 
     4775    my $Vars = join( '', keys(%variable_data) ); 
    47764776 
    47774777    $self->{title} =~ s/\%([$Vars])/$variable_data{$1}/g; 
    47784778 
    4779     $self->{title} = 'Padre '.$Padre::VERSION 
    4780      if ! defined($self->{title}); 
     4779    $self->{title} = 'Padre ' . $Padre::VERSION 
     4780        if !defined( $self->{title} ); 
    47814781 
    47824782    my $revision = Padre::Util::revision(); 
Note: See TracChangeset for help on using the changeset viewer.