diff options
author | McCabe Maxsted | 2011-05-03 18:09:28 -0700 |
---|---|---|
committer | McCabe Maxsted | 2011-05-04 15:21:09 -0700 |
commit | cc8e7060dfb54900f1600965a78c6f6f9fc564c4 (patch) | |
tree | 9b23e53ace5696db2c78867582308f38cba19d71 /linden/indra/newview/llpanelnetwork.cpp | |
parent | Backported crash fix in llhudeffectlookat from gpl'd viewer 2 (diff) | |
download | meta-impy-cc8e7060dfb54900f1600965a78c6f6f9fc564c4.zip meta-impy-cc8e7060dfb54900f1600965a78c6f6f9fc564c4.tar.gz meta-impy-cc8e7060dfb54900f1600965a78c6f6f9fc564c4.tar.bz2 meta-impy-cc8e7060dfb54900f1600965a78c6f6f9fc564c4.tar.xz |
Besides the numerous label and organizational changes, here are the main points
* Moved numerous options out of the Advanced panel
* Moved numerous options out of the General panel
* Combined the Network and Web Browser panels
* Combined IM, Chat, and Spell checking preferences
* Combined 'Show timestamps in IMs' and 'Show timestamps in Local Chat' to one ShowTimestamps setting
* Removed UI for 'hide my own group title'. This can still be set in the debug settings
* Renamed Popups > Notifications
* Renamed Chat Colors > Colors
* Renamed 'IMs and Logging' to 'Logging and Privacy'
* Moved Colors next to Skins
* Added style guide to the top of every preferences panel xui
Diffstat (limited to 'linden/indra/newview/llpanelnetwork.cpp')
-rw-r--r-- | linden/indra/newview/llpanelnetwork.cpp | 241 |
1 files changed, 229 insertions, 12 deletions
diff --git a/linden/indra/newview/llpanelnetwork.cpp b/linden/indra/newview/llpanelnetwork.cpp index 3b866eb..b4ebe42 100644 --- a/linden/indra/newview/llpanelnetwork.cpp +++ b/linden/indra/newview/llpanelnetwork.cpp | |||
@@ -44,6 +44,30 @@ | |||
44 | #include "llviewercontrol.h" | 44 | #include "llviewercontrol.h" |
45 | #include "llviewerwindow.h" | 45 | #include "llviewerwindow.h" |
46 | 46 | ||
47 | // project includes | ||
48 | #include "llcheckboxctrl.h" | ||
49 | #include "hippogridmanager.h" | ||
50 | #include "lluictrlfactory.h" | ||
51 | #include "llviewercontrol.h" | ||
52 | #include "llviewermedia.h" | ||
53 | #include "llviewerwindow.h" | ||
54 | #include "llpluginclassmedia.h" | ||
55 | |||
56 | #include "hippogridmanager.h" | ||
57 | #include "llpluginclassmedia.h" | ||
58 | #include "llviewermedia.h" | ||
59 | |||
60 | // helper functions for getting/freeing the web browser media | ||
61 | // if creating/destroying these is too slow, we'll need to create | ||
62 | // a static member and update all our static callbacks | ||
63 | viewer_media_t get_web_media() | ||
64 | { | ||
65 | |||
66 | viewer_media_t media_source = LLViewerMedia::newMediaImpl("", LLUUID::null, 0, 0, 0, 0, "text/html"); | ||
67 | |||
68 | return media_source; | ||
69 | } | ||
70 | |||
47 | bool LLPanelNetwork::sSocksSettingsChanged; | 71 | bool LLPanelNetwork::sSocksSettingsChanged; |
48 | 72 | ||
49 | LLPanelNetwork::LLPanelNetwork() | 73 | LLPanelNetwork::LLPanelNetwork() |
@@ -54,16 +78,16 @@ LLPanelNetwork::LLPanelNetwork() | |||
54 | BOOL LLPanelNetwork::postBuild() | 78 | BOOL LLPanelNetwork::postBuild() |
55 | { | 79 | { |
56 | std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); | 80 | std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); |
57 | childSetText("cache_location", cache_location); | 81 | childSetText("disk_cache_location", cache_location); |
58 | 82 | ||
59 | childSetAction("clear_cache", onClickClearCache, this); | 83 | childSetAction("clear_disk_cache", onClickClearDiskCache, this); |
60 | childSetAction("set_cache", onClickSetCache, this); | 84 | childSetAction("set_disk_cache", onClickSetDiskCache, this); |
61 | childSetAction("reset_cache", onClickResetCache, this); | 85 | childSetAction("reset_disk_cache", onClickResetDiskCache, this); |
62 | 86 | ||
63 | childSetEnabled("connection_port", gSavedSettings.getBOOL("ConnectionPortEnabled")); | 87 | childSetEnabled("connection_port", gSavedSettings.getBOOL("ConnectionPortEnabled")); |
64 | childSetCommitCallback("connection_port_enabled", onCommitPort, this); | 88 | childSetCommitCallback("connection_port_enabled", onCommitPort, this); |
65 | 89 | ||
66 | childSetValue("cache_size", (F32)gSavedSettings.getU32("CacheSize")); | 90 | childSetValue("disk_cache_size", (F32)gSavedSettings.getU32("CacheSize")); |
67 | childSetValue("max_bandwidth", gSavedSettings.getF32("ThrottleBandwidthKBPS")); | 91 | childSetValue("max_bandwidth", gSavedSettings.getF32("ThrottleBandwidthKBPS")); |
68 | childSetValue("connection_port_enabled", gSavedSettings.getBOOL("ConnectionPortEnabled")); | 92 | childSetValue("connection_port_enabled", gSavedSettings.getBOOL("ConnectionPortEnabled")); |
69 | childSetValue("connection_port", (F32)gSavedSettings.getU32("ConnectionPort")); | 93 | childSetValue("connection_port", (F32)gSavedSettings.getU32("ConnectionPort")); |
@@ -99,8 +123,48 @@ BOOL LLPanelNetwork::postBuild() | |||
99 | // Socks 5 settings, Set all controls and labels enabled state | 123 | // Socks 5 settings, Set all controls and labels enabled state |
100 | updateProxyEnabled(this, gSavedSettings.getBOOL("Socks5ProxyEnabled"), gSavedSettings.getString("Socks5AuthType")); | 124 | updateProxyEnabled(this, gSavedSettings.getBOOL("Socks5ProxyEnabled"), gSavedSettings.getString("Socks5AuthType")); |
101 | 125 | ||
126 | childSetEnabled("xmlrpc_proxy_editor", gSavedSettings.getBOOL("XMLRPCProxyEnabled")); | ||
127 | childSetEnabled("xmlrpc_proxy_port", gSavedSettings.getBOOL("XMLRPCProxyEnabled")); | ||
128 | childSetEnabled("xmlrpc_proxy_text_label", gSavedSettings.getBOOL("XMLRPCProxyEnabled")); | ||
129 | |||
130 | childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP")); | ||
131 | childSetValue("speed_rez_check", gSavedSettings.getBOOL("SpeedRez")); | ||
132 | childSetValue("speed_rez_interval_spinner", (F32)gSavedSettings.getU32("SpeedRezInterval")); | ||
133 | childSetCommitCallback("speed_rez_check", onCommitSpeedRezCheckBox, this); | ||
134 | |||
102 | sSocksSettingsChanged = false; | 135 | sSocksSettingsChanged = false; |
103 | 136 | ||
137 | // formerly the Web panel -- MC | ||
138 | childSetAction("clear_web_cache", onClickClearWebCache, this); | ||
139 | childSetCommitCallback("web_proxy_enabled", onCommitWebProxyEnabled, this); | ||
140 | |||
141 | std::string value = gSavedSettings.getBOOL("UseExternalBrowser") ? "external" : "internal"; | ||
142 | childSetValue("use_external_browser", value); | ||
143 | |||
144 | childSetValue("cookies_enabled", gSavedSettings.getBOOL("BrowserCookiesEnabled")); | ||
145 | childSetAction("clear_cookies", onClickClearCookies,this); | ||
146 | |||
147 | childSetValue("web_proxy_enabled", gSavedSettings.getBOOL("BrowserProxyEnabled")); | ||
148 | childSetValue("web_proxy_editor", gSavedSettings.getString("BrowserProxyAddress")); | ||
149 | childSetValue("web_proxy_port", gSavedSettings.getS32("BrowserProxyPort")); | ||
150 | |||
151 | if (gHippoGridManager->getConnectedGrid()->isSecondLife()) | ||
152 | { | ||
153 | childSetValue("world_search_editor", gSavedSettings.getString("SearchURLQuery")) ; | ||
154 | } | ||
155 | else | ||
156 | { | ||
157 | childSetValue("world_search_editor", gSavedSettings.getString("SearchURLQueryOpenSim")) ; | ||
158 | } | ||
159 | childSetAction("world_search_reset_default", onClickSearchDefault, this); | ||
160 | childSetAction("world_search_clear", onClickSearchClear, this); | ||
161 | |||
162 | childSetEnabled("proxy_text_label", gSavedSettings.getBOOL("BrowserProxyEnabled")); | ||
163 | childSetEnabled("web_proxy_editor", gSavedSettings.getBOOL("BrowserProxyEnabled")); | ||
164 | childSetEnabled("web_proxy_port", gSavedSettings.getBOOL("BrowserProxyEnabled")); | ||
165 | |||
166 | refresh(); | ||
167 | |||
104 | return TRUE; | 168 | return TRUE; |
105 | } | 169 | } |
106 | 170 | ||
@@ -112,7 +176,7 @@ LLPanelNetwork::~LLPanelNetwork() | |||
112 | 176 | ||
113 | void LLPanelNetwork::apply() | 177 | void LLPanelNetwork::apply() |
114 | { | 178 | { |
115 | gSavedSettings.setU32("CacheSize", childGetValue("cache_size").asInteger()); | 179 | gSavedSettings.setU32("CacheSize", childGetValue("disk_cache_size").asInteger()); |
116 | gSavedSettings.setF32("ThrottleBandwidthKBPS", childGetValue("max_bandwidth").asReal()); | 180 | gSavedSettings.setF32("ThrottleBandwidthKBPS", childGetValue("max_bandwidth").asReal()); |
117 | gSavedSettings.setBOOL("ConnectionPortEnabled", childGetValue("connection_port_enabled")); | 181 | gSavedSettings.setBOOL("ConnectionPortEnabled", childGetValue("connection_port_enabled")); |
118 | gSavedSettings.setU32("ConnectionPort", childGetValue("connection_port").asInteger()); | 182 | gSavedSettings.setU32("ConnectionPort", childGetValue("connection_port").asInteger()); |
@@ -130,6 +194,10 @@ void LLPanelNetwork::apply() | |||
130 | gSavedSettings.setString("Socks5Username", childGetValue("socks5_proxy_username")); | 194 | gSavedSettings.setString("Socks5Username", childGetValue("socks5_proxy_username")); |
131 | gSavedSettings.setString("Socks5Password", childGetValue("socks5_proxy_password")); | 195 | gSavedSettings.setString("Socks5Password", childGetValue("socks5_proxy_password")); |
132 | 196 | ||
197 | gSavedSettings.setBOOL("ImagePipelineUseHTTP", childGetValue("http_texture_check")); | ||
198 | gSavedSettings.setBOOL("SpeedRez", childGetValue("speed_rez_check")); | ||
199 | gSavedSettings.setU32("SpeedRezInterval", childGetValue("speed_rez_interval_spinner").asReal()); | ||
200 | |||
133 | if (sSocksSettingsChanged) | 201 | if (sSocksSettingsChanged) |
134 | { | 202 | { |
135 | if (LLStartUp::getStartupState() != STATE_LOGIN_WAIT) | 203 | if (LLStartUp::getStartupState() != STATE_LOGIN_WAIT) |
@@ -142,14 +210,62 @@ void LLPanelNetwork::apply() | |||
142 | LLSocks::getInstance()->updated(); | 210 | LLSocks::getInstance()->updated(); |
143 | } | 211 | } |
144 | } | 212 | } |
213 | |||
214 | // formerly the Web panel -- MC | ||
215 | gSavedSettings.setBOOL("BrowserCookiesEnabled", childGetValue("cookies_enabled")); | ||
216 | |||
217 | bool proxy_enable = childGetValue("web_proxy_enabled"); | ||
218 | std::string proxy_address = childGetValue("web_proxy_editor"); | ||
219 | int proxy_port = childGetValue("web_proxy_port"); | ||
220 | gSavedSettings.setBOOL("BrowserProxyEnabled", proxy_enable); | ||
221 | gSavedSettings.setString("BrowserProxyAddress", proxy_address); | ||
222 | gSavedSettings.setS32("BrowserProxyPort", proxy_port); | ||
223 | LLViewerMedia::setProxyConfig(proxy_enable, proxy_address, proxy_port); | ||
224 | |||
225 | if (gHippoGridManager->getConnectedGrid()->isSecondLife()) | ||
226 | { | ||
227 | gSavedSettings.setString("SearchURLQuery", childGetValue("world_search_editor")); | ||
228 | } | ||
229 | else | ||
230 | { | ||
231 | gSavedSettings.setString("SearchURLQueryOpenSim", childGetValue("world_search_editor")); | ||
232 | } | ||
233 | |||
234 | bool value = childGetValue("use_external_browser").asString() == "external" ? true : false; | ||
235 | gSavedSettings.setBOOL("UseExternalBrowser", value); | ||
236 | |||
237 | viewer_media_t media_source = get_web_media(); | ||
238 | if (media_source && media_source->hasMedia()) | ||
239 | { | ||
240 | media_source->getMediaPlugin()->enable_cookies(childGetValue("cookies_enabled")); | ||
241 | |||
242 | bool proxy_enable = childGetValue("web_proxy_enabled"); | ||
243 | std::string proxy_address = childGetValue("web_proxy_editor"); | ||
244 | int proxy_port = childGetValue("web_proxy_port"); | ||
245 | media_source->getMediaPlugin()->proxy_setup(proxy_enable, proxy_address, proxy_port); | ||
246 | } | ||
145 | } | 247 | } |
146 | 248 | ||
147 | void LLPanelNetwork::cancel() | 249 | void LLPanelNetwork::cancel() |
148 | { | 250 | { |
149 | } | 251 | } |
150 | 252 | ||
253 | void LLPanelNetwork::refresh() | ||
254 | { | ||
255 | if (childGetValue("speed_rez_check").asBoolean()) | ||
256 | { | ||
257 | childEnable("speed_rez_interval_spinner"); | ||
258 | childEnable("speed_rez_seconds_text"); | ||
259 | } | ||
260 | else | ||
261 | { | ||
262 | childDisable("speed_rez_interval_spinner"); | ||
263 | childDisable("speed_rez_seconds_text"); | ||
264 | } | ||
265 | } | ||
266 | |||
151 | // static | 267 | // static |
152 | void LLPanelNetwork::onClickClearCache(void*) | 268 | void LLPanelNetwork::onClickClearDiskCache(void*) |
153 | { | 269 | { |
154 | // flag client cache for clearing next time the client runs | 270 | // flag client cache for clearing next time the client runs |
155 | gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); | 271 | gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); |
@@ -157,7 +273,7 @@ void LLPanelNetwork::onClickClearCache(void*) | |||
157 | } | 273 | } |
158 | 274 | ||
159 | // static | 275 | // static |
160 | void LLPanelNetwork::onClickSetCache(void* user_data) | 276 | void LLPanelNetwork::onClickSetDiskCache(void* user_data) |
161 | { | 277 | { |
162 | LLPanelNetwork* self = (LLPanelNetwork*)user_data; | 278 | LLPanelNetwork* self = (LLPanelNetwork*)user_data; |
163 | 279 | ||
@@ -173,19 +289,19 @@ void LLPanelNetwork::onClickSetCache(void* user_data) | |||
173 | std::string dir_name = picker.getDirName(); | 289 | std::string dir_name = picker.getDirName(); |
174 | if (!dir_name.empty() && dir_name != cur_name) | 290 | if (!dir_name.empty() && dir_name != cur_name) |
175 | { | 291 | { |
176 | self->childSetText("cache_location", dir_name); | 292 | self->childSetText("disk_cache_location", dir_name); |
177 | LLNotifications::instance().add("CacheWillBeMoved"); | 293 | LLNotifications::instance().add("CacheWillBeMoved"); |
178 | gSavedSettings.setString("NewCacheLocation", dir_name); | 294 | gSavedSettings.setString("NewCacheLocation", dir_name); |
179 | } | 295 | } |
180 | else | 296 | else |
181 | { | 297 | { |
182 | std::string cache_location = gDirUtilp->getCacheDir(); | 298 | std::string cache_location = gDirUtilp->getCacheDir(); |
183 | self->childSetText("cache_location", cache_location); | 299 | self->childSetText("disk_cache_location", cache_location); |
184 | } | 300 | } |
185 | } | 301 | } |
186 | 302 | ||
187 | // static | 303 | // static |
188 | void LLPanelNetwork::onClickResetCache(void* user_data) | 304 | void LLPanelNetwork::onClickResetDiskCache(void* user_data) |
189 | { | 305 | { |
190 | LLPanelNetwork* self = (LLPanelNetwork*)user_data; | 306 | LLPanelNetwork* self = (LLPanelNetwork*)user_data; |
191 | if (!gSavedSettings.getString("CacheLocation").empty()) | 307 | if (!gSavedSettings.getString("CacheLocation").empty()) |
@@ -194,7 +310,7 @@ void LLPanelNetwork::onClickResetCache(void* user_data) | |||
194 | LLNotifications::instance().add("CacheWillBeMoved"); | 310 | LLNotifications::instance().add("CacheWillBeMoved"); |
195 | } | 311 | } |
196 | std::string cache_location = gDirUtilp->getCacheDir(true); | 312 | std::string cache_location = gDirUtilp->getCacheDir(true); |
197 | self->childSetText("cache_location", cache_location); | 313 | self->childSetText("disk_cache_location", cache_location); |
198 | } | 314 | } |
199 | 315 | ||
200 | // static | 316 | // static |
@@ -300,3 +416,104 @@ void LLPanelNetwork::updateProxyEnabled(LLPanelNetwork * self, bool enabled, std | |||
300 | self->childSetEnabled("xmlrpc_proxy_port", !enabled); | 416 | self->childSetEnabled("xmlrpc_proxy_port", !enabled); |
301 | self->childSetEnabled("xmlrpc_proxy_text_label", !enabled); | 417 | self->childSetEnabled("xmlrpc_proxy_text_label", !enabled); |
302 | } | 418 | } |
419 | |||
420 | // static | ||
421 | void LLPanelNetwork::onClickClearWebCache(void*) | ||
422 | { | ||
423 | LLNotifications::instance().add("ConfirmClearBrowserCache", LLSD(), LLSD(), callback_clear_browser_cache); | ||
424 | } | ||
425 | |||
426 | //static | ||
427 | bool LLPanelNetwork::callback_clear_browser_cache(const LLSD& notification, const LLSD& response) | ||
428 | { | ||
429 | S32 option = LLNotification::getSelectedOption(notification, response); | ||
430 | if ( option == 0 ) // YES | ||
431 | { | ||
432 | viewer_media_t media_source = get_web_media(); | ||
433 | if (media_source && media_source->hasMedia()) | ||
434 | media_source->getMediaPlugin()->clear_cache(); | ||
435 | } | ||
436 | return false; | ||
437 | } | ||
438 | |||
439 | // static | ||
440 | void LLPanelNetwork::onClickClearCookies(void*) | ||
441 | { | ||
442 | LLNotifications::instance().add("ConfirmClearCookies", LLSD(), LLSD(), callback_clear_cookies); | ||
443 | } | ||
444 | |||
445 | //static | ||
446 | bool LLPanelNetwork::callback_clear_cookies(const LLSD& notification, const LLSD& response) | ||
447 | { | ||
448 | S32 option = LLNotification::getSelectedOption(notification, response); | ||
449 | if ( option == 0 ) // YES | ||
450 | { | ||
451 | viewer_media_t media_source = get_web_media(); | ||
452 | if (media_source && media_source->hasMedia()) | ||
453 | media_source->getMediaPlugin()->clear_cookies(); | ||
454 | } | ||
455 | return false; | ||
456 | } | ||
457 | |||
458 | // static | ||
459 | void LLPanelNetwork::onCommitCookies(LLUICtrl* ctrl, void* data) | ||
460 | { | ||
461 | LLPanelNetwork* self = (LLPanelNetwork*)data; | ||
462 | LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; | ||
463 | |||
464 | if (!self || !check) return; | ||
465 | |||
466 | viewer_media_t media_source = get_web_media(); | ||
467 | if (media_source && media_source->hasMedia()) | ||
468 | media_source->getMediaPlugin()->enable_cookies(check->get()); | ||
469 | } | ||
470 | |||
471 | // static | ||
472 | void LLPanelNetwork::onCommitWebProxyEnabled(LLUICtrl* ctrl, void* data) | ||
473 | { | ||
474 | LLPanelNetwork* self = (LLPanelNetwork*)data; | ||
475 | LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; | ||
476 | |||
477 | if (!self || !check) return; | ||
478 | self->childSetEnabled("web_proxy_editor", check->get()); | ||
479 | self->childSetEnabled("web_proxy_port", check->get()); | ||
480 | self->childSetEnabled("proxy_text_label", check->get()); | ||
481 | } | ||
482 | |||
483 | // static | ||
484 | void LLPanelNetwork::onClickSearchDefault(void* user_data) | ||
485 | { | ||
486 | LLPanelNetwork* self = (LLPanelNetwork*)user_data; | ||
487 | LLControlVariable* controlp = | ||
488 | (gHippoGridManager->getConnectedGrid()->isSecondLife()) | ||
489 | ? | ||
490 | gSavedSettings.getControl("SearchURLQuery") | ||
491 | : | ||
492 | gSavedSettings.getControl("SearchURLQueryOpenSim"); | ||
493 | |||
494 | if (controlp) | ||
495 | { | ||
496 | self->childSetValue("world_search_editor",controlp->getDefault().asString()) ; | ||
497 | } | ||
498 | else | ||
499 | { | ||
500 | llwarns << "SearchURLQuery or SearchURLQueryOpenSim missing from settings.xml - thats bad!" << llendl; | ||
501 | } | ||
502 | } | ||
503 | |||
504 | // static | ||
505 | void LLPanelNetwork::onClickSearchClear(void* user_data) | ||
506 | { | ||
507 | LLPanelNetwork* self = (LLPanelNetwork*)user_data; | ||
508 | self->childSetValue("world_search_editor","") ; | ||
509 | } | ||
510 | |||
511 | //static | ||
512 | void LLPanelNetwork::onCommitSpeedRezCheckBox(LLUICtrl* ctrl, void* user_data) | ||
513 | { | ||
514 | LLPanelNetwork* self = (LLPanelNetwork*)user_data; | ||
515 | if (self) | ||
516 | { | ||
517 | self->refresh(); | ||
518 | } | ||
519 | } | ||