[Tkabber-dev] r1736 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Mar 15 18:18:53 MSK 2009


Author: sergei
Date: 2009-03-15 18:18:52 +0300 (Sun, 15 Mar 2009)
New Revision: 1736

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/custom.tcl
   trunk/tkabber/pixmaps.tcl
Log:
	* custom.tcl: Trigger assigned commands for all customization variables
	  after restoring from the stored file, and not only for those which
	  were in the file.

	* pixmaps.tcl: Allow pixmaps theme option to be equal to non-existent
	  theme name and clean themes array before reloading. This helps to
	  load iconsets plugin.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-03-15 08:02:28 UTC (rev 1735)
+++ trunk/tkabber/ChangeLog	2009-03-15 15:18:52 UTC (rev 1736)
@@ -6,6 +6,14 @@
 	  old robot challenge support and moved media element parsing to
 	  TclXMPP.
 
+	* custom.tcl: Trigger assigned commands for all customization variables
+	  after restoring from the stored file, and not only for those which
+	  were in the file.
+
+	* pixmaps.tcl: Allow pixmaps theme option to be equal to non-existent
+	  theme name and clean themes array before reloading. This helps to
+	  load iconsets plugin.
+
 2009-03-14  Sergei Golovan  <sgolovan at nes.ru>
 
 	* chats.tcl, muc.tcl: Converted chat and conference menus into dynamic

Modified: trunk/tkabber/custom.tcl
===================================================================
--- trunk/tkabber/custom.tcl	2009-03-15 08:02:28 UTC (rev 1735)
+++ trunk/tkabber/custom.tcl	2009-03-15 15:18:52 UTC (rev 1736)
@@ -818,6 +818,16 @@
 	catch {set $varname $value}
     }
 
+    foreach idx [array names var default,*] {
+	set varname [string range $idx 8 end]
+
+	if {![info exists saved($varname)]} {
+	    # We have to trigger commands bound to the variable
+	    # if it was set in config or as default
+	    catch {set $varname [set $varname]}
+	}
+    }
+
     set custom_loaded 1
 }
 

Modified: trunk/tkabber/pixmaps.tcl
===================================================================
--- trunk/tkabber/pixmaps.tcl	2009-03-15 08:02:28 UTC (rev 1735)
+++ trunk/tkabber/pixmaps.tcl	2009-03-15 15:18:52 UTC (rev 1736)
@@ -50,20 +50,21 @@
 proc pixmaps::load_stored_theme {args} {
     variable options
 
-    if {[catch {load_theme $options(pixmaps_theme)}]} {
-	set options(pixmaps_theme) Default
+    catch {
+	load_theme $options(pixmaps_theme)
     }
 
     hook::run set_theme_hook
 }
 
-hook::add postload_hook [namespace current]::pixmaps::load_stored_theme 70
-
 ###############################################################################
 
 proc pixmaps::load_themes {} {
     variable theme_dirs
+    variable themes
 
+    array unset themes
+
     foreach dir $theme_dirs {
 	load_theme_name [namespace current]::themes $dir
     }



More information about the Tkabber-dev mailing list