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 /indra/newview/llfloaterpreference.cpp | |
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.
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 28 |
1 files changed, 20 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) |