[Tkabber-dev] r1754 - in trunk/tkabber: . plugins/filetransfer

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Mar 27 22:39:58 MSK 2009


Author: sergei
Date: 2009-03-27 22:39:58 +0300 (Fri, 27 Mar 2009)
New Revision: 1754

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/filetransfer.tcl
   trunk/tkabber/plugins/filetransfer/http.tcl
   trunk/tkabber/plugins/filetransfer/si.tcl
Log:
	* filetransfer.tcl, plugins/filetransfer/http.tcl,
	  plugins/filetransfer/si.tcl: Made filetransfer windows non-transient,
	  so they can be iconified separately from the main window.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-03-27 18:28:28 UTC (rev 1753)
+++ trunk/tkabber/ChangeLog	2009-03-27 19:39:58 UTC (rev 1754)
@@ -25,6 +25,10 @@
 	  which used %A substitution from chat input windows. This makes XIM
 	  working in chat windows.
 
+	* filetransfer.tcl, plugins/filetransfer/http.tcl,
+	  plugins/filetransfer/si.tcl: Made filetransfer windows non-transient,
+	  so they can be iconified separately from the main window.
+
 2009-03-20  Sergei Golovan  <sgolovan at nes.ru>
 
 	* messages.tcl: Put messages in the message archive only if they have

Modified: trunk/tkabber/filetransfer.tcl
===================================================================
--- trunk/tkabber/filetransfer.tcl	2009-03-27 18:28:28 UTC (rev 1753)
+++ trunk/tkabber/filetransfer.tcl	2009-03-27 19:39:58 UTC (rev 1754)
@@ -156,7 +156,7 @@
 
     Dialog $w -title [::msgcat::mc "Send file to %s" $jid] \
 	      -separator 1 -anchor e -modal none \
-	      -default 0 -cancel 1
+	      -transient 0 -default 0 -cancel 1
 
     $w add -text [::msgcat::mc "Send"] \
 	   -command [list [namespace current]::send_file_negotiate $token]
@@ -170,7 +170,7 @@
     label $f.lfile -text [::msgcat::mc "File path:"]
     entry $f.file -textvariable ${token}(filename)
     button $f.browsefile -text [::msgcat::mc "Browse..."] \
-	-command [list [namespace current]::set_send_file_name $token]
+	-command [list [namespace current]::set_send_file_name $token $w]
 
     label $f.ldesc -text [::msgcat::mc "Description:"]
     set sw [ScrolledWindow $f.sw -scrollbar vertical]
@@ -217,11 +217,11 @@
     $w draw $f.file
 }
 
-proc ft::set_send_file_name {token} {
+proc ft::set_send_file_name {token w} {
     variable $token
     upvar 0 $token state
 
-    set file [tk_getOpenFile]
+    set file [tk_getOpenFile -parent $w]
     if {$file != ""} {
 	set state(filename) $file
     }

Modified: trunk/tkabber/plugins/filetransfer/http.tcl
===================================================================
--- trunk/tkabber/plugins/filetransfer/http.tcl	2009-03-27 18:28:28 UTC (rev 1753)
+++ trunk/tkabber/plugins/filetransfer/http.tcl	2009-03-27 19:39:58 UTC (rev 1754)
@@ -179,7 +179,7 @@
     set url [lindex $urls 0]
 
     Dialog $w -title [::msgcat::mc "Receive file from %s" $from] \
-	-separator 1 -anchor e \
+	-separator 1 -anchor e -transient 0 \
 	-modal none -default 0 -cancel 1
 
     set f [$w getframe]
@@ -196,7 +196,7 @@
     entry $f.saveas -textvariable [list [namespace current]::saveas$winid]
     variable saveas$winid [file join $dir $fname]
     button $f.browsefile -text [::msgcat::mc "Browse..."] \
-	-command [list [namespace current]::set_receive_file_name $winid $dir $fname]
+	-command [list [namespace current]::set_receive_file_name $w $winid $dir $fname]
 
     ProgressBar $f.pb -variable [list [namespace current]::progress$f.pb]
     variable progress$f.pb 0
@@ -231,10 +231,10 @@
     return $res
 }
 
-proc http::set_receive_file_name {winid dir fname} {
+proc http::set_receive_file_name {w winid dir fname} {
     variable saveas$winid
 
-    set file [tk_getSaveFile -initialdir $dir -initialfile $fname]
+    set file [tk_getSaveFile -parent $w -initialdir $dir -initialfile $fname]
     if {$file != ""} {
 	set saveas$winid $file
     }

Modified: trunk/tkabber/plugins/filetransfer/si.tcl
===================================================================
--- trunk/tkabber/plugins/filetransfer/si.tcl	2009-03-27 18:28:28 UTC (rev 1753)
+++ trunk/tkabber/plugins/filetransfer/si.tcl	2009-03-27 19:39:58 UTC (rev 1754)
@@ -118,7 +118,7 @@
     set state(id) $id
 
     Dialog $w -title [::msgcat::mc "Receive file from %s" $from] \
-	-separator 1 -anchor e \
+	-separator 1 -anchor e -transient 0 \
 	-modal none -default 0 -cancel 1
 
 
@@ -145,7 +145,7 @@
     set state(name) $name
     set state(filename) [file join $dir $name]
     button $f.browsefile -text [::msgcat::mc "Browse..."] \
-	-command [list [namespace current]::set_receive_file_name $token]
+	-command [list [namespace current]::set_receive_file_name $token $w]
 
     set state(progress) 0
 
@@ -186,11 +186,12 @@
     return
 }
 
-proc si::set_receive_file_name {token} {
+proc si::set_receive_file_name {token w} {
     upvar #0 $token state
 
     set file [tk_getSaveFile -initialdir $state(dir) \
-			     -initialfile $state(name)]
+			     -initialfile $state(name) \
+			     -parent $w]
     if {$file != ""} {
 	set state(filename) $file
     }



More information about the Tkabber-dev mailing list