diff options
Diffstat (limited to 'linden/indra/newview/llprefsim.cpp')
-rw-r--r-- | linden/indra/newview/llprefsim.cpp | 99 |
1 files changed, 34 insertions, 65 deletions
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp index 5333df8..6673a4e 100644 --- a/linden/indra/newview/llprefsim.cpp +++ b/linden/indra/newview/llprefsim.cpp | |||
@@ -55,34 +55,18 @@ public: | |||
55 | /*virtual*/ BOOL postBuild(); | 55 | /*virtual*/ BOOL postBuild(); |
56 | 56 | ||
57 | void apply(); | 57 | void apply(); |
58 | void refresh(); | ||
59 | void cancel(); | 58 | void cancel(); |
60 | void setPersonalInfo( | 59 | void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); |
61 | const std::string& visibility, | ||
62 | bool im_via_email, | ||
63 | const std::string& email); | ||
64 | void enableHistory(); | 60 | void enableHistory(); |
61 | |||
65 | static void onClickLogPath(void* user_data); | 62 | static void onClickLogPath(void* user_data); |
66 | static void onCommitLogging( LLUICtrl* ctrl, void* user_data); | 63 | static void onCommitLogging(LLUICtrl* ctrl, void* user_data); |
67 | 64 | ||
68 | protected: | 65 | protected: |
69 | BOOL mIMInChatHistory; | 66 | |
70 | BOOL mLogInstantMessages; | ||
71 | BOOL mLogChat; | ||
72 | BOOL mLogShowHistory; | ||
73 | BOOL mShowTimestamps; | ||
74 | BOOL mIMLogTimestamp; | ||
75 | BOOL mLogChatTimestamp; | ||
76 | BOOL mLogIMChat; | ||
77 | BOOL mLogTimestampDate; | ||
78 | |||
79 | std::string mIMBusyResponse; | ||
80 | std::string mLogPath; | ||
81 | |||
82 | bool mGotPersonalInfo; | 67 | bool mGotPersonalInfo; |
83 | bool mOriginalIMViaEmail; | 68 | bool mOriginalIMViaEmail; |
84 | 69 | ||
85 | // online status info | ||
86 | bool mOriginalHideOnlineStatus; | 70 | bool mOriginalHideOnlineStatus; |
87 | std::string mDirectoryVisibility; | 71 | std::string mDirectoryVisibility; |
88 | }; | 72 | }; |
@@ -94,34 +78,8 @@ LLPrefsIMImpl::LLPrefsIMImpl() | |||
94 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml"); | 78 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml"); |
95 | } | 79 | } |
96 | 80 | ||
97 | void LLPrefsIMImpl::refresh() | ||
98 | { | ||
99 | mIMInChatHistory = gSavedSettings.getBOOL("IMInChatHistory"); | ||
100 | mShowTimestamps = gSavedSettings.getBOOL("IMShowTimestamps"); | ||
101 | mIMBusyResponse = gSavedPerAccountSettings.getString("BusyModeResponse"); | ||
102 | mLogPath = gSavedPerAccountSettings.getString("InstantMessageLogPath"); | ||
103 | mLogInstantMessages= gSavedPerAccountSettings.getBOOL("LogInstantMessages"); | ||
104 | mLogChat = gSavedPerAccountSettings.getBOOL("LogChat"); | ||
105 | mLogShowHistory = gSavedPerAccountSettings.getBOOL("LogShowHistory"); | ||
106 | mIMLogTimestamp = gSavedPerAccountSettings.getBOOL("IMLogTimestamp"); | ||
107 | mLogChatTimestamp = gSavedPerAccountSettings.getBOOL("LogChatTimestamp"); | ||
108 | mLogIMChat = gSavedPerAccountSettings.getBOOL("LogChatIM"); | ||
109 | mLogTimestampDate = gSavedPerAccountSettings.getBOOL("LogTimestampDate"); | ||
110 | } | ||
111 | |||
112 | void LLPrefsIMImpl::cancel() | 81 | void LLPrefsIMImpl::cancel() |
113 | { | 82 | { |
114 | gSavedSettings.setBOOL("IMInChatHistory", mIMInChatHistory); | ||
115 | gSavedSettings.setBOOL("IMShowTimestamps", mShowTimestamps); | ||
116 | gSavedPerAccountSettings.setString("BusyModeResponse", mIMBusyResponse); | ||
117 | gSavedPerAccountSettings.setString("InstantMessageLogPath",mLogPath); | ||
118 | gSavedPerAccountSettings.setBOOL("LogInstantMessages",mLogInstantMessages); | ||
119 | gSavedPerAccountSettings.setBOOL("LogChat",mLogChat); | ||
120 | gSavedPerAccountSettings.setBOOL("LogShowHistory",mLogShowHistory); | ||
121 | gSavedPerAccountSettings.setBOOL("IMLogTimestamp",mIMLogTimestamp); | ||
122 | gSavedPerAccountSettings.setBOOL("LogChatTimestamp",mLogChatTimestamp); | ||
123 | gSavedPerAccountSettings.setBOOL("LogChatIM",mLogIMChat); | ||
124 | gSavedPerAccountSettings.setBOOL("LogTimestampDate",mLogTimestampDate); | ||
125 | } | 83 | } |
126 | 84 | ||
127 | BOOL LLPrefsIMImpl::postBuild() | 85 | BOOL LLPrefsIMImpl::postBuild() |
@@ -133,12 +91,13 @@ BOOL LLPrefsIMImpl::postBuild() | |||
133 | return FALSE; | 91 | return FALSE; |
134 | } | 92 | } |
135 | 93 | ||
136 | mGotPersonalInfo = false; | ||
137 | mOriginalIMViaEmail = false; | ||
138 | mOriginalHideOnlineStatus = true; | ||
139 | childSetLabelArg("send_im_to_email", "[EMAIL]", getString("log_in_to_change")); | 94 | childSetLabelArg("send_im_to_email", "[EMAIL]", getString("log_in_to_change")); |
140 | 95 | ||
141 | // Don't enable this until we get personal data | 96 | // Don't enable this until we get personal data |
97 | childDisable("include_im_in_chat_history"); | ||
98 | childDisable("show_timestamps_check"); | ||
99 | childDisable("friends_online_notify_checkbox"); | ||
100 | |||
142 | childDisable("online_visibility"); | 101 | childDisable("online_visibility"); |
143 | childDisable("send_im_to_email"); | 102 | childDisable("send_im_to_email"); |
144 | childDisable("log_instant_messages"); | 103 | childDisable("log_instant_messages"); |
@@ -152,17 +111,20 @@ BOOL LLPrefsIMImpl::postBuild() | |||
152 | childDisable("log_date_timestamp"); | 111 | childDisable("log_date_timestamp"); |
153 | 112 | ||
154 | childSetText("busy_response", getString("log_in_to_change")); | 113 | childSetText("busy_response", getString("log_in_to_change")); |
155 | 114 | ||
156 | refresh(); | 115 | childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory")); |
157 | 116 | childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps")); | |
158 | childSetText("log_path_string", mLogPath); | 117 | childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification")); |
159 | childSetValue("log_instant_messages", mLogInstantMessages); | 118 | |
160 | childSetValue("log_chat", mLogChat); | 119 | childSetText("log_path_string", gSavedPerAccountSettings.getString("InstantMessageLogPath")); |
161 | childSetValue("log_show_history", mLogShowHistory); | 120 | childSetValue("log_instant_messages", gSavedPerAccountSettings.getBOOL("LogInstantMessages")); |
162 | childSetValue("log_instant_messages_timestamp", mIMLogTimestamp); | 121 | childSetValue("log_chat", gSavedPerAccountSettings.getBOOL("LogChat")); |
163 | childSetValue("log_chat_timestamp", mLogChatTimestamp); | 122 | childSetValue("log_show_history", gSavedPerAccountSettings.getBOOL("LogShowHistory")); |
164 | childSetValue("log_chat_IM", mLogIMChat); | 123 | childSetValue("log_instant_messages_timestamp", gSavedPerAccountSettings.getBOOL("IMLogTimestamp")); |
165 | childSetValue("log_date_timestamp",mLogTimestampDate); | 124 | childSetValue("log_chat_timestamp", gSavedPerAccountSettings.getBOOL("LogChatTimestamp")); |
125 | childSetValue("log_chat_IM", gSavedPerAccountSettings.getBOOL("LogChatIM")); | ||
126 | childSetValue("log_date_timestamp", gSavedPerAccountSettings.getBOOL("LogTimestampDate")); | ||
127 | |||
166 | childSetAction("log_path_button", onClickLogPath, this); | 128 | childSetAction("log_path_button", onClickLogPath, this); |
167 | childSetCommitCallback("log_chat",onCommitLogging,this); | 129 | childSetCommitCallback("log_chat",onCommitLogging,this); |
168 | childSetCommitCallback("log_instant_messages",onCommitLogging,this); | 130 | childSetCommitCallback("log_instant_messages",onCommitLogging,this); |
@@ -199,6 +161,10 @@ void LLPrefsIMImpl::apply() | |||
199 | 161 | ||
200 | gSavedPerAccountSettings.setString("BusyModeResponse", std::string(wstring_to_utf8str(busy_response))); | 162 | gSavedPerAccountSettings.setString("BusyModeResponse", std::string(wstring_to_utf8str(busy_response))); |
201 | 163 | ||
164 | gSavedSettings.setBOOL("IMInChatHistory", childGetValue("include_im_in_chat_history").asBoolean()); | ||
165 | gSavedSettings.setBOOL("IMShowTimestamps", childGetValue("show_timestamps_check").asBoolean()); | ||
166 | gSavedSettings.setBOOL("ChatOnlineNotification", childGetValue("friends_online_notify_checkbox").asBoolean()); | ||
167 | |||
202 | gSavedPerAccountSettings.setString("InstantMessageLogPath", childGetText("log_path_string")); | 168 | gSavedPerAccountSettings.setString("InstantMessageLogPath", childGetText("log_path_string")); |
203 | gSavedPerAccountSettings.setBOOL("LogInstantMessages",childGetValue("log_instant_messages").asBoolean()); | 169 | gSavedPerAccountSettings.setBOOL("LogInstantMessages",childGetValue("log_instant_messages").asBoolean()); |
204 | gSavedPerAccountSettings.setBOOL("LogChat",childGetValue("log_chat").asBoolean()); | 170 | gSavedPerAccountSettings.setBOOL("LogChat",childGetValue("log_chat").asBoolean()); |
@@ -245,14 +211,12 @@ void LLPrefsIMImpl::apply() | |||
245 | } | 211 | } |
246 | } | 212 | } |
247 | 213 | ||
248 | void LLPrefsIMImpl::setPersonalInfo( | 214 | void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) |
249 | const std::string& visibility, | ||
250 | bool im_via_email, | ||
251 | const std::string& email) | ||
252 | { | 215 | { |
253 | mGotPersonalInfo = true; | 216 | mGotPersonalInfo = true; |
254 | mOriginalIMViaEmail = im_via_email; | 217 | mOriginalIMViaEmail = im_via_email; |
255 | mDirectoryVisibility = visibility; | 218 | mDirectoryVisibility = visibility; |
219 | |||
256 | if(visibility == VISIBILITY_DEFAULT) | 220 | if(visibility == VISIBILITY_DEFAULT) |
257 | { | 221 | { |
258 | mOriginalHideOnlineStatus = false; | 222 | mOriginalHideOnlineStatus = false; |
@@ -267,6 +231,11 @@ void LLPrefsIMImpl::setPersonalInfo( | |||
267 | { | 231 | { |
268 | mOriginalHideOnlineStatus = true; | 232 | mOriginalHideOnlineStatus = true; |
269 | } | 233 | } |
234 | |||
235 | childEnable("include_im_in_chat_history"); | ||
236 | childEnable("show_timestamps_check"); | ||
237 | childEnable("friends_online_notify_checkbox"); | ||
238 | |||
270 | childSetValue("online_visibility", mOriginalHideOnlineStatus); | 239 | childSetValue("online_visibility", mOriginalHideOnlineStatus); |
271 | childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); | 240 | childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); |
272 | childEnable("send_im_to_email"); | 241 | childEnable("send_im_to_email"); |
@@ -308,7 +277,7 @@ void LLPrefsIMImpl::onClickLogPath(void* user_data) | |||
308 | std::string proposed_name(self->childGetText("log_path_string")); | 277 | std::string proposed_name(self->childGetText("log_path_string")); |
309 | 278 | ||
310 | LLDirPicker& picker = LLDirPicker::instance(); | 279 | LLDirPicker& picker = LLDirPicker::instance(); |
311 | if (! picker.getDir(&proposed_name ) ) | 280 | if (!picker.getDir(&proposed_name ) ) |
312 | { | 281 | { |
313 | return; //Canceled! | 282 | return; //Canceled! |
314 | } | 283 | } |