Changeset 8567


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

Added title bar option to preferences dialog

File:
1 edited

Legend:

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

    r8540 r8567  
    306306        : '#ffff04'; 
    307307 
     308    my %window_title_vars = ( 
     309     '%p' => 'Project name', 
     310     '%v' => 'Padre version', 
     311     '%f' => 'Current filename', 
     312    ); 
     313    my @window_title_keys = sort 
     314        { lc($a) cmp lc($b); } 
     315        (keys(%window_title_vars)); 
     316    my $window_title_left; 
     317    my $window_title_right; 
     318    while ($#window_title_keys > -1) { 
     319 
     320        my $key = shift @window_title_keys; 
     321        $window_title_left .=  
     322            $key . 
     323            ' => '. 
     324            Wx::gettext($window_title_vars{$key})."\n"; 
     325 
     326        last if $#window_title_keys < 0; 
     327 
     328        $key = shift @window_title_keys; 
     329        $window_title_right .=  
     330            $key . 
     331            ' => '. 
     332            Wx::gettext($window_title_vars{$key})."\n"; 
     333 
     334    } 
     335    $window_title_left =~ s/\n$//; 
     336    $window_title_right =~ s/\n$//; 
     337 
    308338    my $table = [ 
     339        [  [ 'Wx::StaticText',     'undef',       Wx::gettext('Window title:') ], 
     340            [ 'Wx::TextCtrl', 'window_title', $config->window_title ], 
     341        ], 
     342        [  [ 'Wx::StaticText',     'undef',       Wx::gettext($window_title_left) ], 
     343           [ 'Wx::StaticText',     'undef',       Wx::gettext($window_title_right) ], 
     344        ], 
    309345        [   [   'Wx::CheckBox', 'main_output_ansi', ( $config->main_output_ansi ? 1 : 0 ), 
    310346                Wx::gettext('Colored text in output window (ANSI)') 
     
    906942    ); 
    907943    $config->set( 
     944        'window_title', 
     945        $data->{window_title} 
     946    ); 
     947    $config->set( 
    908948        'editor_right_margin_enable', 
    909949        $data->{editor_right_margin_enable} ? 1 : 0 
Note: See TracChangeset for help on using the changeset viewer.