aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelweb.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpanelweb.cpp71
1 files changed, 69 insertions, 2 deletions
diff --git a/linden/indra/newview/llpanelweb.cpp b/linden/indra/newview/llpanelweb.cpp
index 2b91bd2..7f25d78 100644
--- a/linden/indra/newview/llpanelweb.cpp
+++ b/linden/indra/newview/llpanelweb.cpp
@@ -41,9 +41,11 @@
41 41
42// project includes 42// project includes
43#include "llbutton.h" 43#include "llbutton.h"
44#include "llcheckboxctrl.h"
45#include "lllineeditor.h"
46#include "llmozlib.h"
44#include "llui.h" 47#include "llui.h"
45#include "lluictrlfactory.h" 48#include "lluictrlfactory.h"
46#include "llcheckboxctrl.h"
47#include "llviewercontrol.h" 49#include "llviewercontrol.h"
48#include "llvieweruictrlfactory.h" 50#include "llvieweruictrlfactory.h"
49#include "llviewerwindow.h" 51#include "llviewerwindow.h"
@@ -61,14 +63,25 @@ BOOL LLPanelWeb::postBuild()
61{ 63{
62 childSetAction( "clear_cache", onClickClearCache, this ); 64 childSetAction( "clear_cache", onClickClearCache, this );
63 childSetAction( "clear_cookies", onClickClearCookies, this ); 65 childSetAction( "clear_cookies", onClickClearCookies, this );
64// childSetEnabled( "connection_port", gSavedSettings.getBOOL( "CookiesEnabled" ) );
65 childSetCommitCallback( "cookies_enabled", onCommitCookies, this ); 66 childSetCommitCallback( "cookies_enabled", onCommitCookies, this );
67 childSetCommitCallback( "web_proxy_editor", onCommitWebProxyAddress, this);
68 childSetCommitCallback( "web_proxy_port", onCommitWebProxyPort, this);
69
70 childSetEnabled("web_proxy_editor",
71 gSavedSettings.getBOOL("BrowserProxyEnabled"));
72 childSetEnabled("web_proxy_port",
73 gSavedSettings.getBOOL("BrowserProxyEnabled"));
74 childSetEnabled("proxy_text_label",
75 gSavedSettings.getBOOL("BrowserProxyEnabled"));
76 childSetCommitCallback("web_proxy_enabled", onCommitWebProxyEnabled, this);
66 77
67 refresh(); 78 refresh();
68 79
69 return TRUE; 80 return TRUE;
70} 81}
71 82
83
84
72LLPanelWeb::~LLPanelWeb() 85LLPanelWeb::~LLPanelWeb()
73{ 86{
74 // Children all cleaned up by default view destructor. 87 // Children all cleaned up by default view destructor.
@@ -83,6 +96,15 @@ void LLPanelWeb::refresh()
83 LLPanel::refresh(); 96 LLPanel::refresh();
84 97
85 mCookiesEnabled = gSavedSettings.getBOOL("CookiesEnabled"); 98 mCookiesEnabled = gSavedSettings.getBOOL("CookiesEnabled");
99 mWebProxyEnabled = gSavedSettings.getBOOL("BrowserProxyEnabled");
100 mWebProxyAddress = gSavedSettings.getString("BrowserProxyAddress");
101 mWebProxyPort = gSavedSettings.getS32("BrowserProxyPort");
102
103 LLLineEditor* web_proxy_editor = gUICtrlFactory->getLineEditorByName(this, "web_proxy_editor");
104 if (web_proxy_editor)
105 {
106 web_proxy_editor->setText( gSavedSettings.getString("BrowserProxyAddress") );
107 }
86 108
87#if LL_LIBXUL_ENABLED 109#if LL_LIBXUL_ENABLED
88 llinfos << "setting cookies enabled to " << mCookiesEnabled << llendl; 110 llinfos << "setting cookies enabled to " << mCookiesEnabled << llendl;
@@ -99,6 +121,11 @@ void LLPanelWeb::cancel()
99#endif // LL_LIBXUL_ENABLED 121#endif // LL_LIBXUL_ENABLED
100 122
101 gSavedSettings.setBOOL( "CookiesEnabled", mCookiesEnabled ); 123 gSavedSettings.setBOOL( "CookiesEnabled", mCookiesEnabled );
124 gSavedSettings.setBOOL( "BrowserProxyEnabled", mWebProxyEnabled );
125 gSavedSettings.setString( "BrowserProxyAddress", mWebProxyAddress );
126 gSavedSettings.setS32( "BrowserProxyPort", mWebProxyPort );
127
128 LLMozLib::getInstance()->enableProxy( mWebProxyEnabled, mWebProxyAddress, mWebProxyPort );
102} 129}
103 130
104// static 131// static
@@ -155,3 +182,43 @@ void LLPanelWeb::onCommitCookies(LLUICtrl* ctrl, void* data)
155#endif // LL_LIBXUL_ENABLED 182#endif // LL_LIBXUL_ENABLED
156 183
157} 184}
185// static
186void LLPanelWeb::onCommitWebProxyEnabled(LLUICtrl* ctrl, void* data)
187{
188 LLPanelWeb* self = (LLPanelWeb*)data;
189 LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
190
191 if (!self || !check) return;
192 self->childSetEnabled("web_proxy_editor",
193 check->get());
194 self->childSetEnabled("web_proxy_port",
195 check->get());
196 self->childSetEnabled("proxy_text_label",
197 check->get());
198
199 LLMozLib::getInstance()->enableProxy( gSavedSettings.getBOOL("BrowserProxyEnabled"),
200 gSavedSettings.getString("BrowserProxyAddress"),
201 gSavedSettings.getS32("BrowserProxyPort") );
202}
203
204void LLPanelWeb::onCommitWebProxyAddress(LLUICtrl *ctrl, void *userdata)
205{
206 LLLineEditor* web_proxy = (LLLineEditor*)ctrl;
207
208 if (web_proxy)
209 {
210 gSavedSettings.setString("BrowserProxyAddress", web_proxy->getText());
211 }
212
213 LLMozLib::getInstance()->enableProxy( gSavedSettings.getBOOL("BrowserProxyEnabled"),
214 gSavedSettings.getString("BrowserProxyAddress"),
215 gSavedSettings.getS32("BrowserProxyPort") );
216}
217
218void LLPanelWeb::onCommitWebProxyPort(LLUICtrl *ctrl, void *userdata)
219{
220 LLMozLib::getInstance()->enableProxy( gSavedSettings.getBOOL("BrowserProxyEnabled"),
221 gSavedSettings.getString("BrowserProxyAddress"),
222 gSavedSettings.getS32("BrowserProxyPort") );
223
224}