[Tkabber-dev] r305 - trunk/plugins/nicksanecolors

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Feb 21 14:15:27 MSK 2010


Author: hekp0maht
Date: 2010-02-21 14:15:27 +0300 (Sun, 21 Feb 2010)
New Revision: 305

Modified:
   trunk/plugins/nicksanecolors/Changelog
   trunk/plugins/nicksanecolors/nicksanecolors.tcl
Log:
2010-02-21  Andrey Kozlov  <xmpp:hekp0maht at jabber.ru>
	*   v 0.1.1. Fixed incorrect variable unset.
	*   Now original color pool is being replaced only if new has equal 
	    or greater length.


Modified: trunk/plugins/nicksanecolors/Changelog
===================================================================
--- trunk/plugins/nicksanecolors/Changelog	2010-02-21 06:07:09 UTC (rev 304)
+++ trunk/plugins/nicksanecolors/Changelog	2010-02-21 11:15:27 UTC (rev 305)
@@ -1,3 +1,9 @@
+2010-02-21  Andrey Kozlov  <xmpp:hekp0maht at jabber.ru>
+
+	* v 0.1.1. Fixed incorrect variable unset.
+	* Now original color pool is being replaced only if new has equal 
+	  or greater length.
+
 2010-02-19  Andrey Kozlov  <xmpp:hekp0maht at jabber.ru>
 
 	* v 0.1. Nick color pool now being recalculated on settings change.

Modified: trunk/plugins/nicksanecolors/nicksanecolors.tcl
===================================================================
--- trunk/plugins/nicksanecolors/nicksanecolors.tcl	2010-02-21 06:07:09 UTC (rev 304)
+++ trunk/plugins/nicksanecolors/nicksanecolors.tcl	2010-02-21 11:15:27 UTC (rev 305)
@@ -1,4 +1,4 @@
-# nicksanecolors.tcl, v 0.1 - Copyright (C) 2010 hekp0maht <xmpp:hekp0maht at jabber.ru>
+# nicksanecolors.tcl, v 0.1.1 - Copyright (C) 2010 hekp0maht <xmpp:hekp0maht at jabber.ru>
 # Reinitialize ::plugins::nickcolors::NickColorPool for better text distinction
 # Consider background color when selecting foreground colors
 package require msgcat
@@ -134,8 +134,8 @@
 
 	set color_distance_threshold_min [expr $options(color_threshold_min) * 4294836225]
 	set color_distance_threshold_max [expr $options(color_threshold_max) * 4294836225]
-	
-	if {[info exists NickSaneColorPool]} {unset NickSaneColorPool}
+
+	set NickSaneColorPool [list]
 	set bgcolor_rgb [winfo rgb . [option get . *Chat.background Chat]]
 	set r0 [lindex $bgcolor_rgb 0]
 	set g0 [lindex $bgcolor_rgb 1]
@@ -150,14 +150,12 @@
 			lappend NickSaneColorPool $color_name
 		}
 	}
-	if {[llength $NickSaneColorPool]} {
-		if {[info exists ::plugins::nickcolors::NickColorPool]} {
-			lset ::plugins::nickcolors::NickColorPool $NickSaneColorPool
-			::plugins::nickcolors::change_options
-		}
+	if {[llength $NickSaneColorPool] >= [llength $origPool]} {
+		lset ::plugins::nickcolors::NickColorPool $NickSaneColorPool
 	} else {
 		lset ::plugins::nickcolors::NickColorPool $origPool
 	}
+	::plugins::nickcolors::change_options
 }
 
 proc nicksanecolors::load {} {



More information about the Tkabber-dev mailing list