diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a13d44e --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +PREFIX = /usr/local + +SUBDIRS = plugins \ + sounds \ + images \ + lib + +install: + mkdir -p $(DESTDIR)/$(PREFIX)/share/milkbone + cp -r *.p* $(SUBDIRS) $(DESTDIR)/$(PREFIX)/share/milkbone + mkdir -p $(DESTDIR)/$(PREFIX)/share/doc/milkbone/ + cp -r docs/* $(DESTDIR)/$(PREFIX)/share/doc/milkbone + mkdir -p $(DESTDIR)/$(PREFIX)/bin/ + echo -e "#!/bin/sh \n cd ${PREFIX}/share/milkbone \n exec $(PREFIX)/share/milkbone/mos.pl \"\$$@\"\n" > $(DESTDIR)/$(PREFIX)/bin/milkbone + chmod +x $(DESTDIR)/$(PREFIX)/bin/milkbone diff --git a/docs/VERSION.txt b/docs/VERSION.txt index d4f7a94..2fcd4b1 100644 --- a/docs/VERSION.txt +++ b/docs/VERSION.txt @@ -1,6 +1,9 @@ 0.356 -- +* Beta Makefile +* Beta ebuild (for Gentoo Linux users) +* No more extraneous warnings on startup * Convo code separated into convo widget and container widget * Buddy list now uses Tahoma * Fixed links problem on Win32 (thanks to Bob for pointing it out) diff --git a/makedist.pl b/makedist.pl deleted file mode 100644 index 7ff5342..0000000 --- a/makedist.pl +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/perl - -use Archive::Tar; diff --git a/milkbone-0.36.ebuild b/milkbone-0.36.ebuild new file mode 100644 index 0000000..6440e54 --- /dev/null +++ b/milkbone-0.36.ebuild @@ -0,0 +1,23 @@ +DESCRIPTION="IM client written in Perl/Tk" +HOMEPAGE="http://www.milkbone.org" +IUSE="" + +DEPEND=">=dev-lang/perl-5.6* + >=dev-perl/perl-tk-800.02*" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~x86 ~ppc ~alpha ~sparc" + +MY_P="$(echo ${P}|sed 's/b$/beta/')" +SRC_URI="mirror://sourceforge/gaim/${P}.tar.gz" +S=${WORKDIR}/${MY_P} + +src_compile() { + true + +} + +src_install() { + einstall || die "Couldn't install +} diff --git a/plugins/Tk-Convo/Milkbone/ConvoTL.pm b/plugins/Tk-Convo/Milkbone/ConvoTL.pm index e6f7f65..ad775c3 100644 --- a/plugins/Tk-Convo/Milkbone/ConvoTL.pm +++ b/plugins/Tk-Convo/Milkbone/ConvoTL.pm @@ -24,6 +24,7 @@ sub Populate { my ($self, $args) = @_; $self->SUPER::Populate($args); + $self->withdraw(); $self->ConfigSpecs('DEFAULT' => ['SELF']); } @@ -39,8 +40,6 @@ sub init { my ($self, $mw, $buddy) = @_; $self->{buddy} = $buddy; - - $self->withdraw(); $self->title("$buddy - Conversation"); $self->update; diff --git a/plugins/Tk-Convo/Tk-Convo.pl b/plugins/Tk-Convo/Tk-Convo.pl index 1457213..3dc104d 100644 --- a/plugins/Tk-Convo/Tk-Convo.pl +++ b/plugins/Tk-Convo/Tk-Convo.pl @@ -36,7 +36,7 @@ register_hook("create_convo", sub { $ARGS{-self}->{convo}->typing_status($ARGS{-status}); }, {-self => $convo}); - register_hook("protocol_send_im", sub { + register_hook("msg_sent_$buddy", sub { $ARGS{-self}->{convo}->msg_sent(@ARGS{-msg, -away}); }, {-self => $convo}); diff --git a/plugins/Tk-GUI/Tk/BrowseEdit.pm b/plugins/Tk-GUI/Tk/BrowseEdit.pm index 33b96ec..922438f 100644 --- a/plugins/Tk-GUI/Tk/BrowseEdit.pm +++ b/plugins/Tk-GUI/Tk/BrowseEdit.pm @@ -1,184 +1,181 @@ package Tk::BrowseEdit; - use Tk; use Tk::Font; use base 'Tk::Frame'; - use strict; use warnings; - Construct Tk::Widget 'BrowseEdit'; - sub ClassInit { - my ($class, $mw) = @_; - $class->SUPER::ClassInit($mw); + my ($class, $mw) = @_; + $class->SUPER::ClassInit($mw); } - sub Populate { - my ($self, $args) = @_; - $self->SUPER::Populate($args); - - $self->{panel} = $self->Frame(-borderwidth => 0)->pack(-fill => 'both'); - $self->{text} = $self->Text->pack(-expand => 1, -fill => 'both'); - - $self->{'<b>'} = $self->{panel}->Button(-text => 'B', -relief => 'flat', - -font => $self->Font(-family => 'times', -weight => 'bold', -size => '8'), - -command => [sub { - my ($self) = @_; - $self->toggleTag('<b>'); - }, $self] - )->pack(-pady => 0, -side => 'left', -fill => 'both'); - $self->{text}->tagConfigure('<b>', -font => $self->Font(-family => 'times', -weight => 'bold')); - $self->{text}->bind('<Control-B>', [sub { shift->{'<b>'}->invoke; }, $self]); - - $self->{'<i>'} = $self->{panel}->Button(-text => 'I', -relief => 'flat', - -font => $self->Font(-family => 'times', -slant => 'italic', -size => '8'), - -command => [sub { - my ($self) = @_; - $self->toggleTag('<i>'); - }, $self] - )->pack(-pady => 0, -side => 'left', -fill => 'both'); - $self->{text}->tagConfigure('<i>', -font => $self->Font(-family => 'times', -slant => 'italic')); - $self->bind('<Control-I>', [sub { shift->{'<b>'}->invoke; }, $self]); - - $self->{'<u>'} = $self->{panel}->Button(-text => 'U', -relief => 'flat', - -font => $self->Font(-family => 'times', -underline => 1, -size => '8'), - -command => [sub { - my ($self) = @_; - $self->toggleTag('<u>'); - }, $self] - )->pack(-pady => 0, -side => 'left', -fill => 'both'); - $self->{text}->tagConfigure('<u>', -font => $self->Font(-family => 'times', -underline => 1)); - - $self->{text}->tagConfigure('elide', -elide => 1); - $self->bind('<Control-U>', [sub { shift->{'<b>'}->invoke; }, $self]); - - $self->ConfigSpecs( - 'DEFAULT' => [$self->{text}], - -background => [$self] - ); - - $self->Delegates( - 'DEFAULT' => $self->{text}, - 'to_html' => $self, - ); - - $self->after(200, [$self, "init"]); + my ($self, $args) = @_; + $self->SUPER::Populate($args); + $self->{panel} = $self->Frame(-borderwidth => 0)->pack(-fill => 'both'); + $self->{text} = $self->Text->pack(-expand => 1, -fill => 'both'); + $self->{'<b>'} = $self->{panel}->Button(-text => 'B', -relief => 'flat', + -font => $self->Font(-family => 'times', -weight => 'bold', -size => '8'), + -command => [sub { + my ($self) = @_; + $self->toggleTag('<b>'); + }, $self] + )->pack(-pady => 0, -side => 'left', -fill => 'both'); + $self->{text}->bind('<Control-B>', [sub { shift->{'<b>'}->invoke; }, +$self]); + $self->{'<i>'} = $self->{panel}->Button(-text => 'I', -relief => 'flat', + -font => $self->Font(-family => 'times', -slant => 'italic', -size => '8'), + -command => [sub { + my ($self) = @_; + $self->toggleTag('<i>'); + }, $self] + )->pack(-pady => 0, -side => 'left', -fill => 'both'); + $self->bind('<Control-I>', [sub { shift->{'<b>'}->invoke; }, $self]); + $self->{'<u>'} = $self->{panel}->Button(-text => 'U', -relief => 'flat', + -font => $self->Font(-family => 'times', -underline => 1, -size => '8'), + -command => [sub { + my ($self) = @_; + $self->toggleTag('<u>'); + }, $self] + )->pack(-pady => 0, -side => 'left', -fill => 'both'); + $self->bind('<Control-U>', [sub { shift->{'<b>'}->invoke; }, $self]); + $self->{text}->tagConfigure('elide', -elide => 1); + $self->ConfigSpecs( + 'DEFAULT' => [$self->{text}], + -background => [$self] + ); + $self->Delegates( + 'DEFAULT' => $self->{text}, + 'to_html' => $self, + ); + $self->after(200, [$self, "init"]); } - sub toggleTag { - my ($self, $tag) = @_; - - if(!defined($self->{text}->tagRanges('sel'))) - { - if(!$self->{tags}->{$tag}) - { - $self->{text}->insert('insert', '%ignore%', [$tag, 'elide']); - $self->{text}->tagAdd($tag, 'insert'); - $self->{tags}->{$tag} = 1; - $self->{$tag}->configure(-relief => 'groove'); - } - else - { - $self->{text}->insert('insert', '%ignore%', ['elide']); - $self->{text}->tagRemove($tag, 'insert'); - $self->{tags}->{$tag} = 0; - $self->{$tag}->configure(-relief => 'flat'); - } - } - else - { - my ($selstart, $selend) = $self->{text}->tagRanges('sel'); - my @tags = $self->{text}->tagRanges($tag); - my (@starts, @ends); - - for(my $i = 0; $i < @tags; $i += 2) - { - push @starts, $tags[$i]; - push @ends, $tags[$i + 1]; - } - - for my $start (@starts) - { - for my $end (@ends) - { - if($selstart >= $start and $selend <= $end) - { - $self->{text}->tagRemove($tag, $self->{text}->tagRanges('sel')); - $self->{$tag}->configure(-relief => 'raised'); - return; - } - } - } - - $self->{text}->tagAdd($tag, $self->{text}->tagRanges('sel')); - $self->{$tag}->configure(-relief => 'sunken'); - } + my ($self, $tag) = @_; + if(!defined($self->{text}->tagRanges('sel'))) + { + # no selection - modify current position + print "starting\n"; + my $cur_tag = ($self->{text}->tagNames('insert'))[0] || ""; + print "tag names gotten\n"; + if ($cur_tag =~ /$tag/i) + { + # tag is defined for this range - remove it from the composite tag name and then add the resulting + # tag, creating it if necessary + return unless $cur_tag ne ""; + $self->{text}->tagRemove($cur_tag, 'insert'); + $cur_tag =~ s/$tag//i; + print "creating tag\n"; + $self->create_tag($cur_tag); + print "tag created\n"; + $self->insert('insert', '%%%ignore%%%', [$cur_tag, 'elide']); + $self->tagAdd($cur_tag, 'insert'); + $self->{$tag}->configure(-relief => 'flat'); + } + else + { + # tag not enabled for this range - add it + $self->{text}->tagRemove($cur_tag, 'insert'); + $cur_tag .= $tag; + $self->create_tag($cur_tag); + $self->insert('insert', '%%%ignore%%%', [$cur_tag, 'elide']); + $self->tagAdd($cur_tag, 'insert'); + $self->{$tag}->configure(-relief => 'sunken'); + } + } + else + { + my ($selstart, $selend) = $self->{text}->tagRanges('sel'); + my @tags = $self->{text}->tagRanges($tag); + my (@starts, @ends); + for(my $i = 0; $i < @tags; $i += 2) + { + push @starts, $tags[$i]; + push @ends, $tags[$i + 1]; + } + for my $start (@starts) + { + for my $end (@ends) + { + if($selstart >= $start and $selend <= $end) + { + $self->{text}->tagRemove($tag, $self->{text}->tagRanges('sel')); + $self->{$tag}->configure(-relief => 'flat'); + return; + } + } + } + $self->{text}->tagAdd($tag, $self->{text}->tagRanges('sel')); + $self->{$tag}->configure(-relief => 'sunken'); + } +} +sub create_tag +{ + my ($self, $tag) = @_; + return if $self->{created_tags}->{$tag}; + my (%tagparams, %fontparams); + if($tag =~ /<u>/) + { + $fontparams{-underline} = 1; + } + if($tag =~ /<b>/) + { + $fontparams{-weight} = 'bold'; + } + if($tag =~ /<i>/) + { + $fontparams{-slant} = 'italic'; + } + $self->tagConfigure($tag, %tagparams, -font => $self->Font(%fontparams)); } - sub to_html { - my ($self, $start, $end) = @_; - - $start ||= '0.0'; - $end ||= 'end'; - - my @tags = $self->{text}->tagNames; - - my $res; - - my $pos = '1.0'; - my $chars; - my %curtags; - my %chartags; - my (@addtags, @deltags); - - while($self->{text}->index($pos) != $self->{text}->index('end')) - { - %chartags = (); - $chartags{$_} = 1 for $self->{text}->tagNames($pos); - delete $chartags{'elide'}; - delete $chartags{'sel'}; - - - for (keys %chartags) - { - push @addtags, $_ unless $curtags{$_} - } - - for (keys %curtags) - { - push @deltags, $_ if !$chartags{$_}; - } - - %curtags = (); - $curtags{$_} = 1 for keys %chartags; - - $res .= $_ for @addtags; - $res .= end_tag($_) for @deltags; - - @deltags = @addtags = (); - - $res .= $self->{text}->get($pos); - $pos = $self->{text}->index('0.0 + ' . ++$chars . " chars"); - } - - return $res; + my ($self, $start, $end) = @_; + $start ||= '0.0'; + $end ||= 'end'; + my @tags = $self->{text}->tagNames; + my $res; + my $pos = '1.0'; + my $chars; + my %curtags; + my %chartags; + my (@addtags, @deltags); + while($self->{text}->index($pos) != $self->{text}->index('end')) + { + %chartags = (); + $chartags{$_} = 1 for $self->{text}->tagNames($pos); + delete $chartags{'elide'}; + delete $chartags{'sel'}; + for (keys %chartags) + { + push @addtags, $_ unless $curtags{$_} + } + for (keys %curtags) + { + push @deltags, $_ if !$chartags{$_}; + } + %curtags = (); + $curtags{$_} = 1 for keys %chartags; + $res .= $_ for @addtags; + $res .= end_tag($_) for @deltags; + @deltags = @addtags = (); + $res .= $self->{text}->get($pos); + $pos = $self->{text}->index('0.0 + ' . ++$chars . " chars"); + } + $res =~ s/\%*ignore\%*//g; + return $res; } - sub end_tag { - my ($tag) = @_; - $tag =~ s/^</<\//; - return $tag; + my ($tag) = @_; + $tag =~ s/^</<\//; + return $tag; } - sub init { - my ($self) = @_; + my ($self) = @_; } - 1; diff --git a/plugins/Tk-GUI/Tk/Browser.pm b/plugins/Tk-GUI/Tk/Browser.pm index 8a4305d..3c3db98 100644 --- a/plugins/Tk-GUI/Tk/Browser.pm +++ b/plugins/Tk-GUI/Tk/Browser.pm @@ -123,8 +123,8 @@ sub a_begin $self->tagBind($tag, '<ButtonPress-1>', [sub { my $cmd; - $cmd = option("Browser") or "\"c:\\program files\\internet explorer\\iexplore.exe\"" if $^O =~ m/Win32/; - $cmd = option("Browser") or "opera" if $^O !~ m/Win32/; + $cmd = defined(option("Browser")) ? option("Browser") : "\"c:\\program files\\internet explorer\\iexplore.exe\"" if $^O =~ m/Win32/; + $cmd = defined(option("Browser")) ? option("Browser") : "opera" if $^O !~ m/Win32/; if($^O !~ m/Win32/) { exec("$cmd $_[1]") unless fork; diff --git a/plugins/XAMP.pl b/plugins/XAMP.pl index 71a232f..5c6d02e 100644 --- a/plugins/XAMP.pl +++ b/plugins/XAMP.pl @@ -50,7 +50,7 @@ my $rem = Xmms::Remote->new; sub get_text { my $text = $rem->get_playlist_title($rem->get_playlist_pos); - $commit = 1 if $text ne $last_text; + $commit = 1 if defined($text) && $text ne $last_text; return $text; } 1; @@ -77,6 +77,7 @@ sub get_artist sub update { my ($text) = get_text(); + return unless defined($text); return if $text eq $last_text; $last_text = $text;