Changeset 8570


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

Title bar is now configurable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Wx/Main.pm

    r8535 r8570  
    896896    $self->refresh_status($current); 
    897897    $self->refresh_functions($current); 
     898    $self->set_title; 
    898899 
    899900    my $notebook = $self->notebook; 
     
    47354736 
    47364737    my $self = shift; 
     4738    my $config = $self->{config}; 
    47374739 
    47384740    # Determine the window title 
    47394741    # Keep it for later usage 
    47404742 
    4741     $self->{title} = 'Padre'; 
    4742  
     4743    my %variable_data = ( 
     4744        '%' => '%', 
     4745        'v' => $Padre::VERSION, 
     4746        'f' => '', # Initlize space for filename 
     4747        'p' => '', # Initlize space for project name 
     4748        ); 
     4749 
     4750    # We may run within window startup, there may be no "current" or "document": 
     4751    if (defined($self->current) and defined($self->current->document)) { 
     4752        my $document = $self->current->document; 
     4753        $variable_data{'f'} = $document->file->{filename}; 
     4754    } 
     4755 
     4756    # Fill in the session, if any 
    47434757    if ( defined( $self->ide->{session} ) ) { 
    47444758        my ($session) = Padre::DB::Session->select( 
    47454759            'where id = ?', $self->ide->{session}, 
    47464760        ); 
    4747         $self->{title} .= ' [' . $session->{name} . ']'; 
    4748     } 
     4761        $variable_data{'p'} = $session->{name}; 
     4762    } 
     4763 
     4764    $self->{title} = $config->window_title; 
     4765 
     4766    my $Vars = join('',keys(%variable_data)); 
     4767 
     4768    $self->{title} =~ s/\%([$Vars])/$variable_data{$1}/g; 
     4769 
     4770    $self->{title} = 'Padre '.$Padre::VERSION 
     4771     if ! defined($self->{title}); 
    47494772 
    47504773    my $revision = Padre::Util::revision(); 
Note: See TracChangeset for help on using the changeset viewer.