[Tkabber-dev] r1749 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Mar 27 20:01:41 MSK 2009


Author: sergei
Date: 2009-03-27 20:01:40 +0300 (Fri, 27 Mar 2009)
New Revision: 1749

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/proxy.tcl
Log:
	* proxy.tcl: Renamed connect proxies to tunnel proxies which is more
	  clear.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-03-27 16:11:00 UTC (rev 1748)
+++ trunk/tkabber/ChangeLog	2009-03-27 17:01:40 UTC (rev 1749)
@@ -13,6 +13,9 @@
 	  login and loginconf array. Made choosing proxy depending from a
 	  hostname to connect to. Use proxy if necessary in file transfers.
 
+	* proxy.tcl: Renamed connect proxies to tunnel proxies which is more
+	  clear.
+
 2009-03-20  Sergei Golovan  <sgolovan at nes.ru>
 
 	* messages.tcl: Put messages in the message archive only if they have

Modified: trunk/tkabber/proxy.tcl
===================================================================
--- trunk/tkabber/proxy.tcl	2009-03-27 16:11:00 UTC (rev 1748)
+++ trunk/tkabber/proxy.tcl	2009-03-27 17:01:40 UTC (rev 1749)
@@ -6,7 +6,7 @@
 package require http
 
 namespace eval proxy {
-    set cproxies {}
+    set tproxies {}
     set hproxies {}
     foreach varname [lsort -dictionary [info vars ::proxy*]] {
 	upvar #0 $varname p
@@ -39,26 +39,26 @@
 	}
 	switch -- $p(type) {
 	    none {
-		lappend cproxies $proxy
+		lappend tproxies $proxy
 		lappend hproxies $proxy
 	    }
 	    http {
 		lappend hproxies $proxy
 	    }
 	    default {
-		lappend cproxies $proxy
+		lappend tproxies $proxy
 	    }
 	}
     }
 
-    if {[llength $cproxies] > 0 || [llength $hproxies] > 0} {
+    if {[llength $tproxies] > 0 || [llength $hproxies] > 0} {
 	# There are proxies defined in the config file
 
-	variable proxylist [list connect $cproxies http $hproxies]
+	variable proxylist [list tunnels $tproxies http $hproxies]
     }
 
     custom::defvar proxylist \
-	{connect {{type none match "localhost* 127.0.0.* 192.168.* 10.*"}}\
+	{tunnels {{type none match "localhost* 127.0.0.* 192.168.* 10.*"}}\
 	 http {{type none match "localhost* 127.0.0.* 192.168.* 10.*"}}} \
 	[::msgcat::mc "Serialized array of proxy servers to connect via."] \
 	-type string -group Hidden
@@ -148,14 +148,14 @@
 
     set nb [NoteBook $f.nb]
 
-    set connect_page [$nb insert end connect_page -text [::msgcat::mc "Connect proxies"]]
-    customize_frame $connect_page connect
+    set tunnels_page [$nb insert end tunnels_page -text [::msgcat::mc "Tunnel proxies"]]
+    customize_frame $tunnels_page tunnels
 
     set http_page [$nb insert end http_page -text [::msgcat::mc "HTTP proxies"]]
     customize_frame $http_page http
 
     $nb compute_size
-    $nb raise connect_page
+    $nb raise tunnels_page
     grid $nb -row 0 -column 0 -sticky nswe
     grid columnconfigure $f 0 -weight 1
     grid rowconfigure $f 0 -weight 1
@@ -168,7 +168,7 @@
     variable proxylist
 
     switch -- $type {
-	connect -
+	tunnels -
 	http {}
 	default {
 	    return -code error
@@ -195,20 +195,22 @@
 
     set data($type,counter) 0
 
-    foreach proxy $Proxy($type) {
-	array unset Args
-	array set Args $proxy
+    if {[info exists Proxy($type)]} {
+	foreach proxy $Proxy($type) {
+	    array unset Args
+	    array set Args $proxy
 
-	set add_args {}
-	foreach idx {type host port username password match exclude} {
-	    if {[info exists Args($idx)]} {
-		lappend add_args $Args($idx)
-	    } else {
-		lappend add_args ""
+	    set add_args {}
+	    foreach idx {type host port username password match exclude} {
+		if {[info exists Args($idx)]} {
+		    lappend add_args $Args($idx)
+		} else {
+		    lappend add_args ""
+		}
 	    }
+
+	    eval [list add_proxy $f $type] $add_args
 	}
-
-	eval [list add_proxy $f $type] $add_args
     }
 
     update idletasks
@@ -226,7 +228,7 @@
     variable data
     variable proxylist
 
-    foreach type {connect http} {
+    foreach type {tunnels http} {
 	set proxies($type) {}
 	for {set i 1} {$i <= $data($type,counter)} {incr i} {
 	    if {$data($type,type,$i) == "remove"} continue
@@ -247,7 +249,7 @@
 
     destroy $w
 
-    set proxylist [list connect $proxies(connect) http $proxies(http)]
+    set proxylist [list tunnels $proxies(tunnels) http $proxies(http)]
 }
 
 proc proxy::add_proxy {f type ptype host port username password match exclude} {
@@ -282,8 +284,8 @@
 		-command [list [namespace current]::update_proxy $f $type $i]
     grid $ff.proxy$i.none -row 0 -column [incr col] -sticky w
 
-    if {$type == "connect"} {
-	radiobutton $ff.proxy$i.https -text [::msgcat::mc "HTTPS"] \
+    if {$type == "tunnels"} {
+	radiobutton $ff.proxy$i.https -text [::msgcat::mc "HTTPS (CONNECT)"] \
 		    -variable [namespace current]::data($type,type,$i) -value https \
 		    -command [list [namespace current]::update_proxy $f $type $i]
 	grid $ff.proxy$i.https -row 0 -column [incr col] -sticky w
@@ -448,9 +450,9 @@
 
 	set plist $Proxy(http)
     } else {
-	# Connect proxy
+	# Tunnel proxy
 
-	set plist $Proxy(connect)
+	set plist $Proxy(tunnels)
     }
 
     foreach proxy $plist {



More information about the Tkabber-dev mailing list