[Tkabber-dev] r709 - in trunk/tkabber: . pixmaps/default pixmaps/gabber pixmaps/jajc pixmaps/kroc

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Sep 10 00:14:08 MSD 2006


Author: sergei
Date: 2006-09-10 00:14:00 +0400 (Sun, 10 Sep 2006)
New Revision: 709

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/disco.tcl
   trunk/tkabber/muc.tcl
   trunk/tkabber/pixmaps/default/icondef.xml
   trunk/tkabber/pixmaps/gabber/icondef.xml
   trunk/tkabber/pixmaps/jajc/icondef.xml
   trunk/tkabber/pixmaps/kroc/icondef.xml
   trunk/tkabber/roster.tcl
Log:
	* roster.tcl, pixmaps/*/icondef.xml: Replaced x-gadugadu gateway
	  type by gadu-gadu as the latter is registed by Jabber Registrar.
	  Added sms gateway icon to disco/browser.

	* muc.tcl: Bugfix. Convert MUC room JID to lowercase before
	  joining it.

	* disco.tcl: Added displaying number of items in every node's
	  title.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-09-09 12:05:04 UTC (rev 708)
+++ trunk/tkabber/ChangeLog	2006-09-09 20:14:00 UTC (rev 709)
@@ -1,3 +1,15 @@
+2006-09-10  Sergei Golovan  <sgolovan at nes.ru>
+
+	* roster.tcl, pixmaps/*/icondef.xml: Replaced x-gadugadu gateway
+	  type by gadu-gadu as the latter is registed by Jabber Registrar.
+	  Added sms gateway icon to disco/browser.
+
+	* muc.tcl: Bugfix. Convert MUC room JID to lowercase before
+	  joining it.
+
+	* disco.tcl: Added displaying number of items in every node's
+	  title.
+
 2006-09-09  Sergei Golovan  <sgolovan at nes.ru>
 
 	* browser.tcl, disco.tcl: Removed hardcoded icon names
@@ -8,7 +20,7 @@
 
 	* pixmaps/default/services/mrim_*.gif,
 	  pixmaps/default/icondef.xml: Added Mail.ru Instant Messenger
-	  icons.
+	  icons (thanks to Konstantin Khomoutov).
 
 	* plugins/unix/wmdock.tcl, plugins/general/headlines.tcl:
 	  Changed displayed icon names.

Modified: trunk/tkabber/disco.tcl
===================================================================
--- trunk/tkabber/disco.tcl	2006-09-09 12:05:04 UTC (rev 708)
+++ trunk/tkabber/disco.tcl	2006-09-09 20:14:00 UTC (rev 709)
@@ -228,6 +228,15 @@
     }
 }
 
+proc disco::get_jid_items {jid node} {
+    variable disco
+    if {[info exists disco(items,$jid,$node)]} {
+	return $disco(items,$jid,$node)
+    } else {
+	return {}
+    }
+}
+
 ###############################################################################
 
 proc disco::info_query_get_handler {connid from child} {
@@ -562,7 +571,12 @@
     set tnode [jid_to_tag [list $jid $node]]
     set parent_tag [jid_to_tag [list $jid $node]]
     set data [list item $jid $node]
-    set desc [item_desc $jid $node $name]
+    if {![$tw exists $tnode] || [llength [$tw nodes $tnode]] == 0} {
+	set nitems 0
+    } else {
+	set nitems [llength [disco::get_jid_items $jid $node]]
+    }
+    set desc [item_desc $jid $node $name $nitems]
     set icon ""
 
     add_line $tw $parent_tag $tnode $icon $desc $data -font $font \
@@ -635,8 +649,7 @@
 		set desc "$tmp(*) ($var)"
 	    }
 	}
-	# TODO
-	set icon ""; #[item_icon $category $type]
+	set icon ""
 
 	add_line $tw $parent_tag $tnode $icon $desc $data \
 	    -fill $config(featurecolor)
@@ -671,13 +684,17 @@
 
     set tw $browser(tree,$w)
 
+    set parent_tag [jid_to_tag [list $jid $node]]
+
+    set name [disco::get_jid_name $jid $node]
     set tnode [jid_to_tag [list $jid $node]]
-    set parent_tag [jid_to_tag [list $jid $node]]
-    if {![info exists browser(sort,$w,$parent_tag)]} {
-	set browser(sort,$w,$parent_tag) sort
+    set data [list item $jid $node]
+    if {![$tw exists $tnode] || [llength [$tw nodes $tnode]] == 0} {
+	set nitems 0
+    } else {
+	set nitems [llength [disco::get_jid_items $jid $node]]
     }
-    set data [list item $jid $node]
-    set desc $jid
+    set desc [item_desc $jid $node $name $nitems]
     set icon ""
 
     add_line $tw $parent_tag $tnode $icon $desc $data -font $font \
@@ -704,19 +721,29 @@
     foreach item $items {
 	set ijid [jlib::wrapper:getattr $item jid]
 	set node [jlib::wrapper:getattr $item node]
+
 	set name [jlib::wrapper:getattr $item name]
 	set tnode [jid_to_tag [list $ijid $node]]
-	lappend itemnodes $tnode
 	set data [list item $ijid $node]
-	set desc [item_desc $ijid $node $name]
+	if {![$tw exists $tnode] || [llength [$tw nodes $tnode]] == 0} {
+	    set nitems 0
+	} else {
+	    set nitems [llength [disco::get_jid_items $ijid $node]]
+	}
+	set desc [item_desc $ijid $node $name $nitems]
 	set icon ""
 
+	lappend itemnodes $tnode
+
 	add_line $tw $parent_tag $tnode $icon $desc $data -font $font \
 	    -fill $config(fill)
     }
     remove_old $tw $parent_tag item $itemnodes
     remove_old $tw $parent_tag error_items {}
-    #reorder_node $tw $parent_tag
+
+    if {![info exists browser(sort,$w,$parent_tag)]} {
+	set browser(sort,$w,$parent_tag) sort
+    }
     browser_action $browser(sort,$w,$parent_tag) $w $parent_tag
 }
 
@@ -824,16 +851,21 @@
     }
 }
 
-proc disco::browser::item_desc {jid node name} {
+proc disco::browser::item_desc {jid node name nitems} {
     if {$node != ""} {
 	set snode " \[$node\]"
     } else {
 	set snode ""
     }
+    if {$nitems > 0} {
+	set sitems " - $nitems"
+    } else {
+	set sitems ""
+    }
     if {![cequal $name ""]} {
-	return "$name$snode ($jid)"
+	return "$name$snode ($jid)$sitems"
     } else {
-	return $jid$snode
+	return "$jid$snode$sitems"
     }
 }
 
@@ -980,18 +1012,21 @@
 
     set tparentnode [$tw parent $tnode]
     
-    set data [$tw itemcget $tnode -data]
-    set data2 [lassign $data type]
+    set type [lindex [$tw itemcget $tnode -data] 0]
 
     if {$tparentnode != "root"} {
-	if {$type == "item"} {
-	    set subnodes [$tw nodes $tnode]
-	} else {
-	    set subnodes [$tw nodes $tparentnode]
+	if {$type != "item"} {
+	    set tnode $tparentnode
 	}
-	foreach sn $subnodes {
+	foreach sn [$tw nodes $tnode] {
 	    $tw delete $sn
 	}
+	lassign [$tw itemcget $tnode -data] type jid node
+	if {$type == "item"} {
+	    set name [disco::get_jid_name $jid $node]
+	    set desc [item_desc $jid $node $name 0]
+	    $tw itemconfigure $tnode -text $desc
+	}
     } else {
 	$tw delete $tnode
     }

Modified: trunk/tkabber/muc.tcl
===================================================================
--- trunk/tkabber/muc.tcl	2006-09-09 12:05:04 UTC (rev 708)
+++ trunk/tkabber/muc.tcl	2006-09-09 20:14:00 UTC (rev 709)
@@ -1234,6 +1234,8 @@
     variable timestamps
     variable muc_password
 
+    set group [tolower_node_and_domain $group]
+
     set chatid [chat::chatid $connid $group]
     set_our_groupchat_nick $chatid $nick
 

Modified: trunk/tkabber/pixmaps/default/icondef.xml
===================================================================
--- trunk/tkabber/pixmaps/default/icondef.xml	2006-09-09 12:05:04 UTC (rev 708)
+++ trunk/tkabber/pixmaps/default/icondef.xml	2006-09-09 20:14:00 UTC (rev 709)
@@ -89,6 +89,10 @@
     <object mime="image/gif">services/jud.gif</object>
   </icon>
   <icon>
+    <image xmlns='tkimage'>browser/sms</image>
+    <object mime="image/gif">services/sms.gif</object>
+  </icon>
+  <icon>
     <image xmlns='tkimage'>browser/aim</image>
     <object mime="image/gif">services/aim_online.gif</object>
   </icon>
@@ -109,7 +113,7 @@
     <object mime="image/gif">services/yahoo_online.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>browser/x-gadugadu</image>
+    <image xmlns='tkimage'>browser/gadu-gadu</image>
     <object mime="image/gif">services/gg_online.gif</object>
   </icon>
   <icon>
@@ -246,27 +250,27 @@
   </icon>
   <!-- Gadu-Gadu -->
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/away</image>
+    <image xmlns='tkimage'>services/gadu-gadu/away</image>
     <object mime="image/gif">services/gg_away.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/chat</image>
+    <image xmlns='tkimage'>services/gadu-gadu/chat</image>
     <object mime="image/gif">services/gg_chat.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/dnd</image>
+    <image xmlns='tkimage'>services/gadu-gadu/dnd</image>
     <object mime="image/gif">services/gg_dnd.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/unavailable</image>
+    <image xmlns='tkimage'>services/gadu-gadu/unavailable</image>
     <object mime="image/gif">services/gg_offline.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/available</image>
+    <image xmlns='tkimage'>services/gadu-gadu/available</image>
     <object mime="image/gif">services/gg_online.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/xa</image>
+    <image xmlns='tkimage'>services/gadu-gadu/xa</image>
     <object mime="image/gif">services/gg_xa.gif</object>
   </icon>
   <!-- ICQ -->

Modified: trunk/tkabber/pixmaps/gabber/icondef.xml
===================================================================
--- trunk/tkabber/pixmaps/gabber/icondef.xml	2006-09-09 12:05:04 UTC (rev 708)
+++ trunk/tkabber/pixmaps/gabber/icondef.xml	2006-09-09 20:14:00 UTC (rev 709)
@@ -53,6 +53,10 @@
     <object mime="image/gif">services/jud.gif</object>
   </icon>
   <icon>
+    <image xmlns='tkimage'>browser/sms</image>
+    <object mime="image/gif">services/sms.gif</object>
+  </icon>
+  <icon>
     <image xmlns='tkimage'>browser/aim</image>
     <object mime="image/gif">services/aim_online.gif</object>
   </icon>

Modified: trunk/tkabber/pixmaps/jajc/icondef.xml
===================================================================
--- trunk/tkabber/pixmaps/jajc/icondef.xml	2006-09-09 12:05:04 UTC (rev 708)
+++ trunk/tkabber/pixmaps/jajc/icondef.xml	2006-09-09 20:14:00 UTC (rev 709)
@@ -49,6 +49,10 @@
     <object mime="image/gif">services/jud.gif</object>
   </icon>
   <icon>
+    <image xmlns='tkimage'>browser/sms</image>
+    <object mime="image/gif">services/sms.gif</object>
+  </icon>
+  <icon>
     <image xmlns='tkimage'>browser/aim</image>
     <object mime="image/gif">services/aim_online.gif</object>
   </icon>

Modified: trunk/tkabber/pixmaps/kroc/icondef.xml
===================================================================
--- trunk/tkabber/pixmaps/kroc/icondef.xml	2006-09-09 12:05:04 UTC (rev 708)
+++ trunk/tkabber/pixmaps/kroc/icondef.xml	2006-09-09 20:14:00 UTC (rev 709)
@@ -82,6 +82,10 @@
     <object mime="image/gif">services/jud.gif</object>
   </icon>
   <icon>
+    <image xmlns='tkimage'>browser/sms</image>
+    <object mime="image/gif">services/sms.gif</object>
+  </icon>
+  <icon>
     <image xmlns='tkimage'>browser/aim</image>
     <object mime="image/gif">services/aim_online.gif</object>
   </icon>
@@ -98,7 +102,7 @@
     <object mime="image/gif">services/yahoo_online.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>browser/x-gadugadu</image>
+    <image xmlns='tkimage'>browser/gadu-gadu</image>
     <object mime="image/gif">services/gg_online.gif</object>
   </icon>
   <icon>
@@ -215,27 +219,27 @@
   </icon>
   <!-- Gadu-Gadu -->
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/away</image>
+    <image xmlns='tkimage'>services/gadu-gadu/away</image>
     <object mime="image/gif">services/gg_away.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/chat</image>
+    <image xmlns='tkimage'>services/gadu-gadu/chat</image>
     <object mime="image/gif">services/gg_chat.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/dnd</image>
+    <image xmlns='tkimage'>services/gadu-gadu/dnd</image>
     <object mime="image/gif">services/gg_dnd.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/unavailable</image>
+    <image xmlns='tkimage'>services/gadu-gadu/unavailable</image>
     <object mime="image/gif">services/gg_offline.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/available</image>
+    <image xmlns='tkimage'>services/gadu-gadu/available</image>
     <object mime="image/gif">services/gg_online.gif</object>
   </icon>
   <icon>
-    <image xmlns='tkimage'>services/x-gadugadu/xa</image>
+    <image xmlns='tkimage'>services/gadu-gadu/xa</image>
     <object mime="image/gif">services/gg_xa.gif</object>
   </icon>
   <!-- ICQ -->

Modified: trunk/tkabber/roster.tcl
===================================================================
--- trunk/tkabber/roster.tcl	2006-09-09 12:05:04 UTC (rev 708)
+++ trunk/tkabber/roster.tcl	2006-09-09 20:14:00 UTC (rev 709)
@@ -338,7 +338,7 @@
 		set subtype $updomain
 	    }
 	    gg {
-		set subtype x-gadugadu
+		set subtype gadu-gadu
 	    }
 	    pogoda -
 	    weather {



More information about the Tkabber-dev mailing list