Changeset 12037
- Timestamp:
- 07/26/10 21:04:33 (19 months ago)
- Location:
- trunk/Padre/lib
- Files:
-
- 3 edited
-
Padre.pm (modified) (2 diffs)
-
Padre/Queue.pm (modified) (6 diffs)
-
Padre/Wx/App.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre.pm
r12036 r12037 158 158 ); 159 159 160 # Create the action queue161 $self->{actionqueue} = Padre::Queue->new;162 163 160 # Startup completed, let go of the database 164 161 Padre::DB->commit; … … 236 233 237 234 # Add the action to the queue 238 $self-> {actionqueue}->add($action);235 $self->wx->queue->add($action); 239 236 } 240 237 } -
trunk/Padre/lib/Padre/Queue.pm
r12036 r12037 15 15 use strict; 16 16 use warnings; 17 use Padre::Wx (); 18 use Padre::Current (); 17 use Padre::Wx (); 19 18 20 19 our $VERSION = '0.66'; … … 22 21 sub new { 23 22 my $class = shift; 24 my $main = Padre::Current->main; 23 my $wx = shift; 24 my $main = $wx->main; 25 25 26 26 # Create the empty queue 27 27 my $self = bless { 28 actions => Padre::Current->ide->actions, 29 Queue => [], 28 wx => $wx, 29 actions => $wx->ide->actions, 30 queue => [], 30 31 }, $class; 31 32 … … 49 50 sub add { 50 51 my $self = shift; 51 push @{ $self->{ Queue} }, @_;52 push @{ $self->{queue} }, @_; 52 53 return 1; 53 54 } … … 61 62 62 63 my $new_interval; 63 if ( $#{ $self->{ Queue} } == -1 ) {64 if ( $#{ $self->{queue} } == -1 ) { 64 65 65 66 # No pending queue actions … … 86 87 my $force = shift; 87 88 88 if ( $#{ $self->{ Queue} } > -1 ) {89 if ( $#{ $self->{queue} } > -1 ) { 89 90 90 91 # Advoid another timer event during processing of this event 91 92 $self->{timer}->Stop; 92 93 93 my $queue = $self->{ Queue};94 my $queue = $self->{queue}; 94 95 my $action = shift @$queue; 95 96 if ( $self->{debug} ) { … … 99 100 100 101 # Run the event handler 101 my $main = Padre::Current->main;102 my $main = $self->{wx}->main; 102 103 &{ $self->{actions}->{$action}->{queue_event} }( $main, $event, $force ); 103 104 -
trunk/Padre/lib/Padre/Wx/App.pm
r11742 r12037 51 51 52 52 # TRACE($_[0]) if DEBUG; 53 $SINGLETON 54 or$SINGLETON = shift->SUPER::new;53 $SINGLETON or 54 $SINGLETON = shift->SUPER::new; 55 55 } 56 56 … … 73 73 require Padre::Wx::Main; 74 74 $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 ); 75 79 76 80 return $self; … … 113 117 114 118 # TRACE($_[0]) if DEBUG; 115 $_[0]->ide->config; 119 $_[0]->{ide}->config; 120 } 121 122 =pod 123 124 =head2 C<queue> 125 126 The C<queue> accessor returns the L<Padre::Queue> for the application. 127 128 =cut 129 130 sub queue { 131 $_[0]->{queue}; 116 132 } 117 133
Note: See TracChangeset
for help on using the changeset viewer.
