diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 7bd6ef8cd7bd1620b125a213b4942f65483c4e3e..5f037549abacfb80d68cbf4a4c52766eddf552a8 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 65a18c02e5dcb4b3587565388b386024a88f103a..d5b6eccb294d4a6cbcf146c829f544581bee2164 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -141,6 +141,9 @@ class LLConversationLog : public LLSingleton<LLConversationLog>, LLIMSessionObse 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 @@ class LLConversationLog : public LLSingleton<LLConversationLog>, LLIMSessionObse 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 6dbcb7bef78fca009db9d8feff79bae37b14cc55..96b225b841a01d08f6bc5c0447e2efe41c956fbc 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<LLConversationLogList> 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<LLConversation>& conversations = LLConversationLog::instance().getConversations(); + const std::vector<LLConversation>& conversations = log_instance.getConversations(); std::vector<LLConversation>::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 07723ce44df1dab714c2e5bf17aaf28f482516ad..4c910c56555ffe6535b5cb08add93c64a5ab53ae 100644 --- a/indra/newview/llfloaterconversationlog.cpp +++ b/indra/newview/llfloaterconversationlog.cpp @@ -63,10 +63,6 @@ BOOL LLFloaterConversationLog::postBuild() getChild<LLFilterEditor>("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 aa0f480aae6a45dfed41927a85075c12f67ec7d1..e971330f3d0b6efe54aa49a5cafcbb39c1b618d2 100644 --- a/indra/newview/llfloaterconversationlog.h +++ b/indra/newview/llfloaterconversationlog.h @@ -49,8 +49,6 @@ class LLFloaterConversationLog : public LLFloater 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 256e03c4d7df22dd9b34b4bf974b5e129f81980c..7229292a147931cda361ab390f938ffd96f1aeb3 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"> - <string name="logging_calls_disabled"> - Conversations are not being logged. To log conversations in the future, select "Save IM logs on my computer" under Preferences > Privacy. - </string> <panel follows="left|top|right" height="32" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index d6a2383e52efd21a7a7af960a398048c33c5b595..5aa743b32d22c1769e0eae25f1e30109f12de699 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3908,4 +3908,15 @@ Try enclosing path to the editor with double quotes. <!-- Spell check settings floater --> <string name="UserDictionary">[User]</string> + <!-- Conversation log messages --> + <string name="logging_calls_disabled_log_empty"> + Conversations are not being logged. To begin keeping a log, choose "Save: Log only" or "Save: Log and transcripts" under Preferences > Chat. + </string> + <string name="logging_calls_disabled_log_not_empty"> + No more conversations will be logged. To resume keeping a log, choose "Save: Log only" or "Save: Log and transcripts" under Preferences > Chat. + </string> + <string name="logging_calls_enabled_log_empty"> + There are no logged conversations. After you contact someone, or someone contacts you, a log entry will be shown here. + </string> + </strings>