From 3781615afa6db7289f26f404885ac614c7f1cee0 Mon Sep 17 00:00:00 2001 From: mberezhnoy Date: Wed, 6 Feb 2013 10:03:42 +0200 Subject: CHUI-597 (Messages shown in Conversation Log are inaccurate) Added messages, for now they're displayed in two cases: 1) no log entries, logging disabled 2) no log entries, logging enabled Case when there are existing log entries and logging is disabled is still under discussion --- indra/newview/llconversationlog.cpp | 5 +++-- indra/newview/llconversationlog.h | 5 +++++ indra/newview/llconversationloglist.cpp | 24 +++++++++++++++++++++- indra/newview/llfloaterconversationlog.cpp | 9 -------- indra/newview/llfloaterconversationlog.h | 2 -- .../default/xui/en/floater_conversation_log.xml | 3 --- indra/newview/skins/default/xui/en/strings.xml | 11 ++++++++++ 7 files changed, 42 insertions(+), 17 deletions(-) diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 7bd6ef8cd7..5f037549ab 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -187,7 +187,8 @@ void LLConversationLogFriendObserver::changed(U32 mask) /************************************************************************/ LLConversationLog::LLConversationLog() : - mAvatarNameCacheConnection() + mAvatarNameCacheConnection(), + mLoggingEnabled(false) { LLControlVariable * keep_log_ctrlp = gSavedSettings.getControl("KeepConversationLogTranscripts").get(); S32 log_mode = keep_log_ctrlp->getValue(); @@ -202,6 +203,7 @@ LLConversationLog::LLConversationLog() : void LLConversationLog::enableLogging(S32 log_mode) { + mLoggingEnabled = log_mode > 0; if (log_mode > 0) { LLIMMgr::instance().addSessionObserver(this); @@ -217,7 +219,6 @@ void LLConversationLog::enableLogging(S32 log_mode) LLIMMgr::instance().removeSessionObserver(this); mNewMessageSignalConnection.disconnect(); LLAvatarTracker::instance().removeObserver(mFriendObserver); - mConversations.clear(); } notifyObservers(); diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 65a18c02e5..d5b6eccb29 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -141,6 +141,9 @@ public: void onClearLog(); void onClearLogResponse(const LLSD& notification, const LLSD& response); + bool getIsLoggingEnabled() { return mLoggingEnabled; } + bool isLogEmpty() { return mConversations.empty(); } + private: LLConversationLog(); @@ -187,6 +190,8 @@ private: boost::signals2::connection mNewMessageSignalConnection; boost::signals2::connection mAvatarNameCacheConnection; + + bool mLoggingEnabled; }; class LLConversationLogObserver diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index 6dbcb7bef7..96b225b841 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -33,6 +33,7 @@ #include "llconversationloglist.h" #include "llconversationloglistitem.h" #include "llviewermenu.h" +#include "lltrans.h" static LLDefaultChildRegistry::Register r("conversation_log_list"); @@ -200,8 +201,9 @@ void LLConversationLogList::rebuildList() clear(); bool have_filter = !mNameFilter.empty(); + LLConversationLog &log_instance = LLConversationLog::instance(); - const std::vector& conversations = LLConversationLog::instance().getConversations(); + const std::vector& conversations = log_instance.getConversations(); std::vector::const_iterator iter = conversations.begin(); for (; iter != conversations.end(); ++iter) @@ -212,6 +214,26 @@ void LLConversationLogList::rebuildList() addNewItem(&*iter); } + + + bool logging_enabled = log_instance.getIsLoggingEnabled(); + bool log_empty = log_instance.isLogEmpty(); + if (!logging_enabled && log_empty) + { + setNoItemsCommentText(LLTrans::getString("logging_calls_disabled_log_empty")); + } + else if (!logging_enabled && !log_empty) + { + setNoItemsCommentText(LLTrans::getString("logging_calls_disabled_log_not_empty")); + } + else if (logging_enabled && log_empty) + { + setNoItemsCommentText(LLTrans::getString("logging_calls_enabled_log_empty")); + } + else if (logging_enabled && !log_empty) + { + setNoItemsCommentText(""); + } } void LLConversationLogList::onCustomAction(const LLSD& userdata) diff --git a/indra/newview/llfloaterconversationlog.cpp b/indra/newview/llfloaterconversationlog.cpp index 07723ce44d..4c910c5655 100644 --- a/indra/newview/llfloaterconversationlog.cpp +++ b/indra/newview/llfloaterconversationlog.cpp @@ -63,10 +63,6 @@ BOOL LLFloaterConversationLog::postBuild() getChild("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterConversationLog::onFilterEdit, this, _2)); - LLControlVariable * keep_log_ctrlp = gSavedSettings.getControl("KeepConversationLogTranscripts").get(); - keep_log_ctrlp->getSignal()->connect(boost::bind(&LLFloaterConversationLog::onCallLoggingEnabledDisabled, this, _2)); - onCallLoggingEnabledDisabled(keep_log_ctrlp->getValue()); - return LLFloater::postBuild(); } @@ -136,8 +132,3 @@ bool LLFloaterConversationLog::isActionChecked(const LLSD& userdata) return false; } -void LLFloaterConversationLog::onCallLoggingEnabledDisabled(S32 log_mode) -{ - std::string no_items_msg = log_mode > 0 ? "" : getString("logging_calls_disabled"); - mConversationLogList->setNoItemsCommentText(no_items_msg); -} diff --git a/indra/newview/llfloaterconversationlog.h b/indra/newview/llfloaterconversationlog.h index aa0f480aae..e971330f3d 100644 --- a/indra/newview/llfloaterconversationlog.h +++ b/indra/newview/llfloaterconversationlog.h @@ -49,8 +49,6 @@ private: bool isActionEnabled(const LLSD& userdata); bool isActionChecked(const LLSD& userdata); - void onCallLoggingEnabledDisabled(S32 log_mode); - 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 256e03c4d7..7229292a14 100644 --- a/indra/newview/skins/default/xui/en/floater_conversation_log.xml +++ b/indra/newview/skins/default/xui/en/floater_conversation_log.xml @@ -13,9 +13,6 @@ reuse_instance="true" title="CONVERSATION LOG" width="300"> - - Conversations are not being logged. To log conversations in the future, select "Save IM logs on my computer" under Preferences > Privacy. - [User] + + + Conversations are not being logged. To begin keeping a log, choose "Save: Log only" or "Save: Log and transcripts" under Preferences > Chat. + + + No more conversations will be logged. To resume keeping a log, choose "Save: Log only" or "Save: Log and transcripts" under Preferences > Chat. + + + There are no logged conversations. After you contact someone, or someone contacts you, a log entry will be shown here. + + -- cgit v1.2.3