[Tkabber-dev] r1750 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Mar 27 20:44:29 MSK 2009


Author: sergei
Date: 2009-03-27 20:44:29 +0300 (Fri, 27 Mar 2009)
New Revision: 1750

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/proxy.tcl
Log:
	* proxy.tcl: Fixed proxy management dialog size and added some space
	  between individual proxy frames.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-03-27 17:01:40 UTC (rev 1749)
+++ trunk/tkabber/ChangeLog	2009-03-27 17:44:29 UTC (rev 1750)
@@ -16,6 +16,9 @@
 	* proxy.tcl: Renamed connect proxies to tunnel proxies which is more
 	  clear.
 
+	* proxy.tcl: Fixed proxy management dialog size and added some space
+	  between individual proxy frames.
+
 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 17:01:40 UTC (rev 1749)
+++ trunk/tkabber/proxy.tcl	2009-03-27 17:44:29 UTC (rev 1750)
@@ -146,13 +146,16 @@
 
     set f [$w getframe]
 
+    set hf [frame $w.hf]
+    pack $hf -side bottom
+
     set nb [NoteBook $f.nb]
 
     set tunnels_page [$nb insert end tunnels_page -text [::msgcat::mc "Tunnel proxies"]]
-    customize_frame $tunnels_page tunnels
+    set w1 [customize_frame $tunnels_page tunnels]
 
     set http_page [$nb insert end http_page -text [::msgcat::mc "HTTP proxies"]]
-    customize_frame $http_page http
+    set w2 [customize_frame $http_page http]
 
     $nb compute_size
     $nb raise tunnels_page
@@ -160,6 +163,14 @@
     grid columnconfigure $f 0 -weight 1
     grid rowconfigure $f 0 -weight 1
 
+    if {$w1 > $w2} {
+	$hf configure \
+	    -width [expr {$w1 + [winfo pixels $f 1c]}]
+    } else {
+	$hf configure \
+	    -width [expr {$w2 + [winfo pixels $f 1c]}]
+    }
+
     $w draw
 }
 
@@ -182,7 +193,7 @@
     
     set sw [ScrolledWindow $frame.sw -scrollbar vertical]
     set sf [ScrollableFrame $frame.fields -constrainedwidth yes]
-    pack $sw -side bottom -expand yes -fill both -pady 1m -padx 1m
+    pack $sw -side bottom -expand yes -fill both
     $sw setwidget $sf
     set f [$sf getframe]
 
@@ -195,6 +206,8 @@
 
     set data($type,counter) 0
 
+    add_proxy $f $type remove "" "" "" "" "" ""
+
     if {[info exists Proxy($type)]} {
 	foreach proxy $Proxy($type) {
 	    array unset Args
@@ -214,8 +227,11 @@
     }
 
     update idletasks
-    $tools configure \
-	   -width [expr {[winfo reqwidth $f] + [winfo pixels $f 1c]}]
+    set w [winfo reqwidth $f]
+
+    remove_proxy $f $type 1
+
+    return $w
 }
 
 proc proxy::cleanup {f type} {
@@ -268,7 +284,7 @@
     set erow [lindex [grid size $f] 1]
 
     set ff [frame $f.p$i -borderwidth 2 -relief groove -padx 2m -pady 2m]
-    grid $ff -row $erow -column 0 -rowspan 3 -sticky nwes
+    grid $ff -row $erow -column 0 -rowspan 3 -sticky nwes -padx 1m -pady 1m
 
     set row 0
 
@@ -285,7 +301,7 @@
     grid $ff.proxy$i.none -row 0 -column [incr col] -sticky w
 
     if {$type == "tunnels"} {
-	radiobutton $ff.proxy$i.https -text [::msgcat::mc "HTTPS (CONNECT)"] \
+	radiobutton $ff.proxy$i.https -text [::msgcat::mc "HTTPS"] \
 		    -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
@@ -359,12 +375,13 @@
     button $f.remov$i -text [::msgcat::mc "Remove"] \
 	   -command [namespace code [list remove_proxy $f $type $i]]
 
-    grid $f.moveup$i -row $erow -column 1 -sticky ews
-    grid $f.movedown$i -row [expr {$erow+1}] -column 1 -sticky ewns
-    grid $f.remov$i -row [expr {$erow+2}] -column 1 -sticky ewn
+    grid $f.moveup$i -row $erow -column 1 -sticky ews -padx 1m
+    grid $f.movedown$i -row [expr {$erow+1}] -column 1 -sticky ewns -padx 1m
+    grid $f.remov$i -row [expr {$erow+2}] -column 1 -sticky ewn -padx 1m
 
     grid rowconfigure $f $erow -weight 1
     grid rowconfigure $f [expr {$erow+2}] -weight 1
+    grid columnconfigure $f 0 -weight 1
 }
 
 proc proxy::update_proxy {f type i} {



More information about the Tkabber-dev mailing list