[Tkabber-dev] r1036 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Mar 9 20:33:23 MSK 2007


Author: sergei
Date: 2007-03-09 20:33:22 +0300 (Fri, 09 Mar 2007)
New Revision: 1036

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/userinfo.tcl
Log:
	* userinfo.tcl: Rearranged controls on photo page because otherwise it
	  isn't possible to replace large photos.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-03-09 13:23:03 UTC (rev 1035)
+++ trunk/tkabber/ChangeLog	2007-03-09 17:33:22 UTC (rev 1036)
@@ -7,6 +7,9 @@
 	* userinfo.tcl: Fixed typo (destroying userinfo window didn't delete
 	  correspondent variabla trace).
 
+	* userinfo.tcl: Rearranged controls on photo page because otherwise it
+	  isn't possible to replace large photos.
+
 2007-03-08  Sergei Golovan  <sgolovan at nes.ru>
 
 	* presence.tcl, ifacetk/iroster.tcl: Show presence priority in roster

Modified: trunk/tkabber/userinfo.tcl
===================================================================
--- trunk/tkabber/userinfo.tcl	2007-03-09 13:23:03 UTC (rev 1035)
+++ trunk/tkabber/userinfo.tcl	2007-03-09 17:33:22 UTC (rev 1036)
@@ -371,6 +371,7 @@
 	if {![info exists userinfo(photo_use,$jid)]} {
 	    set userinfo(photo_use,$jid) none
 	}
+
 	radiobutton $p.use_url -text [::msgcat::mc "URL"] \
 	    -value url -variable userinfo::userinfo(photo_use,$jid) \
 	    -command [list [namespace current]::enable_active_photo $p $jid]
@@ -383,21 +384,27 @@
 	entry $p.photo_url -textvariable userinfo::userinfo(photo_extval,$jid)
 	label $p.photo -image $photo_img
 
-	grid $p.use_url -row 0 -column 0 -sticky w
-	grid $p.photo_url  -row 0 -column 1 -sticky we -columnspan 2
-	grid $p.use_image -row 1 -column 0 -sticky w
-	grid $p.photo  -row 1 -column 1 -sticky we
-	grid $p.use_none -row 2 -column 0 -sticky w
+	grid $p.use_url -row 1 -column 0 -sticky w
+	grid $p.photo_url  -row 1 -column 1 -sticky we
+	grid $p.use_image -row 2 -column 0 -sticky w
+	grid $p.photo  -row 3 -column 1 -sticky we
+	grid $p.use_none -row 0 -column 0 -sticky w
 
 	button $p.loadimage -text [::msgcat::mc "Load Image"] \
 	    -command [list userinfo::load_photo $jid $p.photo]
-	grid $p.loadimage -row 1 -column 2 -sticky e
+	grid $p.loadimage -row 2 -column 1 -sticky w
 	grid columnconfig $p 1 -weight 1 -minsize 0
 	#grid rowconfig $p 0 -weight 1
 	grid rowconfig $p 1
 	#grid rowconfig $p 1 -weight 1
 	enable_active_photo $p $jid
-	manage_focus $jid photo $p.use_url $editable
+	manage_focus $jid photo $p.use_none $editable
+
+	trace variable [namespace current]::userinfo(photo_use,$jid) w \
+	    [list userinfo::enable_active_photo $p $jid]
+	bind $p <Destroy> \
+	    +[list trace vdelete [namespace current]::userinfo(photo_use,$jid) w \
+		   [list userinfo::enable_active_photo $p $jid]]
     }
 
 
@@ -465,7 +472,7 @@
 
 hook::add userinfo_hook [namespace current]::userinfo::client_page
 
-proc userinfo::enable_active_photo {p jid} {
+proc userinfo::enable_active_photo {p jid args} {
     switch -- $userinfo::userinfo(photo_use,$jid) {
 	url {
 	    $p.photo_url configure -state normal
@@ -665,6 +672,7 @@
 		catch {		
 		    set userinfo(photo_binval,$jid) [base64::decode $chdata]
 		    set userinfo(photo_use,$jid) image
+		    photo_$jid blank
 		    photo_$jid put $chdata
 		    catch { reconfigure_photo $jid }
 		}



More information about the Tkabber-dev mailing list