From a06e8afa6192e595b164ce2f5646f3fce69e9939 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Fri, 13 Feb 2009 11:44:49 +1300 Subject: [PATCH] Pass the image file and text file around instead of instantiated objects. --- lib/Display/Plugins/Asterisk.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/Display/Plugins/Asterisk.pm b/lib/Display/Plugins/Asterisk.pm index d9ae1f9..75752de 100644 --- a/lib/Display/Plugins/Asterisk.pm +++ b/lib/Display/Plugins/Asterisk.pm @@ -18,7 +18,7 @@ sub new { bless ($self, $class); - $self->{'logo'} = Clutter::Texture->new("$Bin/share/Asterisk.png"); + $self->{'logo'} = "$Bin/share/Asterisk.png"; $self->{'kernel'}->state('asterisk_delayed_start', $self, 'delayed_start'); @@ -48,9 +48,10 @@ sub new { }, inline_states => { - # When we're connected to Asterisk, post back to the main session for the rest of - # our states to be setup in asterisk_start. This is to make sure the states are - # created in the correct session with a reference to $self. + # When we're connected to Asterisk, post back to the main session for + # the rest of our states to be setup in asterisk_start. This is to + # make sure the states are created in the correct session with a + # reference to $self. _connected => sub { $self->{'kernel'}->post('display' => 'asterisk_delayed_start') }, asterisk_start => sub { my ($kernel, $self) = @_[KERNEL, ARG0]; @@ -92,6 +93,8 @@ sub input { print STDERR "Other input - $input->{Event}\n"; print Dumper($input); + +# $kernel->post('display', 'notifications_add', "Event: " . $input->{Event}, $self->{'logo'}); } sub hangup { @@ -104,9 +107,7 @@ sub dial { my $dest = $input->{Destination}; $dest =~ s/(.*)-.*/$1/; - my $text = Clutter::Label->new('Sans 20', "Call from " . $input->{CallerIDName} . "\n " . $input->{CallerID} . "\nFor $dest"); - $text->set_color(Clutter::Color->parse('White')); - $text->set_ellipsize('end'); + my $text = "Call from " . $input->{CallerIDName} . "\n " . $input->{CallerID} . "\nFor $dest"; $kernel->post('display', 'notifications_add', $text, $self->{'logo'}); } -- 2.30.2