[Tkabber-dev] r1676 - in trunk/tkabber-plugins: . aniemoticons attline debug socials

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Feb 20 14:11:27 MSK 2009


Author: sergei
Date: 2009-02-20 14:11:27 +0300 (Fri, 20 Feb 2009)
New Revision: 1676

Removed:
   trunk/tkabber-plugins/aniemoticons/preload.tcl
   trunk/tkabber-plugins/attline/preload.tcl
   trunk/tkabber-plugins/debug/preload.tcl
   trunk/tkabber-plugins/socials/preload.tcl
Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/aniemoticons/aniemoticons.tcl
   trunk/tkabber-plugins/attline/attline.tcl
   trunk/tkabber-plugins/debug/debug.tcl
   trunk/tkabber-plugins/socials/socials.tcl
Log:
	* aniemoticons/aniemoticons.tcl, attline/attline.tcl,
	  debug/debug.tcl, socials/socials.tcl: Moved plugin preloading code
	  to the main plugin files.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2009-02-20 11:11:09 UTC (rev 1675)
+++ trunk/tkabber-plugins/ChangeLog	2009-02-20 11:11:27 UTC (rev 1676)
@@ -1,3 +1,9 @@
+2009-02-20  Sergei Golovan <sgolovan at nes.ru>
+
+	* aniemoticons/aniemoticons.tcl, attline/attline.tcl,
+	  debug/debug.tcl, socials/socials.tcl: Moved plugin preloading code
+	  to the main plugin files.
+
 2009-02-19  Sergei Golovan <sgolovan at nes.ru>
 
 	* attline/msgs/de.msg, debug/msgs/de.msg: Updated German translation

Modified: trunk/tkabber-plugins/aniemoticons/aniemoticons.tcl
===================================================================
--- trunk/tkabber-plugins/aniemoticons/aniemoticons.tcl	2009-02-20 11:11:09 UTC (rev 1675)
+++ trunk/tkabber-plugins/aniemoticons/aniemoticons.tcl	2009-02-20 11:11:27 UTC (rev 1676)
@@ -1,11 +1,25 @@
 # $Id$
 
+package require msgcat
+
+namespace eval aniemoticons {
+    ::msgcat::mcload [file join [file dirname [info script]] msgs]
+
+    if {![::plugins::is_registered aniemoticons]} {
+	::plugins::register aniemoticons \
+			    -namespace [namespace current] \
+			    -source [info script] \
+			    -description [::msgcat::mc "Whether the animated GIFs support plugin is loaded."] \
+			    -loadcommand [namespace code load] \
+			    -unloadcommand [namespace code unload]
+	return
+    }
+}
+
 namespace eval :: {
     source [file join [file dirname [info script]] anigif.tcl]
 }
 
-namespace eval aniemoticons {}
-
 proc aniemoticons::load {} {
     rename ::plugins::emoticons::create_image ::plugins::emoticons::create_image:anigif
     rename ::plugins::emoticons::delete_image ::plugins::emoticons::delete_image:anigif

Deleted: trunk/tkabber-plugins/aniemoticons/preload.tcl
===================================================================
--- trunk/tkabber-plugins/aniemoticons/preload.tcl	2009-02-20 11:11:09 UTC (rev 1675)
+++ trunk/tkabber-plugins/aniemoticons/preload.tcl	2009-02-20 11:11:27 UTC (rev 1676)
@@ -1,16 +0,0 @@
-# $Id$
-
-package require msgcat
-
-namespace eval aniemoticons {
-    ::msgcat::mcload [file join [file dirname [info script]] msgs]
-
-    ::plugins::register debug \
-			-namespace [namespace current] \
-			-source [file join [file dirname [info script]] aniemoticons.tcl] \
-			-description [::msgcat::mc "Whether the animated GIFs support plugin is loaded."] \
-			-loadcommand [namespace code load] \
-			-unloadcommand [namespace code unload]
-}
-
-# vim:ts=8:sw=4:sts=4:noet

Modified: trunk/tkabber-plugins/attline/attline.tcl
===================================================================
--- trunk/tkabber-plugins/attline/attline.tcl	2009-02-20 11:11:09 UTC (rev 1675)
+++ trunk/tkabber-plugins/attline/attline.tcl	2009-02-20 11:11:27 UTC (rev 1676)
@@ -4,12 +4,26 @@
 # Written by Konstantin Khomoutov <flatworm at users.sourceforge.net>
 # See license.terms for the terms of distribution.
 
-option add *Chat.attentionLineHeight        1     widgetDefault
-option add *Chat.attentionLineColor         black widgetDefault
-option add *Chat.attentionLinePadX          5     widgetDefault
-option add *Chat.attentionLinePadY          0     widgetDefault
+package require msgcat
 
 namespace eval attline {
+    ::msgcat::mcload [file join [file dirname [info script]] msgs]
+
+    if {![::plugins::is_registered attline]} {
+	::plugins::register attline \
+			    -namespace [namespace current] \
+			    -source [info script] \
+			    -description [::msgcat::mc "Whether the Attention Line plugin is loaded."] \
+			    -loadcommand [namespace code load] \
+			    -unloadcommand [namespace code unload]
+	return
+    }
+
+    option add *Chat.attentionLineHeight        1     widgetDefault
+    option add *Chat.attentionLineColor         black widgetDefault
+    option add *Chat.attentionLinePadX          5     widgetDefault
+    option add *Chat.attentionLinePadY          0     widgetDefault
+
     variable state
     variable options
 

Deleted: trunk/tkabber-plugins/attline/preload.tcl
===================================================================
--- trunk/tkabber-plugins/attline/preload.tcl	2009-02-20 11:11:09 UTC (rev 1675)
+++ trunk/tkabber-plugins/attline/preload.tcl	2009-02-20 11:11:27 UTC (rev 1676)
@@ -1,16 +0,0 @@
-# $Id$
-
-package require msgcat
-
-namespace eval attline {
-    ::msgcat::mcload [file join [file dirname [info script]] msgs]
-
-    ::plugins::register attline \
-			-namespace [namespace current] \
-			-source [file join [file dirname [info script]] attline.tcl] \
-			-description [::msgcat::mc "Whether the Attention Line plugin is loaded."] \
-			-loadcommand [namespace code load] \
-			-unloadcommand [namespace code unload]
-}
-
-# vim:ts=8:sw=4:sts=4:noet

Modified: trunk/tkabber-plugins/debug/debug.tcl
===================================================================
--- trunk/tkabber-plugins/debug/debug.tcl	2009-02-20 11:11:09 UTC (rev 1675)
+++ trunk/tkabber-plugins/debug/debug.tcl	2009-02-20 11:11:27 UTC (rev 1676)
@@ -7,7 +7,21 @@
 #
 # $Id$
 
+package require msgcat
+
 namespace eval debug {
+    ::msgcat::mcload [file join [file dirname [info script]] msgs]
+
+    if {![::plugins::is_registered debug]} {
+	::plugins::register debug \
+			    -namespace [namespace current] \
+			    -source [info script] \
+			    -description [::msgcat::mc "Whether the Debug live plugin is loaded."] \
+			    -loadcommand [namespace code load] \
+			    -unloadcommand [namespace code unload]
+	return
+    }
+
     custom::defgroup Plugins [::msgcat::mc "Plugins options."] \
 	-group Tkabber
 

Deleted: trunk/tkabber-plugins/debug/preload.tcl
===================================================================
--- trunk/tkabber-plugins/debug/preload.tcl	2009-02-20 11:11:09 UTC (rev 1675)
+++ trunk/tkabber-plugins/debug/preload.tcl	2009-02-20 11:11:27 UTC (rev 1676)
@@ -1,16 +0,0 @@
-# $Id$
-
-package require msgcat
-
-namespace eval debug {
-    ::msgcat::mcload [file join [file dirname [info script]] msgs]
-
-    ::plugins::register debug \
-			-namespace [namespace current] \
-			-source [file join [file dirname [info script]] debug.tcl] \
-			-description [::msgcat::mc "Whether the Debug live plugin is loaded."] \
-			-loadcommand [namespace code load] \
-			-unloadcommand [namespace code unload]
-}
-
-# vim:ts=8:sw=4:sts=4:noet

Deleted: trunk/tkabber-plugins/socials/preload.tcl
===================================================================
--- trunk/tkabber-plugins/socials/preload.tcl	2009-02-20 11:11:09 UTC (rev 1675)
+++ trunk/tkabber-plugins/socials/preload.tcl	2009-02-20 11:11:27 UTC (rev 1676)
@@ -1,17 +0,0 @@
-# $Id$
-
-package require msgcat
-
-namespace eval socials {
-    ::msgcat::mcload [file join [file dirname [info script]] msgs]
-
-    ::plugins::register socials \
-			-namespace [namespace current] \
-			-source [file join [file dirname [info script]] socials.tcl] \
-			-description [::msgcat::mc "Whether the Socials plugin is loaded."] \
-			-loadcommand [namespace code [list load [file join [file dirname [info script]] socials.ru] \
-								koi8-r]] \
-			-unloadcommand [namespace code unload]
-}
-
-# vim:ts=8:sw=4:sts=4:noet

Modified: trunk/tkabber-plugins/socials/socials.tcl
===================================================================
--- trunk/tkabber-plugins/socials/socials.tcl	2009-02-20 11:11:09 UTC (rev 1675)
+++ trunk/tkabber-plugins/socials/socials.tcl	2009-02-20 11:11:27 UTC (rev 1676)
@@ -1,7 +1,25 @@
 # $Id$
 
-namespace eval socials {}
+package require msgcat
 
+namespace eval socials {
+    ::msgcat::mcload [file join [file dirname [info script]] msgs]
+
+    if {![::plugins::is_registered socials]} {
+	::plugins::register socials \
+			    -namespace [namespace current] \
+			    -source [info script] \
+			    -description [::msgcat::mc "Whether the Socials plugin is loaded."] \
+			    -loadcommand [namespace code \
+						    [list load [file join \
+								     [file dirname [info script]] \
+								     socials.ru] \
+							       koi8-r]] \
+			    -unloadcommand [namespace code unload]
+	return
+    }
+}
+
 proc socials::load {filename {enc utf-8}} {
     variable social_list {}
     variable social



More information about the Tkabber-dev mailing list