aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llprefsim.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2011-05-03 18:09:28 -0700
committerMcCabe Maxsted2011-05-04 15:21:09 -0700
commitcc8e7060dfb54900f1600965a78c6f6f9fc564c4 (patch)
tree9b23e53ace5696db2c78867582308f38cba19d71 /linden/indra/newview/llprefsim.cpp
parentBackported crash fix in llhudeffectlookat from gpl'd viewer 2 (diff)
downloadmeta-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 '')
-rw-r--r--linden/indra/newview/llprefsim.cpp58
1 files changed, 8 insertions, 50 deletions
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp
index 33d9701..47b5d8b 100644
--- a/linden/indra/newview/llprefsim.cpp
+++ b/linden/indra/newview/llprefsim.cpp
@@ -65,7 +65,7 @@ public:
65 65
66 void apply(); 66 void apply();
67 void cancel(); 67 void cancel();
68 void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); 68 void setPersonalInfo(const std::string& visibility);
69 void preparePerAccountPrefs(bool enable); 69 void preparePerAccountPrefs(bool enable);
70 void enableHistory(); 70 void enableHistory();
71 71
@@ -78,7 +78,6 @@ protected:
78 78
79 bool mGotPersonalInfo; 79 bool mGotPersonalInfo;
80 bool mGotPerAccountSettings; 80 bool mGotPerAccountSettings;
81 bool mOriginalIMViaEmail;
82 81
83 bool mOriginalHideOnlineStatus; 82 bool mOriginalHideOnlineStatus;
84 std::string mDirectoryVisibility; 83 std::string mDirectoryVisibility;
@@ -89,7 +88,6 @@ LLPrefsIMImpl::LLPrefsIMImpl()
89 : LLPanel(std::string("IM Prefs Panel")), 88 : LLPanel(std::string("IM Prefs Panel")),
90 mGotPersonalInfo(false), 89 mGotPersonalInfo(false),
91 mGotPerAccountSettings(false), 90 mGotPerAccountSettings(false),
92 mOriginalIMViaEmail(false),
93 mOriginalHideOnlineStatus(false) 91 mOriginalHideOnlineStatus(false)
94{ 92{
95 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml"); 93 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml");
@@ -102,29 +100,14 @@ void LLPrefsIMImpl::cancel()
102BOOL LLPrefsIMImpl::postBuild() 100BOOL LLPrefsIMImpl::postBuild()
103{ 101{
104 requires("online_visibility"); 102 requires("online_visibility");
105 requires("send_im_to_email"); 103
106 if (!checkRequirements()) 104 if (!checkRequirements())
107 { 105 {
108 return FALSE; 106 return FALSE;
109 } 107 }
110 108
111 childSetLabelArg("send_im_to_email", "[EMAIL]", getString("log_in_to_change")); 109 // Don't enable this until we get personal data
112
113 // Don't enable these until we get personal data
114 childSetEnabled("online_visibility", false); 110 childSetEnabled("online_visibility", false);
115 childSetEnabled("send_im_to_email", false);
116
117 // These are safe to enable
118 childSetEnabled("include_im_in_chat_console", true);
119 childSetEnabled("include_im_in_chat_history", true);
120 childSetEnabled("show_timestamps_check", true);
121 childSetEnabled("friends_online_notify_checkbox", true);
122 childSetEnabled("vertical-imtabs-toggle", true);
123 childSetValue("include_im_in_chat_console", gSavedSettings.getBOOL("IMInChatConsole"));
124 childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory"));
125 childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps"));
126 childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification"));
127 childSetValue("vertical-imtabs-toggle", gSavedSettings.getBOOL("VerticalIMTabs"));
128 111
129 childSetAction("log_path_button", onClickLogPath, this); 112 childSetAction("log_path_button", onClickLogPath, this);
130 childSetCommitCallback("log_chat",onCommitLogging,this); 113 childSetCommitCallback("log_chat",onCommitLogging,this);
@@ -191,11 +174,9 @@ void LLPrefsIMImpl::apply()
191 174
192 if (mGotPersonalInfo) 175 if (mGotPersonalInfo)
193 { 176 {
194 bool new_im_via_email = childGetValue("send_im_to_email").asBoolean();
195 bool new_hide_online = childGetValue("online_visibility").asBoolean(); 177 bool new_hide_online = childGetValue("online_visibility").asBoolean();
196 178
197 if((new_im_via_email != mOriginalIMViaEmail) 179 if (new_hide_online != mOriginalHideOnlineStatus)
198 ||(new_hide_online != mOriginalHideOnlineStatus))
199 { 180 {
200 LLMessageSystem* msg = gMessageSystem; 181 LLMessageSystem* msg = gMessageSystem;
201 msg->newMessageFast(_PREHASH_UpdateUserInfo); 182 msg->newMessageFast(_PREHASH_UpdateUserInfo);
@@ -203,7 +184,7 @@ void LLPrefsIMImpl::apply()
203 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 184 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
204 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 185 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
205 msg->nextBlockFast(_PREHASH_UserData); 186 msg->nextBlockFast(_PREHASH_UserData);
206 msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email); 187 //msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email);
207 // This hack is because we are representing several different 188 // This hack is because we are representing several different
208 // possible strings with a single checkbox. Since most users 189 // possible strings with a single checkbox. Since most users
209 // can only select between 2 values, we represent it as a 190 // can only select between 2 values, we represent it as a
@@ -220,19 +201,12 @@ void LLPrefsIMImpl::apply()
220 gAgent.sendReliableMessage(); 201 gAgent.sendReliableMessage();
221 } 202 }
222 } 203 }
223
224 gSavedSettings.setBOOL("VerticalIMTabs", childGetValue("vertical-imtabs-toggle").asBoolean());
225 gSavedSettings.setBOOL("IMInChatConsole", childGetValue("include_im_in_chat_console").asBoolean());
226 gSavedSettings.setBOOL("IMInChatHistory", childGetValue("include_im_in_chat_history").asBoolean());
227 gSavedSettings.setBOOL("IMShowTimestamps", childGetValue("show_timestamps_check").asBoolean());
228 gSavedSettings.setBOOL("ChatOnlineNotification", childGetValue("friends_online_notify_checkbox").asBoolean());
229} 204}
230 205
231// Enable and set the value of settings recieved from the sim in AgentInfoReply 206// Enable and set the value of settings recieved from the sim in AgentInfoReply
232void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) 207void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility)
233{ 208{
234 mGotPersonalInfo = true; 209 mGotPersonalInfo = true;
235 mOriginalIMViaEmail = im_via_email;
236 mDirectoryVisibility = visibility; 210 mDirectoryVisibility = visibility;
237 211
238 if(visibility == VISIBILITY_DEFAULT) 212 if(visibility == VISIBILITY_DEFAULT)
@@ -252,22 +226,6 @@ void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_e
252 226
253 childSetValue("online_visibility", mOriginalHideOnlineStatus); 227 childSetValue("online_visibility", mOriginalHideOnlineStatus);
254 childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); 228 childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility);
255 childEnable("send_im_to_email");
256 childSetValue("send_im_to_email", im_via_email);
257
258 // Truncate the e-mail address if it's too long (to prevent going off
259 // the edge of the dialog).
260 std::string display_email(email);
261 if(display_email.size() > 30)
262 {
263 display_email.resize(30);
264 display_email += "...";
265 }
266 else if (display_email.empty())
267 {
268 display_email = getString("default_email_used");
269 }
270 childSetLabelArg("send_im_to_email", "[EMAIL]", display_email);
271} 229}
272 230
273// Enable and set the value of settings that need an account name 231// Enable and set the value of settings that need an account name
@@ -373,9 +331,9 @@ void LLPrefsIM::cancel()
373 impl.cancel(); 331 impl.cancel();
374} 332}
375 333
376void LLPrefsIM::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) 334void LLPrefsIM::setPersonalInfo(const std::string& visibility)
377{ 335{
378 impl.setPersonalInfo(visibility, im_via_email, email); 336 impl.setPersonalInfo(visibility);
379} 337}
380 338
381void LLPrefsIM::preparePerAccountPrefs(bool enable) 339void LLPrefsIM::preparePerAccountPrefs(bool enable)