[Tkabber-dev] r744 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Oct 2 23:44:10 MSD 2006


Author: sergei
Date: 2006-10-02 23:44:05 +0400 (Mon, 02 Oct 2006)
New Revision: 744

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/balloon.tcl
   trunk/tkabber/chats.tcl
   trunk/tkabber/muc.tcl
   trunk/tkabber/plugins/general/headlines.tcl
Log:
	* plugins/general/headlines.tcl: Added option, which allows not
	  to show balloons over hedlines tree.

	* chats.tcl, muc.tcl: Update chat window last message timestamp
	  only in connected state. It fixes the situation when not
	  all room history is requested when one client replaces another
	  one with the same resource.

	* balloon.tcl: Added check for negative pointer coordinates when
	  platform is Windows.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-10-02 08:23:46 UTC (rev 743)
+++ trunk/tkabber/ChangeLog	2006-10-02 19:44:05 UTC (rev 744)
@@ -1,8 +1,18 @@
+2006-10-02  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/general/headlines.tcl: Added option, which allows not
+	  to show balloons over hedlines tree.
+
+	* chats.tcl, muc.tcl: Update chat window last message timestamp
+	  only in connected state. It fixes the situation when not
+	  all room history is requested when one client replaces another
+	  one with the same resource.
+
 2006-10-01  Sergei Golovan  <sgolovan at nes.ru>
 
-	* balloon.tcl: Wokarounded a bug when balloon shows up in wrong
-	  screen if multiple monitor configuration is used in Windows
-	  (thanks to Pat Thoyts).
+	* balloon.tcl: Made workaround for a bug when balloon shows up
+	  in wrong screen if multiple monitor configuration is used in
+	  Windows (thanks to Pat Thoyts).
 
 	* pubsub.tcl: Made pubsub implementation closer to JEP-0060
 	  v. 1.9. (It is still untested and unusable though.)

Modified: trunk/tkabber/balloon.tcl
===================================================================
--- trunk/tkabber/balloon.tcl	2006-10-02 08:23:46 UTC (rev 743)
+++ trunk/tkabber/balloon.tcl	2006-10-02 19:44:05 UTC (rev 744)
@@ -73,7 +73,8 @@
     set b_h [winfo reqheight .balloon]
 
     if {$::tcl_platform(platform) == "windows" && \
-	    ($mx >= [winfo screenwidth .] || $my >= [winfo screenheight .])} {
+	    ($mx >= [winfo screenwidth .] || $my >= [winfo screenheight .] ||
+	     $mx < 0 || $my < 0)} {
 	set b_x [expr {$mx + 1}]
 	set b_y [expr {$my + 1}]
     } else {

Modified: trunk/tkabber/chats.tcl
===================================================================
--- trunk/tkabber/chats.tcl	2006-10-02 08:23:46 UTC (rev 743)
+++ trunk/tkabber/chats.tcl	2006-10-02 19:44:05 UTC (rev 744)
@@ -738,6 +738,18 @@
     }
 }
 
+proc chat::is_disconnected {chatid} {
+    variable chats
+
+    if {![info exists chats(status,$chatid)] || \
+	    $chats(status,$chatid) == "disconnected"} {
+	return 1
+    } else {
+	return 0
+    }
+
+}
+
 proc chat::create_user_menu {m chatid} {
     menu $m -tearoff 0
 

Modified: trunk/tkabber/muc.tcl
===================================================================
--- trunk/tkabber/muc.tcl	2006-10-02 08:23:46 UTC (rev 743)
+++ trunk/tkabber/muc.tcl	2006-10-02 19:44:05 UTC (rev 744)
@@ -1211,8 +1211,10 @@
 
 proc muc::set_message_timestamp {chatid from type body x} {
     variable timestamps
-    
-    set timestamps($chatid) [clock seconds]
+
+    if {![chat::is_disconnected $chatid]} {
+	set timestamps($chatid) [clock seconds]
+    }
 }
 
 hook::add draw_message_hook muc::set_message_timestamp 15

Modified: trunk/tkabber/plugins/general/headlines.tcl
===================================================================
--- trunk/tkabber/plugins/general/headlines.tcl	2006-10-02 08:23:46 UTC (rev 743)
+++ trunk/tkabber/plugins/general/headlines.tcl	2006-10-02 19:44:05 UTC (rev 744)
@@ -32,6 +32,10 @@
 	[::msgcat::mc "Format of timestamp in headline tree view. Set to\
 		       empty string if you don't want to see timestamps."] \
 	-group Messages -type string
+
+    custom::defvar options(show_balloons) 0 \
+	[::msgcat::mc "Show balloons with headline messages over tree nodes."] \
+	-group Messages -type boolean
 }
 
 package require md5
@@ -565,6 +569,12 @@
 }
 
 proc headlines::balloon {hw node} {
+    variable options
+
+    if {!$options(show_balloons)} {
+	return [list $hw:$node ""]
+    }
+
     if {[catch {array set props [$hw.tree itemcget $node -data]}]} {
         return [list $hw:$node ""]
     }



More information about the Tkabber-dev mailing list