[Tkabber-dev] r1775 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Apr 3 00:31:34 MSD 2009


Author: sergei
Date: 2009-04-03 00:31:33 +0400 (Fri, 03 Apr 2009)
New Revision: 1775

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/custom.tcl
Log:
	* custom.tcl: Added a hack which allows to load external plugins before
	  their customized settings are to be applied.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-04-02 19:50:30 UTC (rev 1774)
+++ trunk/tkabber/ChangeLog	2009-04-02 20:31:33 UTC (rev 1775)
@@ -3,6 +3,9 @@
 	* plugins/general/comm.tcl, tkabber-remote.tcl: Made errors from a
 	  remote Tkabber reported, and not showed in the Tkabber itself.
 
+	* custom.tcl: Added a hack which allows to load external plugins before
+	  their customized settings are to be applied.
+
 2009-04-01  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/general/comm.tcl, tkabber-remote.tcl: Added proof-of-concept

Modified: trunk/tkabber/custom.tcl
===================================================================
--- trunk/tkabber/custom.tcl	2009-04-02 19:50:30 UTC (rev 1774)
+++ trunk/tkabber/custom.tcl	2009-04-02 20:31:33 UTC (rev 1775)
@@ -810,9 +810,23 @@
 	foreach opt $opts {
 	    lassign $opt varname value
 
-	    set saved($varname) $value
-	    catch {set $varname $value}
+	    # HACK: ::plugins::loaded(*) variables must be processed first
+	    if {[string match ::plugins::loaded(*) $varname]} {
+		set saved($varname) $value
+		catch {set $varname $value}
+	    }
 	}
+
+	foreach opt $opts {
+	    lassign $opt varname value
+
+	    # HACK: matching variables other than ::plugins::loaded(*)
+	    # TODO: What to do with variables which namespace isn't created?
+	    if {![string match ::plugins::loaded(*) $varname]} {
+		set saved($varname) $value
+		catch {set $varname $value}
+	    }
+	}
     }
 
     foreach idx [array names var default,*] {



More information about the Tkabber-dev mailing list