linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #07942
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3394: Add "/d <search>" for DuckDuckGo searches
------------------------------------------------------------
revno: 3394
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2014-02-02 22:56:08 +0100
message:
Add "/d <search>" for DuckDuckGo searches
modified:
help/chat_commands.html
win32/WinUtil.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'help/chat_commands.html'
--- help/chat_commands.html 2013-11-29 20:41:48 +0000
+++ help/chat_commands.html 2014-02-02 21:56:08 +0000
@@ -103,6 +103,9 @@
settings page.</dd>
<dt><untranslated>/back</untranslated></dt>
<dd>Un-sets Away status.</dd>
+ <dt><untranslated>/d <search string></untranslated></dt>
+ <dd>Launches your default web browser to the DuckDuckGo search engine
+with the specified search.</dd>
<dt><untranslated>/g <search string></untranslated></dt>
<dd>Launches your default web browser to the Google search engine
with the specified search.</dd>
=== modified file 'win32/WinUtil.cpp'
--- win32/WinUtil.cpp 2013-11-22 22:26:10 +0000
+++ win32/WinUtil.cpp 2014-02-02 21:56:08 +0000
@@ -571,6 +571,8 @@
+ _T("\r\n\t") + T_("Sets Away status. New private message windows will be responded to, once, with the message you specified, or the default away message configured in the Personal information settings page.")
+ _T("\r\n") _T("/back")
+ _T("\r\n\t") + T_("Un-sets Away status.")
+ + _T("\r\n") _T("/d <search string>")
+ + _T("\r\n\t") + T_("Launches your default web browser to the DuckDuckGo search engine with the specified search.")
+ _T("\r\n") _T("/g <search string>")
+ _T("\r\n\t") + T_("Launches your default web browser to the Google search engine with the specified search.")
+ _T("\r\n") _T("/imdb <imdb query>")
@@ -589,7 +591,7 @@
tstring
WinUtil::commands =
- _T("/refresh, /me <msg>, /clear [lines to keep], /slots #, /dslots #, /search <string>, /f <string>, /dc++, /away <msg>, /back, /g <searchstring>, /imdb <imdbquery>, /u <url>, /rebuild, /download, /upload");
+ _T("/refresh, /me <msg>, /clear [lines to keep], /slots #, /dslots #, /search <string>, /f <string>, /dc++, /away <msg>, /back, /d <searchstring>, /g <searchstring>, /imdb <imdbquery>, /u <url>, /rebuild, /download, /upload");
bool WinUtil::checkCommand(tstring& cmd, tstring& param, tstring& message, tstring& status, bool& thirdPerson) {
string::size_type i = cmd.find(' ');
@@ -658,6 +660,12 @@
} else if(Util::stricmp(cmd.c_str(), _T("back")) == 0) {
Util::setAway(false);
status = T_("Away mode off");
+ } else if(Util::stricmp(cmd.c_str(), _T("d")) == 0) {
+ if(param.empty()) {
+ status = T_("Specify a search string");
+ } else {
+ WinUtil::openLink(_T("http://www.duckduckgo.com/?q=") + Text::toT(Util::encodeURI(Text::fromT(param))));
+ }
} else if(Util::stricmp(cmd.c_str(), _T("g")) == 0) {
if(param.empty()) {
status = T_("Specify a search string");