From: <kak...@us...> - 2007-05-31 22:34:11
|
Revision: 8791 http://svn.sourceforge.net/amsn/?rev=8791&view=rev Author: kakaroto Date: 2007-05-31 15:34:10 -0700 (Thu, 31 May 2007) Log Message: ----------- As suggested by Coup (http://www.amsn-project.net/forums/viewtopic.php?t=3401) Adding a 'insert smiley' menu entry in the chat window's contextual menu for those who hide the buttonbar. Modified Paths: -------------- trunk/amsn/chatwindow.tcl trunk/amsn/plugins.tcl Modified: trunk/amsn/chatwindow.tcl =================================================================== --- trunk/amsn/chatwindow.tcl 2007-05-31 22:22:35 UTC (rev 8790) +++ trunk/amsn/chatwindow.tcl 2007-05-31 22:34:10 UTC (rev 8791) @@ -1591,6 +1591,7 @@ -command "status_log copy\n;tk_textCopy $w" $menu add command -label [trans paste] \ -command "status_log paste\n;tk_textPaste $w" + $menu add command -label [trans insertsmiley] -command "" return $menu } @@ -2107,7 +2108,7 @@ bind $text <Tab> "focus $sendbutton; break" } - bind $text <<Button3>> "tk_popup $w.copypaste %X %Y" + bind $text <<Button3>> [list ::ChatWindow::OpenPasteMenu $w %X %Y] bind $text <<Button2>> "paste $w 1" #Better binding, works for Tk 8.4 only (see proc tification too) @@ -2175,6 +2176,11 @@ return $input } + proc OpenPasteMenu { w x y } { + $w.copypaste entryconfigure [$w.copypaste index [trans insertsmiley]] \ + -command "::smiley::smileyMenu \[winfo pointerx $w\] \[winfo pointery $w\] [::ChatWindow::GetInputText $w]" + tk_popup $w.copypaste $x $y + } ############################################################### # HandleFileDrop window data # Modified: trunk/amsn/plugins.tcl =================================================================== --- trunk/amsn/plugins.tcl 2007-05-31 22:22:35 UTC (rev 8790) +++ trunk/amsn/plugins.tcl 2007-05-31 22:34:10 UTC (rev 8791) @@ -1741,20 +1741,20 @@ set URL "[subst $URL]" set token [::http::geturl "$URL" -timeout 120000 -binary 1] } else { - return 0 + return -1 } set status [::http::status $token] if { $status != "ok" } { ::http::cleanup $token - return 0 + return -2 } set content [::http::data $token] if { [string first "<html>" "$content"] != -1 } { ::http::cleanup $token - return 0 + return -3 } set filename [file join [getInfo $plugin plugin_dir] [getInfo $plugin plugin_file]] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |