Sethnakht
Newbie
Offline
Posts: 36
|
 |
« on: June 11, 2007, 10:15:56 pm » |
|
Hello, I've made a new plugin : AvatarAutoChange http://www.savefile.com/files/1322192The goal if to change to display image (Avatar) when the status change (manually or automatically) to set a more accurate DP for your contacts . (It's functional, but could be, of course, improved. first of all the config window.) I would know if it's possible to add new Post Events: - MyDisplayPictureChange : to notify the modification of the DP (in gui.tcl, proc pictureBrowser) - BeforeChangeMyState : to notify plugins of the imminent state change (to let plugin save old state, change state message, ...) (in automsg.tcl before ::MSN::changeStatus $new_state, and in gui.tcl before ::MSN::changeStatus XXX (3 times)) Thanks for your suggestions ! 
|
|
|
Logged
|
|
|
|
square87
|
 |
« Reply #1 on: June 12, 2007, 07:21:03 am » |
|
Hello Sethnakht  It's nice and useful for someone. Thanks. About BeforeChangeMyState. Save initial status in a var (var1), then when ChangeMyState Event is called you save the new status in a var2. Then... when the user will change again his/her status: set var1 $var2 set var2 NewStatus So var1 will always have the penultimate status. About MyDisplayPictureChange: what do you what to do with this Event? Do you save the last avatar used? If yes you can write a solution like for BeforeChangeMyState. When DP is changed ContactListColourBarDrawn Event is called (in general it's called when we change something in topCL) TODO/Suggestion: * Auto-resize avatars (it's important, see how aMSN works about that) * You can add tk_getOpenFile command ( http://www.tcl.tk/man/tcl8.4/TkCmd/getOpenFile.htm ) to open a search window, then select a file and path of file will be returned. Thanks, it was in my TODO list  Sorry for my English. Are you Italian?  Have a nice day.
|
|
|
Logged
|
|
|
|
Phil
|
 |
« Reply #2 on: June 12, 2007, 10:38:48 pm » |
|
He is french....
|
|
|
Logged
|
Phil
AMsn is great, and it will be greater :wink:
|
|
|
Sethnakht
Newbie
Offline
Posts: 36
|
 |
« Reply #3 on: June 12, 2007, 10:43:43 pm » |
|
Hi square87, Thanks for your reply, The event ContactListColourBarDrawn is interesting but, after some tests, it's not called after a manual change of the display picture The BeforeChangeMyState would be usefull to change the DP before sending the status to MSN server/contact, currently, i'm sending a second time the status+display picture (using ::MSN::WriteSB) while it's done just before my the ::MSN::changeStatus Thanks for your todo list, i'm getting some problem to make a config windows with button but I should be able to do it... :wink: (not Italian, I'm French)
|
|
|
Logged
|
|
|
|
square87
|
 |
« Reply #4 on: June 13, 2007, 07:58:17 am » |
|
Hi square87, Thanks for your reply, Hi Sethnakht The event ContactListColourBarDrawn is interesting but, after some tests, it's not called after a manual change of the display picture right  The BeforeChangeMyState would be usefull to change the DP before sending the status to MSN server/contact, currently, i'm sending a second time the status+display picture (using ::MSN::WriteSB) while it's done just before my the ::MSN::changeStatus Is it necessary? The plugin works only if an user change a status... why do you set again the same status? If an user change status, check if there is a default avatar for that status, if yes load default avatar else do nothing. I think that you can clean your proc in this way: proc setAvatar { file new_state } { if { $file != "" } { ::config::setKey displaypic $file load_my_pic return 1 } else { return -1 } } btw it's only my opinion  Thanks for your todo list, i'm getting some problem to make a config windows with button but I should be able to do it... :wink: you are welcome  Bye ^___^
|
|
|
Logged
|
|
|
|
Sethnakht
Newbie
Offline
Posts: 36
|
 |
« Reply #5 on: June 13, 2007, 06:45:44 pm » |
|
Hi, Thanks for taking time in looking my code, I think that you can clean your proc in this way: proc setAvatar { file new_state } { if { $file != "" } { ::config::setKey displaypic $file load_my_pic return 1 } else { return -1 } } If the code is this one, the display picture is only set in local config (and shown on the GUI) but it's not sent to contacts... it will be only send at the next status change...  so.. for the time being, i re-send the status+DP (But a new Beforechangestate event could avoid this.. the DP will be send in the same time than the new status)
|
|
|
Logged
|
|
|
|
square87
|
 |
« Reply #6 on: June 14, 2007, 07:18:53 am » |
|
Hi Sethnakht  I don't know, i think that's a protocol thing. Maybe in that case "status change" is only a signal. But anyway you'll save few seconds. If you want you can send a diff to ML. About setAvatar you can change "load_my_pic" in "after 500 set_displaypic $file", and it will work, but, anyway, it calls change status proc. Byez
|
|
|
Logged
|
|
|
|
vivia
|
 |
« Reply #7 on: June 14, 2007, 10:01:08 am » |
|
It is normal, you must change status in order to notify the server.
|
|
|
Logged
|
|
|
|
Sethnakht
Newbie
Offline
Posts: 36
|
 |
« Reply #8 on: June 19, 2007, 10:27:16 pm » |
|
I have submit a new version, it's include : - new config panel (image preview, file browser - resize avatar to 96x96 option I have changed the name to make is shorter : AvatarAutoChange here it is : AvatarAutoChange.zipThanks for your comments and suggestions, and if I can submit it...
|
|
|
Logged
|
|
|
|
joaquimcr
Newbie
Offline
Posts: 7
|
 |
« Reply #9 on: June 21, 2007, 05:20:14 pm » |
|
lang pt_BR amsn_lang_version 2 selectimage Selecionar uma imagem para cada estado : resizeimage Converter imagens para o tamanho padrão (96px) bye!
|
|
|
Logged
|
|
|
|
Sethnakht
Newbie
Offline
Posts: 36
|
 |
« Reply #10 on: June 22, 2007, 06:54:29 pm » |
|
lang pt_BR amsn_lang_version 2 selectimage Selecionar uma imagem para cada estado : resizeimage Converter imagens para o tamanho padrão (96px) bye! Thanks joaquimcr ! 
|
|
|
Logged
|
|
|
|
lucianolev
Power user
Offline
Posts: 56
|
 |
« Reply #11 on: June 26, 2007, 03:22:28 am » |
|
lang es_AR amsn_lang_version 2 selectimage Seleccionar una imagen para cada estado : resizeimage Redimensionar imágenes al tamaño predeterminado (96px)
Thanks for the plugin! 
|
|
|
Logged
|
|
|
|
Sethnakht
Newbie
Offline
Posts: 36
|
 |
« Reply #12 on: July 01, 2007, 03:15:09 pm » |
|
Update : AvatarAutoChange.1.0beta3 Add "no avatar" button to supress the avatar for a state Add controls to avoid errors if the image has been deleted... Add es_AR and pt_BR languages (thanks to lucianolev and joaquimcr) AvatarAutoChange.1.0.zipSeth.
|
|
|
Logged
|
|
|
|
Sethnakht
Newbie
Offline
Posts: 36
|
 |
« Reply #13 on: July 01, 2007, 09:34:25 pm » |
|
Update: AvatarAutoChange.1.0beta4 The avatar changed with the classic change display picture is kept in the plug-in settings. This version contains all the needed stuff, it should be the final release. AvatarAutoChange.1.0beta4.zipSeth.
|
|
|
Logged
|
|
|
|
Sethnakht
Newbie
Offline
Posts: 36
|
 |
« Reply #14 on: July 15, 2007, 12:52:49 pm » |
|
Update for a better interaction between the classic change display picture window and the plugin configuration pannel. Also fix a error with the chamelon plugin. AvatarAutoChange1.1I also have a question : Is it possible to be notified if the user SAVE or CANCEL the plugin options window :?: Thanks, Seth.
|
|
|
Logged
|
|
|
|
|