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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Sep 13 11:13:46 MSD 2009


Author: sergei
Date: 2009-09-13 11:13:45 +0400 (Sun, 13 Sep 2009)
New Revision: 1839

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/general/rawxml.tcl
Log:
	* plugins/general/rawxml.tcl: Always show "Shaow all connections"
	  checkbutton to make seeing all stanzas possible after all connections
	  but one closed (thanks to Jan Zachorowski). Also, increased
	  timestamps resolution to milliseconds for Tcl 8.5 and newer.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-09-13 06:39:52 UTC (rev 1838)
+++ trunk/tkabber/ChangeLog	2009-09-13 07:13:45 UTC (rev 1839)
@@ -1,3 +1,10 @@
+2009-09-13  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/general/rawxml.tcl: Always show "Shaow all connections"
+	  checkbutton to make seeing all stanzas possible after all connections
+	  but one closed (thanks to Jan Zachorowski). Also, increased
+	  timestamps resolution to milliseconds for Tcl 8.5 and newer.
+
 2009-09-02  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/general/rawxml.tcl: Added multiple connections support: allow

Modified: trunk/tkabber/plugins/general/rawxml.tcl
===================================================================
--- trunk/tkabber/plugins/general/rawxml.tcl	2009-09-13 06:39:52 UTC (rev 1838)
+++ trunk/tkabber/plugins/general/rawxml.tcl	2009-09-13 07:13:45 UTC (rev 1839)
@@ -18,8 +18,8 @@
     custom::defgroup RawXML \
 	[::msgcat::mc "Options for Raw XML Input module,\
 		       which allows you to monitor\
-		       incoming/outgoing traffic from connection to server and send\
-		       custom XML stanzas."] \
+		       incoming/outgoing traffic from connection to server\
+		       and send custom XML stanzas."] \
 	-group Plugins -tag "Raw XML Input"
 	 
     custom::defvar options(pretty_print) 1 \
@@ -28,11 +28,14 @@
     custom::defvar options(indent) 2 \
 	[::msgcat::mc "Indentation for pretty-printed XML subtags."] \
 	-group RawXML -type integer
+    custom::defvar options(view_all_xlibs) 1 \
+	[::msgcat::mc "Show stanzas for all (current and past) connections\
+		       in Raw XML window."] \
+	-group RawXML -type boolean
 
     variable tabs
     variable rawxml_xlib_jid
     variable rawxml_xlib
-    variable view_single_xlib
 }
 
 
@@ -60,7 +63,13 @@
 	}
     }
 
-    set prefix "[clock format [clock seconds] -format %T] $prefix"
+    if {![catch {clock milliseconds} ms]} {
+	set seconds [expr {$ms/1000}]
+	set fraction [format %03d [expr {$ms%1000}]]
+	set prefix "[clock format $seconds -format %T].$fraction $prefix"
+    } else {
+	set prefix "[clock format [clock seconds] -format %T] $prefix"
+    }
 
     set dump $w.dump
     $dump configure -state normal
@@ -103,7 +112,13 @@
 	}
     }
 
-    set prefix "[clock format [clock seconds] -format %T] $prefix"
+    if {![catch {clock milliseconds} ms]} {
+	set seconds [expr {$ms/1000}]
+	set fraction [format %03d [expr {$ms%1000}]]
+	set prefix "[clock format $seconds -format %T].$fraction $prefix"
+    } else {
+	set prefix "[clock format [clock seconds] -format %T] $prefix"
+    }
 
     set dump $w.dump
     $dump configure -state normal
@@ -267,17 +282,17 @@
 			       -editable false \
 			       -modifycmd [namespace current]::select_xlib
 
-    checkbutton $tools.singlexlib -variable [namespace current]::view_single_xlib \
-				  -command [namespace current]::select_xlib \
-				  -text "Hide other connections"
+    checkbutton $tools.allxlibs -variable [namespace current]::options(view_all_xlibs) \
+				-command [namespace current]::select_xlib \
+				-text [::msgcat::mc "Show all connections"]
     
     if {[llength $connection_jids] > 1} {
 	pack $tools.lconnection -side left -anchor w
 	pack $tools.connection -side left -anchor w
-
-	pack $tools.singlexlib -side left -anchor w
     }
 
+    pack $tools.allxlibs -side left -anchor w
+
     PanedWin $w.pw -side right -pad 0 -width 4
     pack $w.pw -fill both -expand yes
 
@@ -348,7 +363,7 @@
 proc rawxml::select_xlib {} {
     variable rawxml_xlib_jid
     variable rawxml_xlib
-    variable view_single_xlib
+    variable options
     set w .rawxml.dump
 
     set rawxml_xlib {}
@@ -360,7 +375,7 @@
     }
     
     foreach tag [lsearch -all -glob -inline [.rawxml.dump tag names] xlib*] {
-	set elide [expr {"xlib$rawxml_xlib" != $tag && $view_single_xlib \
+	set elide [expr {"xlib$rawxml_xlib" != $tag && !$options(view_all_xlibs) \
 		   && $rawxml_xlib != ""}]
 	$w tag configure $tag -elide $elide
     }
@@ -369,7 +384,6 @@
 proc rawxml::update_xlib_choice {action xlib} {
     variable rawxml_xlib_jid
     variable rawxml_xlib
-    variable view_single_xlib
     
     set tools .rawxml.tools
     set combobox $tools.connection
@@ -402,11 +416,10 @@
     $combobox configure -values $connection_jids
 
     if {[llength $connection_jids] > 1} {
-        pack $tools.lconnection -side left -anchor w
-        pack $combobox -side left -anchor w
-	pack $tools.singlexlib -side left -anchor w
+        pack $tools.lconnection -side left -anchor w -before $tools.allxlibs
+        pack $combobox -side left -anchor w -before $tools.allxlibs
     } else {
-	pack forget $tools.lconnection $combobox $tools.singlexlib
+	pack forget $tools.lconnection $combobox
     }
 }
 



More information about the Tkabber-dev mailing list