Changeset 1097
- Timestamp:
- 07/17/06 13:37:11
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/Notify/Balloon.pm
r1096 r1097 5 5 our $VERSION = '0.01'; 6 6 7 use File::Spec; 7 8 use Encode (); 8 9 … … 11 12 12 13 if ($^O eq 'MSWin32') { 13 $context->register_hook( 14 $self, 15 'publish.entry' => \¬ify, 16 'plugin.init' => \&initialize, 17 ); 14 if ($self->has_balloon_notify) { 15 $context->register_hook( 16 $self, 17 'publish.entry' => \¬ify, 18 'plugin.init' => \&initialize, 19 ); 20 } else { 21 $context->log(error => "BalloonNotify is not in your PATH."); 22 } 18 23 } else { 19 24 $context->log(error => "This plugin only works on Win32 systems"); 20 25 } 26 } 27 28 sub has_balloon_notify { 29 my $self = shift; 30 grep { -e File::Spec->catfile($_, 'BallonNotify.exe') } 31 split /;/, $ENV{PATH}; 21 32 } 22 33 … … 46 57 sub scrub { 47 58 my($self, $string) = @_; 48 $string =~ s/\s+/ / ;59 $string =~ s/\s+/ /g; 49 60 Encode::encode($self->conf->{encoding}, $string); 50 61 } … … 67 78 updates to users. 68 79 80 You need to install BallonNotify.exe command line tool from 81 L<http://www.gertrud.jp/soft/balloonnotify.html>. 82 83 =head1 TODO 84 85 =over 4 86 87 =item Rewrite using Win32::GUI 88 89 =back 90 69 91 =head1 AUTHOR 70 92
