diff options
author | Jacek Antonelli | 2008-08-15 23:44:49 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:49 -0500 |
commit | c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd (patch) | |
tree | 49f225d319b111f30f113c4cf7728565afa52132 /linden/indra/newview/llprefsim.cpp | |
parent | Second Life viewer sources 1.13.2.15 (diff) | |
download | meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.zip meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.tar.gz meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.tar.bz2 meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.tar.xz |
Second Life viewer sources 1.13.3.2
Diffstat (limited to 'linden/indra/newview/llprefsim.cpp')
-rw-r--r-- | linden/indra/newview/llprefsim.cpp | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp index 12ca0b1..383fe76 100644 --- a/linden/indra/newview/llprefsim.cpp +++ b/linden/indra/newview/llprefsim.cpp | |||
@@ -34,7 +34,7 @@ | |||
34 | #include "llcheckboxctrl.h" | 34 | #include "llcheckboxctrl.h" |
35 | #include "llstring.h" | 35 | #include "llstring.h" |
36 | #include "lltexteditor.h" | 36 | #include "lltexteditor.h" |
37 | 37 | #include "llavatarconstants.h" | |
38 | #include "llagent.h" | 38 | #include "llagent.h" |
39 | #include "llviewercontrol.h" | 39 | #include "llviewercontrol.h" |
40 | #include "llviewernetwork.h" | 40 | #include "llviewernetwork.h" |
@@ -42,9 +42,6 @@ | |||
42 | 42 | ||
43 | #include "lldirpicker.h" | 43 | #include "lldirpicker.h" |
44 | 44 | ||
45 | static const std::string VISIBILITY_DEFAULT("default"); | ||
46 | static const std::string VISIBILITY_HIDDEN("hidden"); | ||
47 | |||
48 | class LLPrefsIMImpl : public LLPanel | 45 | class LLPrefsIMImpl : public LLPanel |
49 | { | 46 | { |
50 | public: | 47 | public: |
@@ -77,7 +74,7 @@ protected: | |||
77 | bool mOriginalIMViaEmail; | 74 | bool mOriginalIMViaEmail; |
78 | 75 | ||
79 | // online status info | 76 | // online status info |
80 | bool mOriginalShowOnline; | 77 | bool mOriginalHideOnlineStatus; |
81 | std::string mDirectoryVisibility; | 78 | std::string mDirectoryVisibility; |
82 | }; | 79 | }; |
83 | 80 | ||
@@ -112,7 +109,7 @@ void LLPrefsIMImpl::cancel() | |||
112 | 109 | ||
113 | BOOL LLPrefsIMImpl::postBuild() | 110 | BOOL LLPrefsIMImpl::postBuild() |
114 | { | 111 | { |
115 | requires("directory_visibility"); | 112 | requires("online_visibility"); |
116 | requires("send_im_to_email"); | 113 | requires("send_im_to_email"); |
117 | if (!checkRequirements()) | 114 | if (!checkRequirements()) |
118 | { | 115 | { |
@@ -121,11 +118,11 @@ BOOL LLPrefsIMImpl::postBuild() | |||
121 | 118 | ||
122 | mGotPersonalInfo = false; | 119 | mGotPersonalInfo = false; |
123 | mOriginalIMViaEmail = false; | 120 | mOriginalIMViaEmail = false; |
124 | mOriginalShowOnline = false; | 121 | mOriginalHideOnlineStatus = true; |
125 | childSetLabelArg("send_im_to_email", "[EMAIL]", childGetText("log_in_to_change")); | 122 | childSetLabelArg("send_im_to_email", "[EMAIL]", childGetText("log_in_to_change")); |
126 | 123 | ||
127 | // Don't enable this until we get personal data | 124 | // Don't enable this until we get personal data |
128 | childDisable("directory_visibility"); | 125 | childDisable("online_visibility"); |
129 | childDisable("send_im_to_email"); | 126 | childDisable("send_im_to_email"); |
130 | childDisable("log_instant_messages"); | 127 | childDisable("log_instant_messages"); |
131 | childDisable("log_chat"); | 128 | childDisable("log_chat"); |
@@ -189,10 +186,10 @@ void LLPrefsIMImpl::apply() | |||
189 | LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir().c_str()); | 186 | LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir().c_str()); |
190 | 187 | ||
191 | bool new_im_via_email = childGetValue("send_im_to_email").asBoolean(); | 188 | bool new_im_via_email = childGetValue("send_im_to_email").asBoolean(); |
192 | bool new_show_online = childGetValue("directory_visibility").asBoolean(); | 189 | bool new_hide_online = childGetValue("online_visibility").asBoolean(); |
193 | 190 | ||
194 | if((new_im_via_email != mOriginalIMViaEmail) | 191 | if((new_im_via_email != mOriginalIMViaEmail) |
195 | ||(new_show_online != mOriginalShowOnline)) | 192 | ||(new_hide_online != mOriginalHideOnlineStatus)) |
196 | { | 193 | { |
197 | LLMessageSystem* msg = gMessageSystem; | 194 | LLMessageSystem* msg = gMessageSystem; |
198 | msg->newMessageFast(_PREHASH_UpdateUserInfo); | 195 | msg->newMessageFast(_PREHASH_UpdateUserInfo); |
@@ -206,12 +203,12 @@ void LLPrefsIMImpl::apply() | |||
206 | // can only select between 2 values, we represent it as a | 203 | // can only select between 2 values, we represent it as a |
207 | // checkbox. This breaks down a little bit for liaisons, but | 204 | // checkbox. This breaks down a little bit for liaisons, but |
208 | // works out in the end. | 205 | // works out in the end. |
209 | if(new_show_online != mOriginalShowOnline) | 206 | if(new_hide_online != mOriginalHideOnlineStatus) |
210 | { | 207 | { |
211 | if(new_show_online) mDirectoryVisibility = VISIBILITY_DEFAULT; | 208 | if(new_hide_online) mDirectoryVisibility = VISIBILITY_HIDDEN; |
212 | else mDirectoryVisibility = VISIBILITY_HIDDEN; | 209 | else mDirectoryVisibility = VISIBILITY_DEFAULT; |
213 | //Update showonline value, otherwise multiple applys won't work | 210 | //Update showonline value, otherwise multiple applys won't work |
214 | mOriginalShowOnline = new_show_online; | 211 | mOriginalHideOnlineStatus = new_hide_online; |
215 | } | 212 | } |
216 | msg->addString("DirectoryVisibility", mDirectoryVisibility); | 213 | msg->addString("DirectoryVisibility", mDirectoryVisibility); |
217 | gAgent.sendReliableMessage(); | 214 | gAgent.sendReliableMessage(); |
@@ -229,20 +226,20 @@ void LLPrefsIMImpl::setPersonalInfo( | |||
229 | mDirectoryVisibility = visibility; | 226 | mDirectoryVisibility = visibility; |
230 | if(visibility == VISIBILITY_DEFAULT) | 227 | if(visibility == VISIBILITY_DEFAULT) |
231 | { | 228 | { |
232 | mOriginalShowOnline = true; | 229 | mOriginalHideOnlineStatus = false; |
233 | childEnable("directory_visibility"); | 230 | childEnable("online_visibility"); |
234 | } | 231 | } |
235 | else if(visibility == VISIBILITY_HIDDEN) | 232 | else if(visibility == VISIBILITY_HIDDEN) |
236 | { | 233 | { |
237 | mOriginalShowOnline = false; | 234 | mOriginalHideOnlineStatus = true; |
238 | childEnable("directory_visibility"); | 235 | childEnable("online_visibility"); |
239 | } | 236 | } |
240 | else | 237 | else |
241 | { | 238 | { |
242 | mOriginalShowOnline = false; | 239 | mOriginalHideOnlineStatus = true; |
243 | } | 240 | } |
244 | childSetValue("directory_visibility", mOriginalShowOnline); | 241 | childSetValue("online_visibility", mOriginalHideOnlineStatus); |
245 | childSetLabelArg("directory_visibility", "[DIR_VIS]", mDirectoryVisibility); | 242 | childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); |
246 | childEnable("send_im_to_email"); | 243 | childEnable("send_im_to_email"); |
247 | childSetValue("send_im_to_email", im_via_email); | 244 | childSetValue("send_im_to_email", im_via_email); |
248 | childEnable("log_instant_messages"); | 245 | childEnable("log_instant_messages"); |