diff options
author | McCabe Maxsted | 2011-07-01 02:00:58 -0700 |
---|---|---|
committer | McCabe Maxsted | 2011-07-01 02:00:58 -0700 |
commit | 990a821f70ca648bc7d1a58045fdd79f53b61fbd (patch) | |
tree | 0b5b75b60ecf0164f57fa32ad3abf47ec1704f71 /linden/indra/newview | |
parent | Make sure we clear out skin files that could cause bugs when we install over 1.3 (diff) | |
download | meta-impy-990a821f70ca648bc7d1a58045fdd79f53b61fbd.zip meta-impy-990a821f70ca648bc7d1a58045fdd79f53b61fbd.tar.gz meta-impy-990a821f70ca648bc7d1a58045fdd79f53b61fbd.tar.bz2 meta-impy-990a821f70ca648bc7d1a58045fdd79f53b61fbd.tar.xz |
A fix for #995: crashing when changing 'Only my Friends and Groups can see when I am online'
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/llfloaterpreference.cpp | 95 | ||||
-rw-r--r-- | linden/indra/newview/llprefschat.cpp | 25 | ||||
-rw-r--r-- | linden/indra/newview/llprefschat.h | 3 | ||||
-rw-r--r-- | linden/indra/newview/llprefsim.cpp | 70 | ||||
-rw-r--r-- | linden/indra/newview/llprefsim.h | 3 |
5 files changed, 138 insertions, 58 deletions
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp index d518eac..301fba0 100644 --- a/linden/indra/newview/llfloaterpreference.cpp +++ b/linden/indra/newview/llfloaterpreference.cpp | |||
@@ -303,6 +303,24 @@ void LLPreferenceCore::apply() | |||
303 | mLCDPanel->apply(); | 303 | mLCDPanel->apply(); |
304 | } | 304 | } |
305 | #endif | 305 | #endif |
306 | |||
307 | // Sims always wants us to send IMViaEMail and DirectoryVisible in the same msg or we crash, they're evil like that | ||
308 | // We only know both these values after mPrefsChat and mPrefsIM have been applied -- MC | ||
309 | if (mPrefsChat->getUpdateUserInfo() || mPrefsIM->getUpdateUserInfo()) | ||
310 | { | ||
311 | bool new_im_via_email = mPrefsChat->getIMViaEmail(); | ||
312 | std::string directory_visibility = mPrefsIM->getDirectoryVis(); | ||
313 | |||
314 | LLMessageSystem* msg = gMessageSystem; | ||
315 | msg->newMessageFast(_PREHASH_UpdateUserInfo); | ||
316 | msg->nextBlockFast(_PREHASH_AgentData); | ||
317 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
318 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
319 | msg->nextBlockFast(_PREHASH_UserData); | ||
320 | msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email); | ||
321 | msg->addString("DirectoryVisibility", directory_visibility); | ||
322 | gAgent.sendReliableMessage(); | ||
323 | } | ||
306 | } | 324 | } |
307 | 325 | ||
308 | 326 | ||
@@ -469,34 +487,37 @@ bool LLFloaterPreference::callbackReset(const LLSD& notification, const LLSD& re | |||
469 | void LLFloaterPreference::onBtnOK( void* userdata ) | 487 | void LLFloaterPreference::onBtnOK( void* userdata ) |
470 | { | 488 | { |
471 | LLFloaterPreference *fp =(LLFloaterPreference *)userdata; | 489 | LLFloaterPreference *fp =(LLFloaterPreference *)userdata; |
472 | // commit any outstanding text entry | 490 | if (fp) |
473 | if (fp->hasFocus()) | ||
474 | { | 491 | { |
475 | LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); | 492 | // commit any outstanding text entry |
476 | if (cur_focus->acceptsTextInput()) | 493 | if (fp->hasFocus()) |
477 | { | 494 | { |
478 | cur_focus->onCommit(); | 495 | LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); |
496 | if (cur_focus->acceptsTextInput()) | ||
497 | { | ||
498 | cur_focus->onCommit(); | ||
499 | } | ||
479 | } | 500 | } |
480 | } | ||
481 | 501 | ||
482 | if (fp->canClose()) | 502 | if (fp->canClose()) |
483 | { | 503 | { |
484 | fp->apply(); | 504 | fp->apply(); |
485 | fp->close(false); | 505 | fp->close(false); |
486 | 506 | ||
487 | gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); | 507 | gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); |
488 | 508 | ||
489 | std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); | 509 | std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); |
490 | // save all settings, even if equals defaults | 510 | // save all settings, even if equals defaults |
491 | gCrashSettings.saveToFile(crash_settings_filename, FALSE); | 511 | gCrashSettings.saveToFile(crash_settings_filename, FALSE); |
492 | } | 512 | } |
493 | else | 513 | else |
494 | { | 514 | { |
495 | // Show beep, pop up dialog, etc. | 515 | // Show beep, pop up dialog, etc. |
496 | llinfos << "Can't close preferences!" << llendl; | 516 | llinfos << "Can't close preferences!" << llendl; |
497 | } | 517 | } |
498 | 518 | ||
499 | LLPanelLogin::refreshLocation( false ); | 519 | LLPanelLogin::refreshLocation( false ); |
520 | } | ||
500 | } | 521 | } |
501 | 522 | ||
502 | 523 | ||
@@ -504,17 +525,20 @@ void LLFloaterPreference::onBtnOK( void* userdata ) | |||
504 | void LLFloaterPreference::onBtnApply( void* userdata ) | 525 | void LLFloaterPreference::onBtnApply( void* userdata ) |
505 | { | 526 | { |
506 | LLFloaterPreference *fp =(LLFloaterPreference *)userdata; | 527 | LLFloaterPreference *fp =(LLFloaterPreference *)userdata; |
507 | if (fp->hasFocus()) | 528 | if (fp) |
508 | { | 529 | { |
509 | LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); | 530 | if (fp->hasFocus()) |
510 | if (cur_focus->acceptsTextInput()) | ||
511 | { | 531 | { |
512 | cur_focus->onCommit(); | 532 | LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); |
533 | if (cur_focus->acceptsTextInput()) | ||
534 | { | ||
535 | cur_focus->onCommit(); | ||
536 | } | ||
513 | } | 537 | } |
514 | } | 538 | fp->apply(); |
515 | fp->apply(); | ||
516 | 539 | ||
517 | LLPanelLogin::refreshLocation( false ); | 540 | LLPanelLogin::refreshLocation( false ); |
541 | } | ||
518 | } | 542 | } |
519 | 543 | ||
520 | 544 | ||
@@ -530,15 +554,18 @@ void LLFloaterPreference::onClose(bool app_quitting) | |||
530 | void LLFloaterPreference::onBtnCancel( void* userdata ) | 554 | void LLFloaterPreference::onBtnCancel( void* userdata ) |
531 | { | 555 | { |
532 | LLFloaterPreference *fp =(LLFloaterPreference *)userdata; | 556 | LLFloaterPreference *fp =(LLFloaterPreference *)userdata; |
533 | if (fp->hasFocus()) | 557 | if (fp) |
534 | { | 558 | { |
535 | LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); | 559 | if (fp->hasFocus()) |
536 | if (cur_focus->acceptsTextInput()) | ||
537 | { | 560 | { |
538 | cur_focus->onCommit(); | 561 | LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); |
562 | if (cur_focus->acceptsTextInput()) | ||
563 | { | ||
564 | cur_focus->onCommit(); | ||
565 | } | ||
539 | } | 566 | } |
567 | fp->close(); // side effect will also cancel any unsaved changes. | ||
540 | } | 568 | } |
541 | fp->close(); // side effect will also cancel any unsaved changes. | ||
542 | } | 569 | } |
543 | 570 | ||
544 | 571 | ||
diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp index 9490ba2..1cdab46 100644 --- a/linden/indra/newview/llprefschat.cpp +++ b/linden/indra/newview/llprefschat.cpp | |||
@@ -46,7 +46,6 @@ | |||
46 | #include "lggautocorrectfloater.h" | 46 | #include "lggautocorrectfloater.h" |
47 | #include "llprefschat.h" | 47 | #include "llprefschat.h" |
48 | #include "llviewercontrol.h" | 48 | #include "llviewercontrol.h" |
49 | #include "llviewermessage.h" | ||
50 | 49 | ||
51 | class LLPrefsChatImpl : public LLPanel | 50 | class LLPrefsChatImpl : public LLPanel |
52 | { | 51 | { |
@@ -72,8 +71,10 @@ public: | |||
72 | static void onSpellEditCustom(void* data); | 71 | static void onSpellEditCustom(void* data); |
73 | static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata); | 72 | static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata); |
74 | 73 | ||
75 | protected: | 74 | bool mUpdateUserInfo; |
76 | bool mOriginalIMViaEmail; | 75 | bool mOriginalIMViaEmail; |
76 | |||
77 | protected: | ||
77 | bool mGotPersonalInfo; | 78 | bool mGotPersonalInfo; |
78 | 79 | ||
79 | private: | 80 | private: |
@@ -84,7 +85,8 @@ LLPrefsChatImpl::LLPrefsChatImpl() | |||
84 | : LLPanel(std::string("Chat Panel")), | 85 | : LLPanel(std::string("Chat Panel")), |
85 | mChatChannel(false), | 86 | mChatChannel(false), |
86 | mOriginalIMViaEmail(false), | 87 | mOriginalIMViaEmail(false), |
87 | mGotPersonalInfo(false) | 88 | mGotPersonalInfo(false), |
89 | mUpdateUserInfo(false) | ||
88 | { | 90 | { |
89 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_chat.xml"); | 91 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_chat.xml"); |
90 | } | 92 | } |
@@ -230,14 +232,17 @@ void LLPrefsChatImpl::apply() | |||
230 | 232 | ||
231 | if (new_im_via_email != mOriginalIMViaEmail) | 233 | if (new_im_via_email != mOriginalIMViaEmail) |
232 | { | 234 | { |
233 | LLMessageSystem* msg = gMessageSystem; | 235 | mOriginalIMViaEmail = new_im_via_email; |
236 | mUpdateUserInfo = true; | ||
237 | |||
238 | /*LLMessageSystem* msg = gMessageSystem; | ||
234 | msg->newMessageFast(_PREHASH_UpdateUserInfo); | 239 | msg->newMessageFast(_PREHASH_UpdateUserInfo); |
235 | msg->nextBlockFast(_PREHASH_AgentData); | 240 | msg->nextBlockFast(_PREHASH_AgentData); |
236 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | 241 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); |
237 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | 242 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); |
238 | msg->nextBlockFast(_PREHASH_UserData); | 243 | msg->nextBlockFast(_PREHASH_UserData); |
239 | msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email); | 244 | msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email); |
240 | gAgent.sendReliableMessage(); | 245 | gAgent.sendReliableMessage();*/ |
241 | } | 246 | } |
242 | } | 247 | } |
243 | 248 | ||
@@ -379,6 +384,16 @@ void LLPrefsChat::setPersonalInfo(bool im_via_email, const std::string& email) | |||
379 | impl.setPersonalInfo(im_via_email, email); | 384 | impl.setPersonalInfo(im_via_email, email); |
380 | } | 385 | } |
381 | 386 | ||
387 | bool LLPrefsChat::getUpdateUserInfo() | ||
388 | { | ||
389 | return impl.mUpdateUserInfo; | ||
390 | } | ||
391 | |||
392 | bool LLPrefsChat::getIMViaEmail() | ||
393 | { | ||
394 | return impl.mOriginalIMViaEmail; | ||
395 | } | ||
396 | |||
382 | LLPanel* LLPrefsChat::getPanel() | 397 | LLPanel* LLPrefsChat::getPanel() |
383 | { | 398 | { |
384 | return &impl; | 399 | return &impl; |
diff --git a/linden/indra/newview/llprefschat.h b/linden/indra/newview/llprefschat.h index 64bfb36..6c69a2b 100644 --- a/linden/indra/newview/llprefschat.h +++ b/linden/indra/newview/llprefschat.h | |||
@@ -48,6 +48,9 @@ public: | |||
48 | 48 | ||
49 | LLPanel* getPanel(); | 49 | LLPanel* getPanel(); |
50 | 50 | ||
51 | bool getUpdateUserInfo(); | ||
52 | bool getIMViaEmail(); | ||
53 | |||
51 | protected: | 54 | protected: |
52 | LLPrefsChatImpl& impl; | 55 | LLPrefsChatImpl& impl; |
53 | }; | 56 | }; |
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp index 47b5d8b..e037ac7 100644 --- a/linden/indra/newview/llprefsim.cpp +++ b/linden/indra/newview/llprefsim.cpp | |||
@@ -74,13 +74,15 @@ public: | |||
74 | 74 | ||
75 | static void onClickBusyAdvanced(void* user_data); | 75 | static void onClickBusyAdvanced(void* user_data); |
76 | 76 | ||
77 | bool mUpdateUserInfo; | ||
78 | std::string mDirectoryVisibility; | ||
79 | |||
77 | protected: | 80 | protected: |
78 | 81 | ||
79 | bool mGotPersonalInfo; | 82 | bool mGotPersonalInfo; |
80 | bool mGotPerAccountSettings; | 83 | bool mGotPerAccountSettings; |
81 | 84 | ||
82 | bool mOriginalHideOnlineStatus; | 85 | bool mOriginalHideOnlineStatus; |
83 | std::string mDirectoryVisibility; | ||
84 | }; | 86 | }; |
85 | 87 | ||
86 | 88 | ||
@@ -88,7 +90,9 @@ LLPrefsIMImpl::LLPrefsIMImpl() | |||
88 | : LLPanel(std::string("IM Prefs Panel")), | 90 | : LLPanel(std::string("IM Prefs Panel")), |
89 | mGotPersonalInfo(false), | 91 | mGotPersonalInfo(false), |
90 | mGotPerAccountSettings(false), | 92 | mGotPerAccountSettings(false), |
91 | mOriginalHideOnlineStatus(false) | 93 | mOriginalHideOnlineStatus(false), |
94 | mDirectoryVisibility(""), | ||
95 | mUpdateUserInfo(false) | ||
92 | { | 96 | { |
93 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml"); | 97 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml"); |
94 | } | 98 | } |
@@ -178,27 +182,45 @@ void LLPrefsIMImpl::apply() | |||
178 | 182 | ||
179 | if (new_hide_online != mOriginalHideOnlineStatus) | 183 | if (new_hide_online != mOriginalHideOnlineStatus) |
180 | { | 184 | { |
181 | LLMessageSystem* msg = gMessageSystem; | 185 | mOriginalHideOnlineStatus = new_hide_online; |
182 | msg->newMessageFast(_PREHASH_UpdateUserInfo); | 186 | |
183 | msg->nextBlockFast(_PREHASH_AgentData); | ||
184 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
185 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
186 | msg->nextBlockFast(_PREHASH_UserData); | ||
187 | //msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email); | ||
188 | // This hack is because we are representing several different | 187 | // This hack is because we are representing several different |
189 | // possible strings with a single checkbox. Since most users | 188 | // possible strings with a single checkbox. Since most users |
190 | // can only select between 2 values, we represent it as a | 189 | // can only select between 2 values, we represent it as a |
191 | // checkbox. This breaks down a little bit for liaisons, but | 190 | // checkbox. This breaks down a little bit for liaisons, but |
192 | // works out in the end. | 191 | // works out in the end. |
193 | if(new_hide_online != mOriginalHideOnlineStatus) | 192 | if (new_hide_online) |
194 | { | 193 | { |
195 | if(new_hide_online) mDirectoryVisibility = VISIBILITY_HIDDEN; | 194 | mDirectoryVisibility = VISIBILITY_HIDDEN; |
196 | else mDirectoryVisibility = VISIBILITY_DEFAULT; | 195 | } |
197 | //Update showonline value, otherwise multiple applys won't work | 196 | else |
198 | mOriginalHideOnlineStatus = new_hide_online; | 197 | { |
199 | } | 198 | mDirectoryVisibility = VISIBILITY_DEFAULT; |
200 | msg->addString("DirectoryVisibility", mDirectoryVisibility); | 199 | } |
201 | gAgent.sendReliableMessage(); | 200 | |
201 | mUpdateUserInfo = true; | ||
202 | |||
203 | //LLMessageSystem* msg = gMessageSystem; | ||
204 | //msg->newMessageFast(_PREHASH_UpdateUserInfo); | ||
205 | //msg->nextBlockFast(_PREHASH_AgentData); | ||
206 | //msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
207 | //msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
208 | //msg->nextBlockFast(_PREHASH_UserData); | ||
209 | ////msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email); | ||
210 | //// This hack is because we are representing several different | ||
211 | //// possible strings with a single checkbox. Since most users | ||
212 | //// can only select between 2 values, we represent it as a | ||
213 | //// checkbox. This breaks down a little bit for liaisons, but | ||
214 | //// works out in the end. | ||
215 | //if(new_hide_online != mOriginalHideOnlineStatus) | ||
216 | //{ | ||
217 | // if(new_hide_online) mDirectoryVisibility = VISIBILITY_HIDDEN; | ||
218 | // else mDirectoryVisibility = VISIBILITY_DEFAULT; | ||
219 | // //Update showonline value, otherwise multiple applys won't work | ||
220 | // mOriginalHideOnlineStatus = new_hide_online; | ||
221 | //} | ||
222 | //msg->addString("DirectoryVisibility", mDirectoryVisibility); | ||
223 | //gAgent.sendReliableMessage(); | ||
202 | } | 224 | } |
203 | } | 225 | } |
204 | } | 226 | } |
@@ -341,6 +363,16 @@ void LLPrefsIM::preparePerAccountPrefs(bool enable) | |||
341 | impl.preparePerAccountPrefs(enable); | 363 | impl.preparePerAccountPrefs(enable); |
342 | } | 364 | } |
343 | 365 | ||
366 | bool LLPrefsIM::getUpdateUserInfo() | ||
367 | { | ||
368 | return impl.mUpdateUserInfo; | ||
369 | } | ||
370 | |||
371 | std::string LLPrefsIM::getDirectoryVis() | ||
372 | { | ||
373 | return impl.mDirectoryVisibility; | ||
374 | } | ||
375 | |||
344 | LLPanel* LLPrefsIM::getPanel() | 376 | LLPanel* LLPrefsIM::getPanel() |
345 | { | 377 | { |
346 | return &impl; | 378 | return &impl; |
diff --git a/linden/indra/newview/llprefsim.h b/linden/indra/newview/llprefsim.h index 054e4c7..8003ca2 100644 --- a/linden/indra/newview/llprefsim.h +++ b/linden/indra/newview/llprefsim.h | |||
@@ -50,6 +50,9 @@ public: | |||
50 | 50 | ||
51 | LLPanel* getPanel(); | 51 | LLPanel* getPanel(); |
52 | 52 | ||
53 | bool getUpdateUserInfo(); | ||
54 | std::string getDirectoryVis(); | ||
55 | |||
53 | protected: | 56 | protected: |
54 | LLPrefsIMImpl& impl; | 57 | LLPrefsIMImpl& impl; |
55 | }; | 58 | }; |