[Tkabber-dev] r1707 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Mar 9 22:21:32 MSK 2009


Author: sergei
Date: 2009-03-09 22:21:32 +0300 (Mon, 09 Mar 2009)
New Revision: 1707

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/disco.tcl
Log:
	* disco.tcl: Fixed keyboard bindings (thanks to Konstantin Khomoutov).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-03-09 17:22:46 UTC (rev 1706)
+++ trunk/tkabber/ChangeLog	2009-03-09 19:21:32 UTC (rev 1707)
@@ -7,6 +7,8 @@
 	  failed MUC actions (kick, ban, etc.). It helps to detect extra or
 	  missing spaces (thanks to Serge Yudin).
 
+	* disco.tcl: Fixed keyboard bindings (thanks to Konstantin Khomoutov).
+
 2009-03-05  Sergei Golovan  <sgolovan at nes.ru>
 
 	* hooks.tcl: Added a procedure which checks if a hook is empty.

Modified: trunk/tkabber/disco.tcl
===================================================================
--- trunk/tkabber/disco.tcl	2009-03-09 17:22:46 UTC (rev 1706)
+++ trunk/tkabber/disco.tcl	2009-03-09 19:21:32 UTC (rev 1707)
@@ -373,12 +373,9 @@
     bindscroll $tw.c
 
     # HACK
-    bind $tw.c <Return> \
-	"[namespace current]::textaction $w \[$tw selection get\]"
+    bind $tw.c <Return> [list [namespace current]::activate_node $w $tw]
+    bind $tw.c <Delete> [list [namespace current]::delete_node $w $tw]
 
-    bind $tw.c <Delete> \
-	"[namespace current]::clear $w \[$tw selection get\]"
-
     lappend browser(opened) $w
     set browser(opened) [lrmdups $browser(opened)]
     set browser(required,$w) {}
@@ -905,6 +902,20 @@
     }
 }
 
+proc disco::browser::activate_node {bw tw} {
+    set tnode [$tw selection get]
+    if {$tnode != ""} {
+	textaction $bw $tnode
+    }
+}
+
+proc disco::browser::delete_node {bw tw} {
+    set tnode [$tw selection get]
+    if {$tnode != ""} {
+	clear $bw $tnode
+    }
+}
+
 proc disco::browser::browser_action {action bw tnode} {
     variable browser
 
@@ -1173,3 +1184,4 @@
     }
 }
 
+# vim:ts=8:sw=4:sts=4:noet



More information about the Tkabber-dev mailing list