From f716f71a8266788cfcf1d7570a03104d06bcf97e Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 13 Oct 2009 08:02:51 -0700 Subject: Applied show IM logs button from Emerald viewer and added an alert if there is no history --- linden/indra/newview/llimpanel.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'linden/indra/newview/llimpanel.cpp') diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 014c050..625da78 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -73,6 +73,7 @@ #include "llhttpclient.h" #include "llmutelist.h" #include "llstylemap.h" +#include // // Constants @@ -1269,6 +1270,7 @@ BOOL LLFloaterIMPanel::postBuild() childSetAction("profile_callee_btn", onClickProfile, this); childSetAction("group_info_btn", onClickGroupInfo, this); + childSetAction("history_btn", onClickHistory, this); childSetAction("start_call_btn", onClickStartCall, this); childSetAction("end_call_btn", onClickEndCall, this); @@ -1800,6 +1802,41 @@ void LLFloaterIMPanel::onClickProfile( void* userdata ) } // static +void LLFloaterIMPanel::onClickHistory( void* userdata ) +{ + LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata; + + if (self->mOtherParticipantUUID.notNull()) + { + struct stat fileInfo; + int result; + + std::string fullname = self->getTitle();; + //gCacheName->getFullName(self->mOtherParticipantUUID, fullname); + //if(fullname == "(Loading...)") + std::string file_path = gDirUtilp->getPerAccountChatLogsDir() + "\\" + fullname + ".txt"; + + // check if file exists by trying to get its attributes + result = stat(file_path.c_str(), &fileInfo); + if(result == 0) + { + char command[256]; + sprintf(command, "\"%s\\%s.txt\"", gDirUtilp->getPerAccountChatLogsDir().c_str(),fullname.c_str()); + gViewerWindow->getWindow()->ShellEx(command); + + llinfos << command << llendl; + } + else + { + LLStringUtil::format_map_t args; + args["[NAME]"] = fullname; + gViewerWindow->alertXml("IMLogNotFound", args); + llinfos << file_path << llendl; + } + } +} + +// static void LLFloaterIMPanel::onClickGroupInfo( void* userdata ) { // Bring up the Profile window -- cgit v1.1 From adc1da22ce2ad595a19e9d8aea94cb5943f76a6e Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 13 Oct 2009 10:16:26 -0700 Subject: Disable IM history button for Linux and Mac users --- linden/indra/newview/llimpanel.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linden/indra/newview/llimpanel.cpp') diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 625da78..25d0b63 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -1256,6 +1256,10 @@ BOOL LLFloaterIMPanel::postBuild() requires("chat_editor"); requires("im_history"); +#if LL_LINUX || LL_DARWIN + childSetVisible("history_btn", false); +#endif + if (checkRequirements()) { mInputEditor = getChild("chat_editor"); -- cgit v1.1