[Tkabber-dev] r698 - in trunk/tkabber: . jabberlib-tclxml

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Aug 16 00:54:20 MSD 2006


Author: sergei
Date: 2006-08-16 00:54:14 +0400 (Wed, 16 Aug 2006)
New Revision: 698

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/browser.tcl
   trunk/tkabber/datagathering.tcl
   trunk/tkabber/disco.tcl
   trunk/tkabber/jabberlib-tclxml/jlibcompress.tcl
   trunk/tkabber/jabberlib-tclxml/jlibsasl.tcl
   trunk/tkabber/jabberlib-tclxml/jlibtls.tcl
   trunk/tkabber/login.tcl
Log:
	* datagathering.tcl: Fixed empty form processing

	* jabberlib-tclxml/jlibtls.tcl, jabberlib-tclxml/jlibsasl.tcl,
	  jabberlib-tclxml/jlibcompress.tcl: Fixed behavior when no
	  callback is set

	* browser.tcl, disco.tcl: Unset all browser/disco window state
	  variables on window destroy (thanks to Konstantin Khomoutov)

	* login.tcl: Replace .connect_err window if it exists instead of
	  warning


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-08-14 20:11:46 UTC (rev 697)
+++ trunk/tkabber/ChangeLog	2006-08-15 20:54:14 UTC (rev 698)
@@ -1,3 +1,17 @@
+2006-08-16  Sergei Golovan  <sgolovan at nes.ru>
+
+	* datagathering.tcl: Fixed empty form processing
+
+	* jabberlib-tclxml/jlibtls.tcl, jabberlib-tclxml/jlibsasl.tcl,
+	  jabberlib-tclxml/jlibcompress.tcl: Fixed behavior when no
+	  callback is set
+
+	* browser.tcl, disco.tcl: Unset all browser/disco window state
+	  variables on window destroy (thanks to Konstantin Khomoutov)
+
+	* login.tcl: Replace .connect_err window if it exists instead of
+	  warning
+
 2006-07-08  Alexey Shchepin  <alexey at sevcom.net>
 
 	* jabberlib-tclxml/jlibdns.tcl: Fixed DNS reply processing (thanks

Modified: trunk/tkabber/browser.tcl
===================================================================
--- trunk/tkabber/browser.tcl	2006-08-14 20:11:46 UTC (rev 697)
+++ trunk/tkabber/browser.tcl	2006-08-15 20:54:14 UTC (rev 698)
@@ -41,6 +41,8 @@
     set config(fill) 	      [option get $bw fill          JBrowser]
     set config(nscolor)       [option get $bw nscolor       JBrowser]
 
+    bind $bw <Destroy> [list [namespace current]::destroy_state $bw]
+
     frame $bw.navigate
     button $bw.navigate.back -text <- \
 	-command [list browser::history_move $bw 1]
@@ -693,3 +695,12 @@
     }
 }
 
+# Destroy all (global) state assotiated with the given browser window.
+# Intended to be bound to a <Destroy> event handler for browser windows.
+proc browser::destroy_state {bw} {
+    variable browser
+
+    array unset browser(*,$bw)
+    array unset browser(*,$bw,*)
+}
+

Modified: trunk/tkabber/datagathering.tcl
===================================================================
--- trunk/tkabber/datagathering.tcl	2006-08-14 20:11:46 UTC (rev 697)
+++ trunk/tkabber/datagathering.tcl	2006-08-15 20:54:14 UTC (rev 698)
@@ -121,9 +121,11 @@
 
     set restags {}
 
-    foreach var $data(varlist,$g) {
-	lappend restags [jlib::wrapper:createtag $var \
-			     -chdata $data(var,$var,$g)]
+    if {[info exists data(varlist,$g)]} {
+	foreach var $data(varlist,$g) {
+	    lappend restags [jlib::wrapper:createtag $var \
+				 -chdata $data(var,$var,$g)]
+	}
     }
 
     return $restags

Modified: trunk/tkabber/disco.tcl
===================================================================
--- trunk/tkabber/disco.tcl	2006-08-14 20:11:46 UTC (rev 697)
+++ trunk/tkabber/disco.tcl	2006-08-15 20:54:14 UTC (rev 698)
@@ -440,6 +440,8 @@
     set config(identitycolor) [option get $w identitycolor JDisco]
     set config(optioncolor)   [option get $w optioncolor   JDisco]
 
+    bind $w <Destroy> [list [namespace current]::destroy_state $w]
+
     frame $w.navigate
     button $w.navigate.back -text <- \
 	-command [list [namespace current]::history_move $w 1]
@@ -1245,6 +1247,20 @@
     }
 }
 
+# Destroy all (global) state assotiated with the given browser window.
+# Intended to be bound to a <Destroy> event handler for browser windows.
+proc disco::browser::destroy_state {bw} {
+    variable browser
+
+    array unset browser(*,$bw)
+    array unset browser(*,$bw,*)
+
+    set idx [lsearch -exact $browser(opened) $bw]
+    if {$idx >= 0} {
+	set browser(opened) [lreplace $browser(opened) $idx $idx]
+    }
+}
+
 hook::add postload_hook \
     [list browser::register_ns_handler $::NS(disco_info) disco::browser::open_win \
 	 -desc [list * [::msgcat::mc "Discover service"]]]

Modified: trunk/tkabber/jabberlib-tclxml/jlibcompress.tcl
===================================================================
--- trunk/tkabber/jabberlib-tclxml/jlibcompress.tcl	2006-08-14 20:11:46 UTC (rev 697)
+++ trunk/tkabber/jabberlib-tclxml/jlibcompress.tcl	2006-08-15 20:54:14 UTC (rev 698)
@@ -241,7 +241,9 @@
     } else {
 	jlib::client status [::msgcat::mc "Compression negotiation successful"]
     }
-    uplevel #0 $state(-command) [list $res $xmldata]
+    if {[info exists state(-command)]} {
+	uplevel #0 $state(-command) [list $res $xmldata]
+    }
 }
 
 ##########################################################################

Modified: trunk/tkabber/jabberlib-tclxml/jlibsasl.tcl
===================================================================
--- trunk/tkabber/jabberlib-tclxml/jlibsasl.tcl	2006-08-14 20:11:46 UTC (rev 697)
+++ trunk/tkabber/jabberlib-tclxml/jlibsasl.tcl	2006-08-15 20:54:14 UTC (rev 698)
@@ -604,7 +604,9 @@
     } else {
 	jlib::client status [::msgcat::mc "Authentication successful"]
     }
-    uplevel #0 $state(-command) [list $res $child]
+    if {[info exists state(-command)]} {
+	uplevel #0 $state(-command) [list $res $child]
+    }
 }
 
 ##########################################################################

Modified: trunk/tkabber/jabberlib-tclxml/jlibtls.tcl
===================================================================
--- trunk/tkabber/jabberlib-tclxml/jlibtls.tcl	2006-08-14 20:11:46 UTC (rev 697)
+++ trunk/tkabber/jabberlib-tclxml/jlibtls.tcl	2006-08-15 20:54:14 UTC (rev 698)
@@ -237,7 +237,9 @@
     } else {
 	jlib::client status [::msgcat::mc "STARTTLS successful"]
     }
-    uplevel #0 $state(-command) [list $res $xmldata]
+    if {[info exists state(-command)]} {
+	uplevel #0 $state(-command) [list $res $xmldata]
+    }
 }
 
 ##########################################################################

Modified: trunk/tkabber/login.tcl
===================================================================
--- trunk/tkabber/login.tcl	2006-08-14 20:11:46 UTC (rev 697)
+++ trunk/tkabber/login.tcl	2006-08-15 20:54:14 UTC (rev 698)
@@ -185,6 +185,9 @@
 	if {$lc(connect_forever)} {
 	    login_retry $logindata
 	} else {
+	    if {[winfo exists .connect_err]} {
+		destroy .connect_err
+	    }
 	    set res [MessageDlg .connect_err -width 600 -icon error \
 		-message [format [::msgcat::mc "Failed to connect: %s"] $connid] \
 		-type user -buttons [list abort [::msgcat::mc "Keep trying"]] \



More information about the Tkabber-dev mailing list