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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Jan 28 20:57:34 MSK 2014


Author: sergei
Date: 2014-01-28 20:57:34 +0400 (Tue, 28 Jan 2014)
New Revision: 2116

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/auth.tcl
   trunk/tkabber-plugins/otr/otr.tcl
Log:
	* otr/auth.tcl: Fixed changing icons, renamed cancel button to close
	  for the case when there's nothing to cancel.

	* otr/otr.tcl: Unset a few global variables when they aren't in use.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-01-28 14:23:52 UTC (rev 2115)
+++ trunk/tkabber-plugins/ChangeLog	2014-01-28 16:57:34 UTC (rev 2116)
@@ -10,6 +10,11 @@
 	* otr/otr.tcl: Added fingerprint and SSID to the roster and OTR button
 	  help text. Do cleanup after the authentication dialog is closed.
 
+	* otr/auth.tcl: Fixed changing icons, renamed cancel button to close
+	  for the case when there's nothing to cancel.
+
+	* otr/otr.tcl: Unset a few global variables when they aren't in use.
+
 2014-01-27  Sergei Golovan <sgolovan at nes.ru>
 
 	* otr/otr.tcl: Fail to load OTR plugin if Tkabber doesn't support the

Modified: trunk/tkabber-plugins/otr/auth.tcl
===================================================================
--- trunk/tkabber-plugins/otr/auth.tcl	2014-01-28 14:23:52 UTC (rev 2115)
+++ trunk/tkabber-plugins/otr/auth.tcl	2014-01-28 16:57:34 UTC (rev 2116)
@@ -168,7 +168,7 @@
     $w add -text [::msgcat::mc "Apply"] \
 	   -state disabled \
 	   -command [namespace code [list apply_edit_auth_changes $w $f.items.listbox]]
-    $w add -text [::msgcat::mc "Cancel"] \
+    $w add -text [::msgcat::mc "Close"] \
 	   -command [list destroy $w]
 
     set myjids [lsort [dict keys $Auth]]
@@ -208,7 +208,7 @@
 
     set lastsort ""
 
-    bind $sw.listbox <3> \
+    bind $sw.listbox <<ContextMenu>> \
 	"[namespace current]::select_and_popup_menu [list [double% $w] [double% $sw.listbox]] \
 	     \[[double% $sw.listbox] nearest \[::mclistbox::convert %W -y %y\]\]"
 
@@ -334,6 +334,7 @@
     $l insert $index $data
     $l selection set $index
     $w itemconfigure 0 -state normal
+    $w itemconfigure 1 -text [::msgcat::mc "Cancel"]
 }
 
 proc auth::set_delete {w l index val} {
@@ -347,6 +348,7 @@
     $l insert $index $data
     $l selection set $index
     $w itemconfigure 0 -state normal
+    $w itemconfigure 1 -text [::msgcat::mc "Cancel"]
 }
 
 proc auth::apply_edit_auth_changes {w l} {
@@ -354,6 +356,7 @@
     variable authjid
 
     $w itemconfigure 0 -state disabled
+    $w itemconfigure 1 -text [::msgcat::mc "Close"]
 
     set data [$l get 0 end]
 
@@ -377,9 +380,10 @@
 	if {![::xmpp::jid::equal \
 		    [::xmpp::jid::removeResource \
 			    [connection_jid $xlib]] $authjid]} continue
-	foreach idx [array names ::otr::ctx msgstate,$xlib,*] {
+	foreach idx [array names [namespace parent]::ctx msgstate,$xlib,*] {
 	    regexp {msgstate,[^,]*,(.*)} $idx -> fjid
-	    on_msgstate_change $xlib $fjid $::otr::ctx($idx)
+	    [namespace parent]::on_msgstate_change $xlib $fjid \
+				    [set [namespace parent]::ctx($idx)]
 	}
     }
     fill_mclistbox $w $l

Modified: trunk/tkabber-plugins/otr/otr.tcl
===================================================================
--- trunk/tkabber-plugins/otr/otr.tcl	2014-01-28 14:23:52 UTC (rev 2115)
+++ trunk/tkabber-plugins/otr/otr.tcl	2014-01-28 16:57:34 UTC (rev 2116)
@@ -203,7 +203,7 @@
     }
 
     set ctx(msgstate,$xlib,$jid) MSGSTATE_PLAINTEXT
-    msgstate:trace {} $xlib $jid
+    msgstate:trace {error error} $xlib $jid
 
     set ctx($xlib,$jid) \
 	[::otr::new $privkey \
@@ -225,8 +225,9 @@
     if {[info exists ctx($xlib,$jid)]} {
 	finish_session $xlib $jid ""
 	::otr::free $ctx($xlib,$jid)
-	set jpattern [regsub -all {(.)} $jid {\\\1} ]
-	array unset ctx *,$xlib,$jpattern
+	unset ctx(authstate,$xlib,$jid)
+	unset ctx(msgstate,$xlib,$jid)
+	unset ctx(smpstate,$xlib,$jid)
 	unset ctx($xlib,$jid)
 
 	set chatid [chat::chatid $xlib $jid]
@@ -516,6 +517,9 @@
 
     bind $w <Destroy> [list unset -nocomplain [namespace current]::ctx(status,$xlib,$jid)]
     bind $w <Destroy> +[list unset -nocomplain [namespace current]::ctx(progress,$xlib,$jid)]
+    bind $w <Destroy> +[list unset -nocomplain [namespace current]::ctx(authmethod,$xlib,$jid)]
+    bind $w <Destroy> +[list unset -nocomplain [namespace current]::ctx(ihave,$xlib,$jid)]
+    bind $w <Destroy> +[list unset -nocomplain [namespace current]::ctx(smpdialog,$xlib,$jid)]
 
     set f [$w getframe]
 
@@ -731,6 +735,7 @@
 
     bind $w <Destroy> [list unset -nocomplain [namespace current]::ctx(status,$xlib,$jid)]
     bind $w <Destroy> +[list unset -nocomplain [namespace current]::ctx(progress,$xlib,$jid)]
+    bind $w <Destroy> +[list unset -nocomplain [namespace current]::ctx(smpdialog,$xlib,$jid)]
 
     set f [$w getframe]
 
@@ -787,6 +792,7 @@
 
     bind $w <Destroy> [list unset -nocomplain [namespace current]::ctx(status,$xlib,$jid)]
     bind $w <Destroy> +[list unset -nocomplain [namespace current]::ctx(progress,$xlib,$jid)]
+    bind $w <Destroy> +[list unset -nocomplain [namespace current]::ctx(smpdialog,$xlib,$jid)]
 
     set f [$w getframe]
 



More information about the Tkabber-dev mailing list