Hello! Yeah, you're right, it's different.. maybe it should also be commited.. we'll just need to make sure a user knows what's happening, like a 'Do you want to set your DP to ..." and "Do you want to set a custom DP for user..." otherwise, someone might D&D a file to send and drop it in the wrong place and he doesn't understand what happened...
KaKaRoTo On Fri, Dec 21, 2007 at 01:05:54PM +0100, Karel Demeyer wrote: > ---------- Forwarded message ---------- > From: Karel Demeyer <[EMAIL PROTECTED]> > Date: 21 dec. 2007 13:05 > Subject: Re: [Amsn-commits] SF.net SVN: amsn: [9139] trunk/amsn/gui.tcl > To: Youness Alaoui <[EMAIL PROTECTED]> > > I think that patch is about dropping on the DP in chatwindows which isn't > that intuitive at first. It would be nice to have it too as you can both > set your own and other's custom DP's. This patch is only for dropping on > your own DP on top of the CL. > > Friendly greeting, > > Karel > > 2007/12/21, Youness Alaoui <[EMAIL PROTECTED]>: > > > > Did you see this thread ? there's a full patch (untested by me though.. > > but looks good enough) for drag/drop DP : > > http://www.amsn-project.net/forums/viewtopic.php?t=3481 > > > > If you want, you can review it, test and commit it! > > > > KaKaRoTo > > > > On Thu, Dec 20, 2007 at 01:28:28PM -0800, [EMAIL PROTECTED]: > > > Revision: 9139 > > > http://amsn.svn.sourceforge.net/amsn/?rev=9139&view=rev > > > Author: scapor > > > Date: 2007-12-20 13:27:20 -0800 (Thu, 20 Dec 2007) > > > > > > Log Message: > > > ----------- > > > initial support for dropping files on the DP on top of the CL for > > setting one's own DP. needs testing on win/mac, works for me, reverse commit > > if it's badly done or not wanted > > > > > > Modified Paths: > > > -------------- > > > trunk/amsn/gui.tcl > > > > > > Modified: trunk/amsn/gui.tcl > > > =================================================================== > > > --- trunk/amsn/gui.tcl 2007-12-20 16:00:39 UTC (rev 9138) > > > +++ trunk/amsn/gui.tcl 2007-12-20 21:27:20 UTC (rev 9139) > > > @@ -4956,17 +4956,49 @@ > > > > > > > > > bind $tw.$name <Button1-ButtonRelease> $command > > > + # Drag and Drop setting DP > > > + ::dnd bindtarget $tw.$name Files <Drop> "dpImageDropHandler %D" > > > > > > return $tw.$name > > > } > > > > > > -proc dpImageDropHandler {window data} { > > > - #puts "Drop of image on $window : $data" > > > - > > > +proc dpImageDropHandler { data } { > > > set data [string map {\r "" \n "" \x00 ""} $data] > > > set data [urldecode $data] > > > + > > > + if { [OnWin] } { > > > + if { [string index $data 0] == "{" && [string index $data > > end] == "}" } { > > > + set data [string range $data 1 end-1] > > > + } > > > + status_log "File dropped to change DP: $data" > > > + setMyDPFromFile $data > > > + > > > + } else { > > > + > > > +#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" > > > + } > > > + } > > > + > > > + #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 to change DP: $data" > > > + setMyDPFromFile $data > > > + } > > > + > > > } > > > > > > +proc setMyDPFromFile { file } { > > > + after 0 dpBrowser > > > + > > > + set target "self" > > > + setDPFromFile "self" $file > > > +} > > > + > > > # The same as the previous one, but this proc works on a list. > > > proc trunc_list {str {window ""} {maxw 0 } {font ""}} { > > > if { $window == "" || $font == "" || [::config::getKey > > truncatenames]!=1} { > > > @@ -7214,10 +7246,14 @@ > > > > > > > > > proc pictureChooseFile { target } { > > > - global HOME > > > > > > set file [chooseFileDialog "" "" "" "" open [list [list [trans > > imagefiles] [list *.gif *.GIF *.jpg *.JPG *.bmp *.BMP *.png *.PNG]] [list > > [trans allfiles] *]]] > > > + setDPFromFile $target $file > > > > > > +} > > > + > > > +proc setDPFromFile { target file } { > > > + global HOME > > > if { $file != "" } { > > > set convertsize "96x96" > > > if { [catch {::picture::GetPictureSize $file} cursize] } { > > > > > > > > > This was sent by the SourceForge.net collaborative development platform, > > the world's largest Open Source development site. > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by: Microsoft > > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > _______________________________________________ > > > Amsn-commits mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/amsn-commits > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Amsn-devel mailing list > Amsn-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/amsn-devel ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel