aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llprefsim.cpp
diff options
context:
space:
mode:
authorDavid Seikel2011-06-04 00:17:28 +1000
committerDavid Seikel2011-06-04 00:17:28 +1000
commit492eaaf4eec82327116f2605e3d8becf94bec1b3 (patch)
treedcddd674cb4861445c3ec5aaa59325b99a437614 /linden/indra/newview/llprefsim.cpp
parentSet the real bare minimum prim size to 0.00001, as 0 sized objects cause bugs. (diff)
parentFixing the menu to actually use its color options reveals how broken the whol... (diff)
downloadmeta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.zip
meta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.tar.gz
meta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.tar.bz2
meta-impy-492eaaf4eec82327116f2605e3d8becf94bec1b3.tar.xz
Merge branch 'next' of git://github.com/jacek/imprudence into next
Conflicts (manually merged): linden/indra/llcommon/llversionviewer.h linden/indra/llvfs/lldir.cpp linden/indra/llvfs/lldir_mac.cpp linden/indra/newview/CMakeLists.txt linden/indra/newview/English.lproj/InfoPlist.strings linden/indra/newview/Info-Imprudence.plist linden/indra/newview/Info-meta-impy.plist linden/indra/newview/llappviewer.cpp linden/indra/newview/llpanellogin.cpp linden/indra/newview/packaging/mac/Info.plist.in linden/indra/newview/res/viewerRes.rc linden/indra/newview/skins/default/xui/en-us/floater_about.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_graphics1.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_skins.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_web.xml linden/indra/newview/skins/default/xui/zh/menu_viewer.xml linden/indra/newview/skins/default/xui/zh/panel_group_general.xml linden/indra/newview/viewer_manifest.py linden/indra/newview/viewerversion.cpp linden/indra/newview/viewerversion.h linden/install.xml Also some post merge tweaks.
Diffstat (limited to 'linden/indra/newview/llprefsim.cpp')
-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 ddf027f..53be673 100644
--- a/linden/indra/newview/llprefsim.cpp
+++ b/linden/indra/newview/llprefsim.cpp
@@ -66,7 +66,7 @@ public:
66 66
67 void apply(); 67 void apply();
68 void cancel(); 68 void cancel();
69 void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); 69 void setPersonalInfo(const std::string& visibility);
70 void preparePerAccountPrefs(bool enable); 70 void preparePerAccountPrefs(bool enable);
71 void enableHistory(); 71 void enableHistory();
72 72
@@ -80,7 +80,6 @@ protected:
80 80
81 bool mGotPersonalInfo; 81 bool mGotPersonalInfo;
82 bool mGotPerAccountSettings; 82 bool mGotPerAccountSettings;
83 bool mOriginalIMViaEmail;
84 83
85 bool mOriginalHideOnlineStatus; 84 bool mOriginalHideOnlineStatus;
86 std::string mDirectoryVisibility; 85 std::string mDirectoryVisibility;
@@ -91,7 +90,6 @@ LLPrefsIMImpl::LLPrefsIMImpl()
91 : LLPanel(std::string("IM Prefs Panel")), 90 : LLPanel(std::string("IM Prefs Panel")),
92 mGotPersonalInfo(false), 91 mGotPersonalInfo(false),
93 mGotPerAccountSettings(false), 92 mGotPerAccountSettings(false),
94 mOriginalIMViaEmail(false),
95 mOriginalHideOnlineStatus(false) 93 mOriginalHideOnlineStatus(false)
96{ 94{
97 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml"); 95 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml");
@@ -104,29 +102,14 @@ void LLPrefsIMImpl::cancel()
104BOOL LLPrefsIMImpl::postBuild() 102BOOL LLPrefsIMImpl::postBuild()
105{ 103{
106 requires("online_visibility"); 104 requires("online_visibility");
107 requires("send_im_to_email"); 105
108 if (!checkRequirements()) 106 if (!checkRequirements())
109 { 107 {
110 return FALSE; 108 return FALSE;
111 } 109 }
112 110
113 childSetLabelArg("send_im_to_email", "[EMAIL]", getString("log_in_to_change")); 111 // Don't enable this until we get personal data
114
115 // Don't enable these until we get personal data
116 childSetEnabled("online_visibility", false); 112 childSetEnabled("online_visibility", false);
117 childSetEnabled("send_im_to_email", false);
118
119 // These are safe to enable
120 childSetEnabled("include_im_in_chat_console", true);
121 childSetEnabled("include_im_in_chat_history", true);
122 childSetEnabled("show_timestamps_check", true);
123 childSetEnabled("friends_online_notify_checkbox", true);
124 childSetEnabled("vertical-imtabs-toggle", true);
125 childSetValue("include_im_in_chat_console", gSavedSettings.getBOOL("IMInChatConsole"));
126 childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory"));
127 childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps"));
128 childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification"));
129 childSetValue("vertical-imtabs-toggle", gSavedSettings.getBOOL("VerticalIMTabs"));
130 113
131 childSetAction("log_path_button", onClickLogPath, this); 114 childSetAction("log_path_button", onClickLogPath, this);
132 childSetCommitCallback("log_chat",onCommitLogging,this); 115 childSetCommitCallback("log_chat",onCommitLogging,this);
@@ -194,11 +177,9 @@ void LLPrefsIMImpl::apply()
194 177
195 if (mGotPersonalInfo) 178 if (mGotPersonalInfo)
196 { 179 {
197 bool new_im_via_email = childGetValue("send_im_to_email").asBoolean();
198 bool new_hide_online = childGetValue("online_visibility").asBoolean(); 180 bool new_hide_online = childGetValue("online_visibility").asBoolean();
199 181
200 if((new_im_via_email != mOriginalIMViaEmail) 182 if (new_hide_online != mOriginalHideOnlineStatus)
201 ||(new_hide_online != mOriginalHideOnlineStatus))
202 { 183 {
203 LLMessageSystem* msg = gMessageSystem; 184 LLMessageSystem* msg = gMessageSystem;
204 msg->newMessageFast(_PREHASH_UpdateUserInfo); 185 msg->newMessageFast(_PREHASH_UpdateUserInfo);
@@ -206,7 +187,7 @@ void LLPrefsIMImpl::apply()
206 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 187 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
207 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 188 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
208 msg->nextBlockFast(_PREHASH_UserData); 189 msg->nextBlockFast(_PREHASH_UserData);
209 msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email); 190 //msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email);
210 // This hack is because we are representing several different 191 // This hack is because we are representing several different
211 // possible strings with a single checkbox. Since most users 192 // possible strings with a single checkbox. Since most users
212 // can only select between 2 values, we represent it as a 193 // can only select between 2 values, we represent it as a
@@ -223,19 +204,12 @@ void LLPrefsIMImpl::apply()
223 gAgent.sendReliableMessage(); 204 gAgent.sendReliableMessage();
224 } 205 }
225 } 206 }
226
227 gSavedSettings.setBOOL("VerticalIMTabs", childGetValue("vertical-imtabs-toggle").asBoolean());
228 gSavedSettings.setBOOL("IMInChatConsole", childGetValue("include_im_in_chat_console").asBoolean());
229 gSavedSettings.setBOOL("IMInChatHistory", childGetValue("include_im_in_chat_history").asBoolean());
230 gSavedSettings.setBOOL("IMShowTimestamps", childGetValue("show_timestamps_check").asBoolean());
231 gSavedSettings.setBOOL("ChatOnlineNotification", childGetValue("friends_online_notify_checkbox").asBoolean());
232} 207}
233 208
234// Enable and set the value of settings recieved from the sim in AgentInfoReply 209// Enable and set the value of settings recieved from the sim in AgentInfoReply
235void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) 210void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility)
236{ 211{
237 mGotPersonalInfo = true; 212 mGotPersonalInfo = true;
238 mOriginalIMViaEmail = im_via_email;
239 mDirectoryVisibility = visibility; 213 mDirectoryVisibility = visibility;
240 214
241 if(visibility == VISIBILITY_DEFAULT) 215 if(visibility == VISIBILITY_DEFAULT)
@@ -255,22 +229,6 @@ void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_e
255 229
256 childSetValue("online_visibility", mOriginalHideOnlineStatus); 230 childSetValue("online_visibility", mOriginalHideOnlineStatus);
257 childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); 231 childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility);
258 childEnable("send_im_to_email");
259 childSetValue("send_im_to_email", im_via_email);
260
261 // Truncate the e-mail address if it's too long (to prevent going off
262 // the edge of the dialog).
263 std::string display_email(email);
264 if(display_email.size() > 30)
265 {
266 display_email.resize(30);
267 display_email += "...";
268 }
269 else if (display_email.empty())
270 {
271 display_email = getString("default_email_used");
272 }
273 childSetLabelArg("send_im_to_email", "[EMAIL]", display_email);
274} 232}
275 233
276// Enable and set the value of settings that need an account name 234// Enable and set the value of settings that need an account name
@@ -383,9 +341,9 @@ void LLPrefsIM::cancel()
383 impl.cancel(); 341 impl.cancel();
384} 342}
385 343
386void LLPrefsIM::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) 344void LLPrefsIM::setPersonalInfo(const std::string& visibility)
387{ 345{
388 impl.setPersonalInfo(visibility, im_via_email, email); 346 impl.setPersonalInfo(visibility);
389} 347}
390 348
391void LLPrefsIM::preparePerAccountPrefs(bool enable) 349void LLPrefsIM::preparePerAccountPrefs(bool enable)