[Tkabber-dev] r2158 - in trunk/tkabber-plugins: . otr

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Jul 16 10:05:42 MSK 2014


Author: sergei
Date: 2014-07-16 10:05:42 +0400 (Wed, 16 Jul 2014)
New Revision: 2158

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/otr.tcl
Log:
	* otr/otr.tcl: Added scrollbar for the OTR userinfo page. It helps
	  when there are many user's resources using OTR.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-05-08 09:49:13 UTC (rev 2157)
+++ trunk/tkabber-plugins/ChangeLog	2014-07-16 06:05:42 UTC (rev 2158)
@@ -1,3 +1,8 @@
+2014-07-16  Sergei Golovan <sgolovan at nes.ru>
+
+	* otr/otr.tcl: Added scrollbar for the OTR userinfo page. It helps
+	  when there are many user's resources using OTR.
+
 2014-05-06  Sergei Golovan <sgolovan at nes.ru>
 
 	* otr/tclotr/auth.tcl: Fixed recreating the reveal signature message.

Modified: trunk/tkabber-plugins/otr/otr.tcl
===================================================================
--- trunk/tkabber-plugins/otr/otr.tcl	2014-05-08 09:49:13 UTC (rev 2157)
+++ trunk/tkabber-plugins/otr/otr.tcl	2014-07-16 06:05:42 UTC (rev 2158)
@@ -1362,20 +1362,27 @@
     if {[llength $jids] > 0} {
 	set otrinfo [$tab insert end otrinfo \
 			      -text [::msgcat::mc "OTR"]]
+
+	set sw [ScrolledWindow $otrinfo.sw -scrollbar vertical]
+	pack $sw -fill both -expand yes
+	set sf [ScrollableFrame $otrinfo.sf -constrainedwidth 1]
+	$sw setwidget $sf
+
 	set i 0
 	foreach j $jids {
 	    regexp {authstate,[^,]*,(.*)} $j -> fjid
-	    set x [userinfo::pack_frame $otrinfo.otr_$i $fjid]
+	    set x [userinfo::pack_frame [$sf getframe].otr_$i $fjid]
 
 	    userinfo::pack_entry $jid $x 1 otr_state_$i [::msgcat::mc "State:"]
 	    set userinfo::userinfo(otr_state_$i,$jid) [msgstate:state $xlib $fjid]
 
-	    userinfo::pack_entry $jid $x 3 otr_fingerprint_$i [::msgcat::mc "Fingerprint:"]
+	    userinfo::pack_entry $jid $x 2 otr_fingerprint_$i [::msgcat::mc "Fingerprint:"]
 	    set userinfo::userinfo(otr_fingerprint_$i,$jid) [::otr::fingerprint $ctx($xlib,$fjid)]
 
-	    userinfo::pack_entry $jid $x 4 otr_ssid_$i [::msgcat::mc "SSID:"]
+	    userinfo::pack_entry $jid $x 3 otr_ssid_$i [::msgcat::mc "SSID:"]
 	    set userinfo::userinfo(otr_ssid_$i,$jid) [::otr::ssid $ctx($xlib,$fjid)]
 
+	    bindscrolldeep $sf $sf
 	    incr i
 	}
     }
@@ -1383,6 +1390,13 @@
 
 hook::add userinfo_hook [namespace current]::otr::userinfo 90
 
+proc otr::bindscrolldeep {w f} {
+    bindscroll $w $f
+    foreach sw [winfo children $w] {
+	bindscrolldeep $sw $f
+    }
+}
+
 ###############################################################################
 
 proc otr::main_menu {} {



More information about the Tkabber-dev mailing list