[Tkabber-dev] r28 - trunk/plugins/autoanswer

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Aug 21 16:33:22 MSD 2007


Author: kostix
Date: 2007-08-21 16:33:22 +0400 (Tue, 21 Aug 2007)
New Revision: 28

Modified:
   trunk/plugins/autoanswer/autoanswer.tcl
Log:
Fixed bug with adding toolbar button introduced in previous commit.


Modified: trunk/plugins/autoanswer/autoanswer.tcl
===================================================================
--- trunk/plugins/autoanswer/autoanswer.tcl	2007-08-21 12:16:37 UTC (rev 27)
+++ trunk/plugins/autoanswer/autoanswer.tcl	2007-08-21 12:33:22 UTC (rev 28)
@@ -79,12 +79,8 @@
 }
 
 proc autoanswer::update_toolbar_button {} {
+	variable bindex
 	variable options
-
-	# if button not found, don't do anythyng
-	if { [[tbox] index auto_answer] == -1 } {
-		return
-	}
 	if {$options(enabled)} {
 		set txt [::msgcat::mc "Auto-answer is currently on\nClick to switch it off"]
 		set img toolbar/autoanswer/on
@@ -92,7 +88,7 @@
 		set txt [::msgcat::mc "Auto-answer is currently off\nClick to switch it on"]
 		set img toolbar/autoanswer/off
 	}
-	[tbox] itemconfigure auto_answer \
+	[tbox] itemconfigure $bindex \
 		-command [namespace current]::toggle_active \
 		-image $img -helptext $txt -relief link
 }
@@ -219,7 +215,8 @@
 		[namespace current]::on_status_change
 
 	hook::add finload_hook [namespace code {
-		ifacetk::add_toolbar_button toolbar/autoanswer/on "" ""
+		variable bindex [ifacetk::add_toolbar_button \
+			toolbar/autoanswer/on "" ""]
 		# Actual icon, helptext and command are assigned here:
 		update_toolbar_button
 	}]



More information about the Tkabber-dev mailing list