diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llpanelnetwork.cpp | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/llpanelnetwork.cpp')
-rw-r--r-- | linden/indra/newview/llpanelnetwork.cpp | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelnetwork.cpp b/linden/indra/newview/llpanelnetwork.cpp new file mode 100644 index 0000000..c55dacb --- /dev/null +++ b/linden/indra/newview/llpanelnetwork.cpp | |||
@@ -0,0 +1,118 @@ | |||
1 | /** | ||
2 | * @file llpanelnetwork.cpp | ||
3 | * @brief Network preferences panel | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #include "llviewerprecompiledheaders.h" | ||
29 | |||
30 | // file include | ||
31 | #include "llpanelnetwork.h" | ||
32 | |||
33 | // linden library includes | ||
34 | #include "llerror.h" | ||
35 | #include "llrect.h" | ||
36 | #include "llstring.h" | ||
37 | |||
38 | // project includes | ||
39 | #include "llbutton.h" | ||
40 | #include "llui.h" | ||
41 | #include "lluictrlfactory.h" | ||
42 | #include "llresmgr.h" | ||
43 | #include "llsliderctrl.h" | ||
44 | #include "lltextbox.h" | ||
45 | #include "llviewerregion.h" | ||
46 | #include "llviewerthrottle.h" | ||
47 | #include "llworld.h" | ||
48 | #include "llviewercontrol.h" | ||
49 | #include "llvieweruictrlfactory.h" | ||
50 | #include "llmozlib.h" | ||
51 | #include "llviewerwindow.h" | ||
52 | |||
53 | |||
54 | LLPanelNetwork::LLPanelNetwork() | ||
55 | { | ||
56 | gUICtrlFactory->buildPanel(this, "panel_preferences_network.xml"); | ||
57 | } | ||
58 | |||
59 | BOOL LLPanelNetwork::postBuild() | ||
60 | { | ||
61 | requires("disk cache", WIDGET_TYPE_RADIO_GROUP); | ||
62 | requires("max_bandwidth", WIDGET_TYPE_SLIDER); | ||
63 | requires("clear_cache", WIDGET_TYPE_BUTTON); | ||
64 | |||
65 | if (!checkRequirements()) | ||
66 | { | ||
67 | return FALSE; | ||
68 | } | ||
69 | |||
70 | // retrieve controls | ||
71 | mDiskCacheRadio = LLUICtrlFactory::getRadioGroupByName(this, "disk cache"); | ||
72 | mCtrlBandwidth = LLUICtrlFactory::getSliderByName(this, "max_bandwidth"); | ||
73 | |||
74 | mClearCacheBtn = LLUICtrlFactory::getButtonByName(this, "clear_cache"); | ||
75 | mClearCacheBtn->setClickedCallback(onClickClearCache); | ||
76 | mClearCacheBtn->setCallbackUserData(this); | ||
77 | |||
78 | refresh(); | ||
79 | |||
80 | return TRUE; | ||
81 | } | ||
82 | |||
83 | LLPanelNetwork::~LLPanelNetwork() | ||
84 | { | ||
85 | // Children all cleaned up by default view destructor. | ||
86 | } | ||
87 | |||
88 | |||
89 | void LLPanelNetwork::apply() | ||
90 | { | ||
91 | } | ||
92 | |||
93 | void LLPanelNetwork::refresh() | ||
94 | { | ||
95 | LLPanel::refresh(); | ||
96 | |||
97 | mCacheSetting = gSavedSettings.getU32("VFSSize"); | ||
98 | mBandwidthBPS = gSavedSettings.getF32("ThrottleBandwidthKBPS")*1024; | ||
99 | } | ||
100 | |||
101 | void LLPanelNetwork::cancel() | ||
102 | { | ||
103 | gSavedSettings.setU32("VFSSize", mCacheSetting); | ||
104 | gSavedSettings.setF32("ThrottleBandwidthKBPS", mBandwidthBPS/1024); | ||
105 | } | ||
106 | |||
107 | // static | ||
108 | void LLPanelNetwork::onClickClearCache(void*) | ||
109 | { | ||
110 | #if LL_LIBXUL_ENABLED | ||
111 | // clear Mozilla cache | ||
112 | LLMozLib::getInstance()->clearCache(); | ||
113 | #endif // LL_LIBXUL_ENABLED | ||
114 | |||
115 | // flag client cache for clearing next time the client runs | ||
116 | gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); | ||
117 | gViewerWindow->alertXml("CacheWillClear"); | ||
118 | } | ||