[Tkabber-dev] r433 - in trunk/plugins/tabimages: . msgs

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Oct 27 03:10:23 MSD 2010


Author: Rejjin
Date: 2010-10-27 03:10:23 +0400 (Wed, 27 Oct 2010)
New Revision: 433

Modified:
   trunk/plugins/tabimages/msgs/ru.msg
   trunk/plugins/tabimages/tabimages.tcl
Log:
Fixed translation bugs.
Fixed bugs in plugin code.

Modified: trunk/plugins/tabimages/msgs/ru.msg
===================================================================
--- trunk/plugins/tabimages/msgs/ru.msg	2010-10-25 01:28:42 UTC (rev 432)
+++ trunk/plugins/tabimages/msgs/ru.msg	2010-10-26 23:10:23 UTC (rev 433)
@@ -6,6 +6,6 @@
 ::msgcat::mcset ru "Font to use in tabs bar window" "Шрифт для вкладок"
 ::msgcat::mcset ru "Position of icon in tab" "Позиция иконки во вкладке"
 ::msgcat::mcset ru "Top" "Сверху"
-::msgcat::mcset ru "Left" "Снизу"
+::msgcat::mcset ru "Left" "Слева"
 ::msgcat::mcset ru "Right" "Справа"
-::msgcat::mcset ru "Bottom" "Слева"
\ No newline at end of file
+::msgcat::mcset ru "Bottom" "Снизу"
\ No newline at end of file

Modified: trunk/plugins/tabimages/tabimages.tcl
===================================================================
--- trunk/plugins/tabimages/tabimages.tcl	2010-10-25 01:28:42 UTC (rev 432)
+++ trunk/plugins/tabimages/tabimages.tcl	2010-10-26 23:10:23 UTC (rev 433)
@@ -67,42 +67,46 @@
 		
 		set xlib [chat::get_xlib $chatid]
 		set jid [chat::get_jid $chatid]
-		set status [get_jid_status $xlib $jid]
 		
-		switch -- [chat::is_chat $chatid] {
-			1 {set icon roster/user/$status}
-			0 {set icon roster/conference/$status}
-		}
+		set icon [get_icon $xlib $jid]
+		set tab [get_tab_button $chatid]
 		
-		set tab_path [get_tab_button $chatid]
-		configure_tab_button $tab_path $icon left
+		configure_tab_button $tab $icon
 	}	
 		
 	proc change_presence { xlib jid type x args } {
 		variable state
 	
-		if !$::usetabbar return
+		if {!$::usetabbar} {
+			return
+		}
 		
 		set chatid [chat::chatid $xlib $jid]
 		
 		switch -- $state {
 			0 return
-			2 { if [chat::is_groupchat $chatid] return }
-			3 { if [chat::is_chat $chatid] return }
+			2 { 
+				if [chat::is_groupchat $chatid] return 
+			}
+			3 { 
+				if [chat::is_chat $chatid] return 
+			}
 		}
 		
-		if ![chat::is_opened $chatid] return
-		
-		if {[chat::is_groupchat $chatid] && [chat::is_opened $chatid]} {
-			configure_tab_button [get_tab_button $chatid] \
-			roster/conference/$type left
+		if {![chat::is_opened $chatid]} {
 			return
 		}
 		
-		set icon roster/user/[get_jid_status $xlib $jid]
-		configure_tab_button [get_tab_button $chatid] $icon left
+		set icon [get_icon $xlib $jid]
+		set tab [get_tab_button $chatid]
+		
+		configure_tab_button $tab $icon
 	}
 	
+	proc get_icon {xlib jid} {
+		return [::ifacetk::roster::get_jid_icon $xlib $jid]
+	}
+	
 	proc get_tab_button chatid {
 		return [ifacetk::nbpage [chat::winid $chatid]]
 	}
@@ -111,7 +115,7 @@
 		return $chat::chats(type,$chatid)
 	}
 	
-	proc configure_tab_button {tab_path icon { cmp none }} {
+	proc configure_tab_button {tab_path icon} {
 		variable options
 		variable compound
 		
@@ -124,7 +128,7 @@
 		foreach chatid [chat::opened] {
 			if $reload { 
 				configure_tab_button \
-				[get_tab_button $chatid] {} 
+					[get_tab_button $chatid] {}
 			}
 			update_tab $chatid [chat_type $chatid]
 		}
@@ -133,7 +137,9 @@
 	proc switch_font args {
 		variable font
 		
-		if !$::usetabbar return
+		if {!$::usetabbar} {
+			return
+		}
 		
 		option add *ButtonBar*Button*Font $font
 		foreach wbutton [ButtonBar::pages .nb] {



More information about the Tkabber-dev mailing list