Changeset 12037


Ignore:
Timestamp:
07/26/10 21:04:33 (19 months ago)
Author:
adamk
Message:

OK, that was stupid. Move the queue into the wx app root object instead

Location:
trunk/Padre/lib
Files:
3 edited

Legend:

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

    r12036 r12037  
    158158    ); 
    159159 
    160     # Create the action queue 
    161     $self->{actionqueue} = Padre::Queue->new; 
    162  
    163160    # Startup completed, let go of the database 
    164161    Padre::DB->commit; 
     
    236233 
    237234            # Add the action to the queue 
    238             $self->{actionqueue}->add($action); 
     235            $self->wx->queue->add($action); 
    239236        } 
    240237    } 
  • trunk/Padre/lib/Padre/Queue.pm

    r12036 r12037  
    1515use strict; 
    1616use warnings; 
    17 use Padre::Wx      (); 
    18 use Padre::Current (); 
     17use Padre::Wx (); 
    1918 
    2019our $VERSION = '0.66'; 
     
    2221sub new { 
    2322    my $class = shift; 
    24     my $main  = Padre::Current->main; 
     23    my $wx    = shift; 
     24    my $main  = $wx->main; 
    2525 
    2626    # Create the empty queue 
    2727    my $self = bless { 
    28         actions => Padre::Current->ide->actions, 
    29         Queue   => [], 
     28        wx      => $wx, 
     29        actions => $wx->ide->actions, 
     30        queue   => [], 
    3031    }, $class; 
    3132 
     
    4950sub add { 
    5051    my $self = shift; 
    51     push @{ $self->{Queue} }, @_; 
     52    push @{ $self->{queue} }, @_; 
    5253    return 1; 
    5354} 
     
    6162 
    6263    my $new_interval; 
    63     if ( $#{ $self->{Queue} } == -1 ) { 
     64    if ( $#{ $self->{queue} } == -1 ) { 
    6465 
    6566        # No pending queue actions 
     
    8687    my $force = shift; 
    8788 
    88     if ( $#{ $self->{Queue} } > -1 ) { 
     89    if ( $#{ $self->{queue} } > -1 ) { 
    8990 
    9091        # Advoid another timer event during processing of this event 
    9192        $self->{timer}->Stop; 
    9293 
    93         my $queue  = $self->{Queue}; 
     94        my $queue  = $self->{queue}; 
    9495        my $action = shift @$queue; 
    9596        if ( $self->{debug} ) { 
     
    99100 
    100101        # Run the event handler 
    101         my $main = Padre::Current->main; 
     102        my $main = $self->{wx}->main; 
    102103        &{ $self->{actions}->{$action}->{queue_event} }( $main, $event, $force ); 
    103104 
  • trunk/Padre/lib/Padre/Wx/App.pm

    r11742 r12037  
    5151 
    5252    # TRACE($_[0]) if DEBUG; 
    53     $SINGLETON 
    54         or $SINGLETON = shift->SUPER::new; 
     53    $SINGLETON or 
     54    $SINGLETON = shift->SUPER::new; 
    5555} 
    5656 
     
    7373    require Padre::Wx::Main; 
    7474    $self->{main} = Padre::Wx::Main->new( $self->{ide} ); 
     75 
     76    # Create the action queue 
     77    require Padre::Queue; 
     78    $self->{queue} = Padre::Queue->new( $self ); 
    7579 
    7680    return $self; 
     
    113117 
    114118    # TRACE($_[0]) if DEBUG; 
    115     $_[0]->ide->config; 
     119    $_[0]->{ide}->config; 
     120} 
     121 
     122=pod 
     123 
     124=head2 C<queue> 
     125 
     126The C<queue> accessor returns the L<Padre::Queue> for the application. 
     127 
     128=cut 
     129 
     130sub queue { 
     131    $_[0]->{queue}; 
    116132} 
    117133 
Note: See TracChangeset for help on using the changeset viewer.