[Tkabber-dev] r1753 - in trunk/tkabber: . plugins/chat

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Mar 27 21:28:28 MSK 2009


Author: sergei
Date: 2009-03-27 21:28:28 +0300 (Fri, 27 Mar 2009)
New Revision: 1753

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/chat/chatstate.tcl
   trunk/tkabber/plugins/chat/events.tcl
Log:
	* plugins/chat/chatstate.tcl, plugins/chat/events.tcl: Removed bindings
	  which used %A substitution from chat input windows. This makes XIM
	  working in chat windows.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-03-27 17:49:39 UTC (rev 1752)
+++ trunk/tkabber/ChangeLog	2009-03-27 18:28:28 UTC (rev 1753)
@@ -21,6 +21,10 @@
 
 	* msgs/de.msg: Updated German translation (thanks to Roger Sondermann).
 
+	* plugins/chat/chatstate.tcl, plugins/chat/events.tcl: Removed bindings
+	  which used %A substitution from chat input windows. This makes XIM
+	  working in chat windows.
+
 2009-03-20  Sergei Golovan  <sgolovan at nes.ru>
 
 	* messages.tcl: Put messages in the message archive only if they have

Modified: trunk/tkabber/plugins/chat/chatstate.tcl
===================================================================
--- trunk/tkabber/plugins/chat/chatstate.tcl	2009-03-27 17:49:39 UTC (rev 1752)
+++ trunk/tkabber/plugins/chat/chatstate.tcl	2009-03-27 18:28:28 UTC (rev 1753)
@@ -131,12 +131,16 @@
     $cw.status.event configure -text ""
 }
 
-proc chatstate::event_composing {chatid sym} {
+proc chatstate::event_composing {iw sym} {
     variable options
     variable chatstate
 
+    if {$sym == ""} return
+
+    set cw [join [lrange [split $iw .] 0 end-1] .]
+    set chatid [chat::winid_to_chatid $cw]
+
     if {![chat::is_chat $chatid]} return
-    if {$sym == ""} return
     if {[info exists chatstate(composing,$chatid)] && \
 	    !$chatstate(composing,$chatid)} return
     if {!$options(enable)} return
@@ -165,12 +169,9 @@
 	label $l
 	pack $l -side left
     }
-
-    set iw [chat::input_win $chatid]
-    bind $iw <Key> +[list [namespace current]::event_composing \
-			 [double% $chatid] %A]
 }
 
+hook::add text_on_keypress_hook [namespace current]::chatstate::event_composing
 hook::add open_chat_post_hook [namespace current]::chatstate::setup_ui
 
 proc chatstate::clear_status_on_send {chatid user body type} {

Modified: trunk/tkabber/plugins/chat/events.tcl
===================================================================
--- trunk/tkabber/plugins/chat/events.tcl	2009-03-27 17:49:39 UTC (rev 1752)
+++ trunk/tkabber/plugins/chat/events.tcl	2009-03-27 18:28:28 UTC (rev 1753)
@@ -187,12 +187,16 @@
 
 hook::add raise_chat_tab_hook [namespace current]::events::send_event_on_raise
 
-proc events::event_composing {chatid sym} {
+proc events::event_composing {iw sym} {
     variable options
     variable events
 
+    if {$sym == ""} return
+
+    set cw [join [lrange [split $iw .] 0 end-1] .]
+    set chatid [chat::winid_to_chatid $cw]
+
     if {![chat::is_chat $chatid]} return
-    if {$sym == ""} return
     if {![info exists events(composing,$chatid)] || \
 	    !$events(composing,$chatid)} return
 
@@ -228,12 +232,9 @@
 	label $l
 	pack $l -side left
     }
-
-    set iw [chat::input_win $chatid]
-    bind $iw <Key> +[list [namespace current]::event_composing \
-			 [double% $chatid] %A]
 }
 
+hook::add text_on_keypress_hook [namespace current]::events::event_composing
 hook::add open_chat_post_hook [namespace current]::events::setup_ui
 
 proc events::clear_status_on_send {chatid user body type} {



More information about the Tkabber-dev mailing list