diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-02-19 16:38:22 -0800 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-02-19 16:38:22 -0800 |
commit | 61c1b2fe2bde94a5f77597725e446a5345219ebe (patch) | |
tree | dc70b8337e0f990f30430784ec13b1e2f39fbcf9 | |
parent | 50d50019d8b8350bc7b04b0b49c6107cde62f4b0 (diff) |
CHUI-778 (Saving preferences updates text in all open message panels in conversation floater to show as old messages) Problem was that closing the preferences floater was always acting as if the conversation transcripts/log files path had changed. If the path did not change then the user's conversations would be cleared and re-loaded as if they were part of the user's history (causing text to be grey). Solution: Now keep track of when the path was changed and only load up the transcripts/log upon change.
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.h | 1 |
2 files changed, 21 insertions, 8 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 3d8d0e15ec..b3e3a0678b 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -647,8 +647,12 @@ void LLFloaterPreference::cancel() pPathfindingConsole->onRegionBoundaryCross(); } - std::string dir_name(gSavedPerAccountSettings.getString("InstantMessageLogPath")); - updateLogLocation(dir_name); + if(mInstantMessageLogPathChanged) + { + std::string dir_name(gSavedPerAccountSettings.getString("InstantMessageLogPath")); + updateLogLocation(dir_name); + mInstantMessageLogPathChanged = false; + } } void LLFloaterPreference::onOpen(const LLSD& key) @@ -1436,19 +1440,27 @@ void LLFloaterPreference::setAllIgnored() void LLFloaterPreference::onClickLogPath() { - std::string proposed_name(gSavedPerAccountSettings.getString("InstantMessageLogPath")); + std::string original_name(gSavedPerAccountSettings.getString("InstantMessageLogPath")); + std::string proposed_name(original_name); + mInstantMessageLogPathChanged = false; LLDirPicker& picker = LLDirPicker::instance(); + //Launches a directory picker and waits for feedback if (!picker.getDir(&proposed_name ) ) { return; //Canceled! } - std::string dir_name = picker.getDirName(); - gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name); - - // enable/disable 'Delete transcripts button - updateDeleteTranscriptsButton(); + //Path changed + if(original_name != proposed_name) + { + std::string dir_name = picker.getDirName(); + gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name); + mInstantMessageLogPathChanged = true; + + // enable/disable 'Delete transcripts button + updateDeleteTranscriptsButton(); + } } void LLFloaterPreference::updateLogLocation(const std::string& dir_name) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index dbd87f74a1..c72346c3b6 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -186,6 +186,7 @@ private: bool mGotPersonalInfo; bool mOriginalIMViaEmail; bool mLanguageChanged; + bool mInstantMessageLogPathChanged; bool mAvatarDataInitialized; bool mOriginalHideOnlineStatus; |