diff options
author | Paul ProductEngine <pguslisty@productengine.com> | 2012-09-13 16:12:53 +0300 |
---|---|---|
committer | Paul ProductEngine <pguslisty@productengine.com> | 2012-09-13 16:12:53 +0300 |
commit | 8c0fcf0e391ff5db78f95f031562eedec998f164 (patch) | |
tree | fb3a02766a3c474ee75c95428df1e486aa3e564f | |
parent | aa191cb98a80cd637b623f1dfb765374bf98dfa6 (diff) |
CHUI-321 FIXED (Indicate within the Call Log why there's nothing in it)
I. On "LogInstantMessages" variable set to false:
1. save call log to file
2. clear call log
3. show message: "Conversations are not being logged. To log conversations in the future, select "Save IM logs in my computer" under Preferences > Privacy."
On "LogInstantMessages" set to true:
1. clear message
2. reload all saved call log entries
II. Refactored the way LLConversationLog reacts on "LogInstantMessages" value change
-rw-r--r-- | indra/newview/llappviewer.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llconversationlog.cpp | 36 | ||||
-rw-r--r-- | indra/newview/llconversationlog.h | 4 | ||||
-rw-r--r-- | indra/newview/llfloaterconversationlog.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llfloaterconversationlog.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_conversation_log.xml | 5 |
6 files changed, 44 insertions, 21 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4dacde4792..08a1a237f5 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1834,10 +1834,7 @@ bool LLAppViewer::cleanup() LLMuteList::getInstance()->cache(gAgent.getID()); //save call log list - if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) - { - LLConversationLog::instance().cache(); - } + LLConversationLog::instance().cache(); if (mPurgeOnExit) { diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 239a89015f..27be2bc5ae 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -193,37 +193,40 @@ void LLConversationLogFriendObserver::changed(U32 mask) LLConversationLog::LLConversationLog() { - loadFromFile(getFileName()); - LLControlVariable* ctrl = gSavedPerAccountSettings.getControl("LogInstantMessages").get(); if (ctrl) { - ctrl->getSignal()->connect(boost::bind(&LLConversationLog::observeIMSession, this)); - + ctrl->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2)); if (ctrl->getValue().asBoolean()) { - LLIMMgr::instance().addSessionObserver(this); - newMessageSignalConnection = LLIMModel::instance().addNewMsgCallback(boost::bind(&LLConversationLog::onNewMessageReceived, this, _1)); + enableLogging(true); } } - - mFriendObserver = new LLConversationLogFriendObserver; - LLAvatarTracker::instance().addObserver(mFriendObserver); - } -void LLConversationLog::observeIMSession() +void LLConversationLog::enableLogging(bool enable) { - if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) + if (enable) { + loadFromFile(getFileName()); + LLIMMgr::instance().addSessionObserver(this); - LLIMModel::instance().addNewMsgCallback(boost::bind(&LLConversationLog::onNewMessageReceived, this, _1)); + newMessageSignalConnection = LLIMModel::instance().addNewMsgCallback(boost::bind(&LLConversationLog::onNewMessageReceived, this, _1)); + + mFriendObserver = new LLConversationLogFriendObserver; + LLAvatarTracker::instance().addObserver(mFriendObserver); } else { + saveToFile(getFileName()); + LLIMMgr::instance().removeSessionObserver(this); newMessageSignalConnection.disconnect(); + LLAvatarTracker::instance().removeObserver(mFriendObserver); + mConversations.clear(); } + + notifyObservers(); } void LLConversationLog::logConversation(const LLUUID& session_id) @@ -338,7 +341,10 @@ void LLConversationLog::sessionAdded(const LLUUID& session_id, const std::string void LLConversationLog::cache() { - saveToFile(getFileName()); + if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) + { + saveToFile(getFileName()); + } } std::string LLConversationLog::getFileName() @@ -349,7 +355,7 @@ std::string LLConversationLog::getFileName() bool LLConversationLog::saveToFile(const std::string& filename) { - if(!filename.size()) + if (!filename.size()) { llwarns << "Call log list filename is empty!" << llendl; return false; diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index ffd27f7e20..a458e975bb 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -144,6 +144,8 @@ private: LLConversationLog(); + void enableLogging(bool enable); + /** * adds conversation to the conversation list and notifies observers */ @@ -151,8 +153,6 @@ private: void notifyPrticularConversationObservers(const LLUUID& session_id, U32 mask); - void observeIMSession(); - /** * constructs file name in which conversations log will be saved * file name is conversation.log diff --git a/indra/newview/llfloaterconversationlog.cpp b/indra/newview/llfloaterconversationlog.cpp index 7b4c999e52..089aec1905 100644 --- a/indra/newview/llfloaterconversationlog.cpp +++ b/indra/newview/llfloaterconversationlog.cpp @@ -63,6 +63,13 @@ BOOL LLFloaterConversationLog::postBuild() getChild<LLFilterEditor>("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterConversationLog::onFilterEdit, this, _2)); + LLControlVariable* ctrl = gSavedPerAccountSettings.getControl("LogInstantMessages").get(); + if (ctrl) + { + ctrl->getSignal()->connect(boost::bind(&LLFloaterConversationLog::onCallLoggingEnabledDisabled, this, _2)); + onCallLoggingEnabledDisabled(ctrl->getValue().asBoolean()); + } + return LLFloater::postBuild(); } @@ -130,3 +137,9 @@ bool LLFloaterConversationLog::isActionChecked(const LLSD& userdata) return false; } + +void LLFloaterConversationLog::onCallLoggingEnabledDisabled(bool enabled) +{ + std::string no_items_msg = enabled ? "" : getString("logging_calls_disabled"); + mConversationLogList->setNoItemsCommentText(no_items_msg); +} diff --git a/indra/newview/llfloaterconversationlog.h b/indra/newview/llfloaterconversationlog.h index e971330f3d..9e79cbd7d8 100644 --- a/indra/newview/llfloaterconversationlog.h +++ b/indra/newview/llfloaterconversationlog.h @@ -49,6 +49,8 @@ private: bool isActionEnabled(const LLSD& userdata); bool isActionChecked(const LLSD& userdata); + void onCallLoggingEnabledDisabled(bool enabled); + LLConversationLogList* mConversationLogList; }; diff --git a/indra/newview/skins/default/xui/en/floater_conversation_log.xml b/indra/newview/skins/default/xui/en/floater_conversation_log.xml index 9cdeb0d788..df78bbccec 100644 --- a/indra/newview/skins/default/xui/en/floater_conversation_log.xml +++ b/indra/newview/skins/default/xui/en/floater_conversation_log.xml @@ -13,6 +13,11 @@ reuse_instance="true" title="CONVERSATION LOG" width="450"> + + <string name="logging_calls_disabled"> + Conversations are not being logged. To log conversations in the future, select "Save IM logs in my computer" under Preferences > Privacy. + </string> + <panel follows="left|top|right" height="27" |