[Tkabber-dev] r787 - in trunk/tkabber: . plugins/richtext

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Nov 6 18:09:59 MSK 2006


Author: sergei
Date: 2006-11-06 18:09:56 +0300 (Mon, 06 Nov 2006)
New Revision: 787

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/richtext/emoticons.tcl
Log:
	* plugins/richtext/emoticons.tcl: Renamed merge_dir command
	  to load_dir (restored nondestructive behaviour of load_dir).
	  Added clean command, which destroys all loaded emoticons.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-11-05 20:57:06 UTC (rev 786)
+++ trunk/tkabber/ChangeLog	2006-11-06 15:09:56 UTC (rev 787)
@@ -1,3 +1,9 @@
+2006-11-06  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/richtext/emoticons.tcl: Renamed merge_dir command
+	  to load_dir (restored nondestructive behaviour of load_dir).
+	  Added clean command, which destroys all loaded emoticons.
+
 2006-11-05  Sergei Golovan  <sgolovan at nes.ru>
 
 	* README, doc/tkabber.html, doc/tkabber.xml: Fixed default

Modified: trunk/tkabber/plugins/richtext/emoticons.tcl
===================================================================
--- trunk/tkabber/plugins/richtext/emoticons.tcl	2006-11-05 20:57:06 UTC (rev 786)
+++ trunk/tkabber/plugins/richtext/emoticons.tcl	2006-11-06 15:09:56 UTC (rev 787)
@@ -96,8 +96,8 @@
     }
 }
 
-# Destroys all emoticons, then loads a new set of them:
-proc emoticons::load_dir {dir} {
+# Destroys all emoticons:
+proc emoticons::clean {} {
     variable images
     variable emoticons
     variable txtdefaults
@@ -116,19 +116,16 @@
     foreach iname [array names images] {
 	set images($iname) 0
     }
-
-    # Load fresh images:
-    if {$dir != ""} {
-	merge_dir $dir
-    }
 }
 
-# Merges a new set of emoticons, adding them to the existing set,
+# Loads a new set of emoticons, adding them to the existing set,
 # replacing any existing emoticons with the same mnemonics:
-proc emoticons::merge_dir {dir} {
+proc emoticons::load_dir {dir} {
     variable images
     variable faces_regexp
 
+    if {$dir == ""} return
+
     set icondef_path [file join $dir icondef.xml]
     if {![file isfile $icondef_path]} {
 	### TODO: some error messages
@@ -525,6 +522,7 @@
     variable options
 
     if {$options(active_theme) != $options(theme)} {
+	clean
 	load_dir $options(theme)
     }
 }



More information about the Tkabber-dev mailing list