From 9bae6a3ae958365b7f9834cf7fc87d18ef07ee8c Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 5 Feb 2010 16:59:40 +0100 Subject: Added custom search URL in Preferences > Web. --- linden/indra/newview/llpanelweb.cpp | 28 ++++++++++++++++++++++ linden/indra/newview/llpanelweb.h | 2 ++ .../default/xui/en-us/panel_preferences_web.xml | 20 ++++++++++++++++ 3 files changed, 50 insertions(+) (limited to 'linden') diff --git a/linden/indra/newview/llpanelweb.cpp b/linden/indra/newview/llpanelweb.cpp index 2e7a9a1..32ec567 100644 --- a/linden/indra/newview/llpanelweb.cpp +++ b/linden/indra/newview/llpanelweb.cpp @@ -100,6 +100,10 @@ BOOL LLPanelWeb::postBuild() childSetValue("web_proxy_editor", gSavedSettings.getString("BrowserProxyAddress")); childSetValue("web_proxy_port", gSavedSettings.getS32("BrowserProxyPort")); + childSetValue("world_search_editor", gSavedSettings.getString("SearchURLQuery")) ; + childSetAction("world_search_reset_default", onClickDefault, this); + childSetAction("world_search_clear", onClickClear, this); + childSetEnabled("proxy_text_label", gSavedSettings.getBOOL("BrowserProxyEnabled")); childSetEnabled("web_proxy_editor", gSavedSettings.getBOOL("BrowserProxyEnabled")); childSetEnabled("web_proxy_port", gSavedSettings.getBOOL("BrowserProxyEnabled")); @@ -120,6 +124,7 @@ void LLPanelWeb::apply() gSavedSettings.setBOOL("BrowserProxyEnabled", childGetValue("web_proxy_enabled")); gSavedSettings.setString("BrowserProxyAddress", childGetValue("web_proxy_editor")); gSavedSettings.setS32("BrowserProxyPort", childGetValue("web_proxy_port")); + gSavedSettings.setString("SearchURLQuery", childGetValue("world_search_editor")); bool value = childGetValue("use_external_browser").asString() == "external" ? true : false; gSavedSettings.setBOOL("UseExternalBrowser", value); @@ -207,3 +212,26 @@ void LLPanelWeb::onCommitWebProxyEnabled(LLUICtrl* ctrl, void* data) } + +// static +void LLPanelWeb::onClickDefault(void* user_data) +{ + LLPanelWeb* self = (LLPanelWeb*)user_data; + LLControlVariable* controlp = gSavedSettings.getControl("SearchURLQuery"); + if (controlp) + { + self->childSetValue("world_search_editor",controlp->getDefault().asString()) ; + } + else + { + llwarns << "SearchURLQuery missing from settings.xml - thats bad!" << llendl; + } + +} + +// static +void LLPanelWeb::onClickClear(void* user_data) +{ + LLPanelWeb* self = (LLPanelWeb*)user_data; + self->childSetValue("world_search_editor","") ; +} \ No newline at end of file diff --git a/linden/indra/newview/llpanelweb.h b/linden/indra/newview/llpanelweb.h index 449b9cb..3282827 100644 --- a/linden/indra/newview/llpanelweb.h +++ b/linden/indra/newview/llpanelweb.h @@ -49,6 +49,8 @@ public: private: static void onClickClearCache(void*); static void onClickClearCookies(void*); + static void onClickDefault(void* user_data); + static void onClickClear(void* user_data); static bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response); static bool callback_clear_cookies(const LLSD& notification, const LLSD& response); static void onCommitCookies(LLUICtrl* ctrl, void* data); diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_web.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_web.xml index ed13e8f..117e494 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_web.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_web.xml @@ -61,4 +61,24 @@ initial_val="80" label="Port Number:" label_width="75" left="140" max_val="12000" min_val="10" mouse_opaque="true" name="web_proxy_port" width="140" /> + + World search: + + +