From: <vi...@us...> - 2010-05-08 22:07:40
|
Revision: 12027 http://amsn.svn.sourceforge.net/amsn/?rev=12027&view=rev Author: vivia Date: 2010-05-08 22:07:33 +0000 (Sat, 08 May 2010) Log Message: ----------- Okay, now we should be able to drag and drop URLs as well :p Modified Paths: -------------- trunk/amsn/gui.tcl Modified: trunk/amsn/gui.tcl =================================================================== --- trunk/amsn/gui.tcl 2010-05-08 15:40:51 UTC (rev 12026) +++ trunk/amsn/gui.tcl 2010-05-08 22:07:33 UTC (rev 12027) @@ -6220,19 +6220,21 @@ set data [string range $data 1 end-1] } -#TODO #(VFS pseudo-)protocol: if we can't acces the file, display an error - foreach type [list smb http https ftp sftp floppy cdrom dvd] { - if {[string first $type $data] == 0} { - status_log "file can't be accessed: $data" - return refuse_drop + if { $action != pasteText } { + #TODO #(VFS pseudo-)protocol: if we can't acces the file, display an error + foreach type [list smb http https ftp sftp floppy cdrom dvd] { + if {[string first $type $data] == 0} { + status_log "file can't be accessed: $data" + return refuse_drop + } } + + #If the data begins with "file://", strip this off + if { [string range $data 0 6] == "file://" } { + set data [string range $data 7 [string length $data]] + } } - #If the data begins with "file://", strip this off - if { [string range $data 0 6] == "file://" } { - set data [string range $data 7 [string length $data]] - } - status_log "File dropped: $data" switch $action { @@ -6271,6 +6273,7 @@ if { [catch {[::ChatWindow::GetInputText $target] insert end $data} res] } { status_log "Unable to drop text \"$data\" to $target: $res" } + return copy } default { status_log "Dunnow what to do with the file ... what's $action ?" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |