Hi square,
I noticed that what you say is mainly "try my plugin and you'll see" and you 
think that Phil says you modified 
too many things, I'll try and make this clear :
1 - to do something, you can write 100 different codes that do the same thing
2 - for the 100 different codes, each one represents a design, one usually only 
1 or 2 designs are 'good'
3 - the new CL already has a very good design, so any additional code on top of 
it should follow the same design
4 - if we put two designs in one module, the module becomes dirty/hacky code 
which is very bad for 
maintainability
5 - your plugin may work but it doesn't belong to the new CL's code.. 

if you want to make phil happy and have your patch applied to SVN, you need to 
read how the new CL works and fix 
it the right way, not with hacky code.. phil could exlpain a bit more.

We rewrote the contact list, not to have a background, not to have skinable 
groups, but to have a better 
maintainable code, better performance and skinning as a bonus.

KKRT

On Fri, Mar 23, 2007 at 03:52:45PM +0100, square87 wrote:
> 2007/3/22, Philippe Valembois - Phil <[EMAIL PROTECTED]>:
> >
> >Hi,
> 
> 
> Hi Phil, thanks for the reply.
> 
> I can't commit your patch you sent because it modifies many parts of the
> >newCL and it seems you didn't understood at all how it works now...
> 
> 
> 
> My patch doesn't modifies many parts. There are only events, and
> splainf/sitalf font is stored in a variable. This is all.
> That events are fundamental to parse a nickname or psm (the nickarray event,
> as you can see, isn't a good choice)
> You see many changes, because in _drawing psm_ there is a similar thing:
> 
>             if {[::config::getKey psmplace] == 1 } {
>                 set parsedpsm [::smiley::parseMessageToList " - $psm" 1]
>                 instructions....
>             }
>             if {[::config::getKey psmplace] == 2 } {
>                 set parsedpsm [::smiley::parseMessageToList "\n$psm" 1]
>                 istructions.... (the same instruction)
>            }
> 
> and i changed it in a more clear code:
>             set parsedpsm ""
>             if {[::config::getKey psmplace] == 1 } {
>                 set parsedpsm [::smiley::parseMessageToList " - $psm" 1]
>            } elseif {[::config::getKey psmplace] == 2 } {
>                 set parsedpsm [::smiley::parseMessageToList "\n$psm" 1]
>            }
>            istructions...
> 
> but this is not important for the plugin, so you can ignore.
> 
> I never said to use aMSNPlus I agree it should be in another plugin that
> >handles all colored nicks but you MUST look at how it currently works in
> >aMSNPlus as the newCL offers the way to modify colors...
> 
> 
> only colors at the moment and only with nickarray event, that is not really
> good.
> 
> About fonts, yes I know you will say that we can't modify fonts and it's
> >true, that shouldn't be done in a such way... Look at how colors work
> >now... With your modification, the font will be the same for all the
> >nickname... I don't think it's a clean way to do that. You must add a
> >tag font like there are the tags text and color.
> 
> 
> Please try before my plugin and the judge
> 
> I hope you won't be take that too personally... I only want to keep a
> >clean design for this newCL.
> 
> 
> I only need a variable for font and 4 events (2 for nicks and 2 for psms, if
> we want to parse also psms...). I don't think that can stain the newCL.
> As I said before. Try my plugin,
> 
> I uploaded the diff (with only essential things) and here you can find the
> plugin:
> http://in.solit.us/archives/download/15885
> You can apply this change locally on your pc, try the plugin and then you
> can say me what do you think about the plugin or what must be changed and
> what i didn't understand...
> 
> Phil
> >PS If you have any question about how work nick coloring in aMSNPlus
> >don't hesitate to ask...
> 
> 
> 
> Sorry for my English.
> Thanks for all.
> Square87

> Index: guicontactlist.tcl
> ===================================================================
> --- guicontactlist.tcl        (revision 8233)
> +++ guicontactlist.tcl        (working copy)
> @@ -1175,6 +1175,12 @@
>               set relxnickpos $xnickpos
>               set relynickpos $ypos
>  
> +             #this event could be used by colorednicks plugin
> +             set evPar(email) email
> +             set evPar(parsednick) parsednick
> +             ::plugins::PostEvent parsed_nick evPar
> +             set familyfont "splainf"
> +
>               foreach unit $parsednick {
>                       if {[lindex $unit 0] == "text"} {
>                               # Check if we are still allowed to write text,\
> @@ -1193,9 +1199,9 @@
>  
>                               # Check if text is not too long and should be 
> truncated, then
>                               # first truncate it and restore it in $textpart 
> and set the linefull
> -                             if {[expr {$relxnickpos + [font measure splainf 
> $textpart]}] > $maxwidth} {
> +                             if {[expr {$relxnickpos + [font measure 
> $familyfont $textpart]}] > $maxwidth} {
>                                       set textpart 
> [::guiContactList::truncateText $textpart \
> -                                             [expr {$maxwidth - 
> $relxnickpos}] splainf]
> +                                             [expr {$maxwidth - 
> $relxnickpos}] $familyfont]
>  
>                                       #If we don't truncate we don't put 
> ellipsis
>                                       #!$maxwidth already left space for the 
> ellipsis
> @@ -1207,8 +1213,8 @@
>  
>                               # Draw the text
>                               $canvas create text $relxnickpos $ynickpos 
> -text $textpart -anchor w -fill \
> -                                     $relnickcolour -font splainf -tags 
> [list contact $tag nicktext $main_part]
> -                             set textwidth [font measure splainf $textpart]
> +                                     $relnickcolour -font $familyfont -tags 
> [list contact $tag nicktext $main_part]
> +                             set textwidth [font measure $familyfont 
> $textpart]
>  
>                               # Append underline coords
>                               set yunderline [expr {$ynickpos + $textheight + 
> 1}]
> @@ -1261,6 +1267,10 @@
>                                       set relnickcolour $nickcolour
>                               }
>                       } else {
> +                             set evPar(unit) unit
> +                             set evPar(familyfont) familyfont
> +                             ::plugins::PostEvent parsed_unit evPar
> +
>                               status_log "Unknown item in parsed nickname: 
> $unit"
>                       }
>               #END the foreach loop
> @@ -1327,6 +1337,14 @@
>  
>                       if {[::config::getKey psmplace] == 1 } {
>                               set parsedpsm [::smiley::parseMessageToList " - 
> $psm" 1]
> +
> +                             #this settings and event are used by 
> colorednicks plugin
> +                             set parsednick $parsedpsm
> +                             set evPar(parsednick) parsednick
> +                             ::plugins::PostEvent parsed_nick evPar
> +                             set parsedpsm $parsednick
> +                             set familyfont "sitalf"
> +
>                               foreach unit $parsedpsm {
>                                       if {[lindex $unit 0] == "text"} {
>                                               # Check if we are still allowed 
> to write text
> @@ -1344,9 +1362,9 @@
>               
>                                               # Check if text is not too long 
> and should be truncated, then
>                                               # first truncate it and restore 
> it in $textpart and set the linefull
> -                                             if {[expr {$relxnickpos + [font 
> measure sitalf $textpart]}] > $maxwidth} {
> +                                             if {[expr {$relxnickpos + [font 
> measure $familyfont $textpart]}] > $maxwidth} {
>                                                       set textpart 
> [::guiContactList::truncateText $textpart \
> -                                                             [expr 
> {$maxwidth - $relxnickpos}] sitalf]
> +                                                             [expr 
> {$maxwidth - $relxnickpos}] $familyfont]
>                                                       set textpart 
> "$textpart$ellips"
>               
>                                                       # This line is full, 
> don't draw anything anymore before we start a new line
> @@ -1355,8 +1373,8 @@
>               
>                                               # Draw the text
>                                               $canvas create text 
> $relxnickpos $ynickpos -text $textpart -anchor w -fill \
> -                                                     $relnickcolour -font 
> sitalf -tags [list contact $tag psmtext $main_part]
> -                                             set textwidth [font measure 
> sitalf $textpart]
> +                                                     $relnickcolour -font 
> $familyfont -tags [list contact $tag psmtext $main_part]
> +                                             set textwidth [font measure 
> $familyfont $textpart]
>               
>                                               # Append underline coords
>                                               set yunderline [expr {$ynickpos 
> + $textheight + 1}]
> @@ -1408,12 +1426,24 @@
>                                               if {$relnickcolour == "reset"} {
>                                                       set relnickcolour 
> $nickcolour
>                                               }
> +                                     } else {
> +                                             set evPar(unit) unit
> +                                             set evPar(familyfont) familyfont
> +                                             ::plugins::PostEvent 
> parsed_unit evPar
> +                                             set familyfont "$familyfont 
> italic"
>                                       }
>                                       # END the foreach loop
>                               }
>                       } elseif {[::config::getKey psmplace] == 2 } {
>                               set parsedpsm [::smiley::parseMessageToList 
> "\n$psm" 1]
>  
> +                             #this settings and event are used by 
> colorednicks plugin
> +                             set parsednick $parsedpsm
> +                             set evPar(parsednick) parsednick
> +                             ::plugins::PostEvent parsed_nick evPar
> +                             set parsedpsm $parsednick
> +                             set familyfont "sitalf"
> +
>                               foreach unit $parsedpsm {
>                                       if {[lindex $unit 0] == "text"} {
>                                               # Check if we are still allowed 
> to write text
> @@ -1431,9 +1461,9 @@
>               
>                                               # Check if text is not too long 
> and should be truncated, then
>                                               # first truncate it and restore 
> it in $textpart and set the linefull
> -                                             if {[expr {$relxnickpos + [font 
> measure sitalf $textpart]}] > $maxwidth} {
> +                                             if {[expr {$relxnickpos + [font 
> measure $familyfont $textpart]}] > $maxwidth} {
>                                                       set textpart 
> [::guiContactList::truncateText $textpart \
> -                                                             [expr 
> {$maxwidth - $relxnickpos}] sitalf]
> +                                                             [expr 
> {$maxwidth - $relxnickpos}] $familyfont]
>                                                       set textpart 
> "$textpart$ellips"
>               
>                                                       # This line is full, 
> don't draw anything anymore before we start a new line
> @@ -1442,8 +1472,8 @@
>               
>                                               # Draw the text
>                                               $canvas create text 
> $relxnickpos $ynickpos -text $textpart -anchor w -fill \
> -                                                     $relnickcolour -font 
> sitalf -tags [list contact $tag psmtext $main_part]
> -                                             set textwidth [font measure 
> sitalf $textpart]
> +                                                     $relnickcolour -font 
> $familyfont -tags [list contact $tag psmtext $main_part]
> +                                             set textwidth [font measure 
> $familyfont $textpart]
>               
>                                               # Append underline coords
>                                               set yunderline [expr {$ynickpos 
> + $textheight + 1}]
> @@ -1495,6 +1525,11 @@
>                                               if {$relnickcolour == "reset"} {
>                                                       set relnickcolour 
> $nickcolour
>                                               }
> +                                     } else {
> +                                             set evPar(unit) unit
> +                                             set evPar(familyfont) familyfont
> +                                             ::plugins::PostEvent 
> parsed_unit evPar
> +                                             set familyfont "$familyfont 
> italic"
>                                       }
>                                       # END the foreach loop
>                               }

> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Amsn-devel mailing list
> Amsn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amsn-devel


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to