From 6525ccc384ca8ae6fe4f3fda6b7bb57156691706 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 28 Feb 2013 14:41:08 -0500 Subject: [PATCH] Group Feature Request/Bug Fix: Allow setting a log location for any account before log in The new setting gets overridden by the per account setting, if it has been set, but provides users the ability to set log location pre-login. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llprefsim.cpp | 11 +++++++++-- indra/newview/llstartup.cpp | 3 ++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9c51e8c4f..2fcca4dd5 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -726,6 +726,17 @@ Found in Advanced->Rendering->Info Displays Value 0 + InstantMessageLogPathAnyAccount + + Comment + Path to your log files if you've never set the path while logged in on this account. + Persist + 1 + Type + String + Value + + UseConciseIMButtons Comment diff --git a/indra/newview/llprefsim.cpp b/indra/newview/llprefsim.cpp index ac803a6e7..fd0dc783b 100644 --- a/indra/newview/llprefsim.cpp +++ b/indra/newview/llprefsim.cpp @@ -113,7 +113,7 @@ BOOL LLPrefsIMImpl::postBuild() childDisable("log_instant_messages"); childDisable("log_chat"); childDisable("log_show_history"); - childDisable("log_path_button"); + //childDisable("log_path_button"); childDisable("busy_response"); childDisable("log_instant_messages_timestamp"); childDisable("log_chat_timestamp"); @@ -127,7 +127,8 @@ BOOL LLPrefsIMImpl::postBuild() childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps")); childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification")); - childSetText("log_path_string", gSavedPerAccountSettings.getString("InstantMessageLogPath")); + const std::string log_path = gSavedPerAccountSettings.getString("InstantMessageLogPath"); + childSetText("log_path_string", log_path.empty() ? gSavedSettings.getString("InstantMessageLogPathAnyAccount") : log_path); childSetValue("log_instant_messages", gSavedPerAccountSettings.getBOOL("LogInstantMessages")); childSetValue("log_chat", gSavedPerAccountSettings.getBOOL("LogChat")); childSetValue("log_show_history", gSavedPerAccountSettings.getBOOL("LogShowHistory")); @@ -229,6 +230,12 @@ void LLPrefsIMImpl::apply() gAgent.sendReliableMessage(); } } + else + { + const std::string log_path = childGetText("log_path_string"); + gSavedPerAccountSettings.setString("InstantMessageLogPathAnyAccount", log_path); + gDirUtilp->setChatLogsDir(log_path); + } } void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 59b00dbc7..490298172 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1048,7 +1048,8 @@ bool idle_startup() //Default the path if one isn't set. if (gSavedPerAccountSettings.getString("InstantMessageLogPath").empty()) { - gDirUtilp->setChatLogsDir(gDirUtilp->getOSUserAppDir()); + const std::string dir = gSavedSettings.getString("InstantMessageLogPathAnyAccount"); + gDirUtilp->setChatLogsDir(dir.empty() ? gDirUtilp->getOSUserAppDir() : dir); gSavedPerAccountSettings.setString("InstantMessageLogPath",gDirUtilp->getChatLogsDir()); } else