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 --- ChangeLog.txt | 11 +++++++ linden/indra/llwindow/llwindow.h | 1 + linden/indra/llwindow/llwindowwin32.cpp | 12 +++++++ linden/indra/llwindow/llwindowwin32.h | 1 + linden/indra/newview/llimpanel.cpp | 37 ++++++++++++++++++++++ linden/indra/newview/llimpanel.h | 1 + .../newview/skins/default/xui/en-us/alerts.xml | 9 ++++++ .../default/xui/en-us/floater_instant_message.xml | 4 ++- 8 files changed, 75 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index fa273d3..14ef3d3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,16 @@ 2009-10-13 McCabe Maxsted + * Applied show IM logs button from Emerald viewer and added an alert if there is no history. + + modified: linden/indra/llwindow/llwindow.h + modified: linden/indra/llwindow/llwindowwin32.cpp + modified: linden/indra/llwindow/llwindowwin32.h + modified: linden/indra/newview/llimpanel.cpp + modified: linden/indra/newview/llimpanel.h + modified: linden/indra/newview/skins/default/xui/en-us/alerts.xml + modified: linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml + + * Updated inventory search to include description (from Emerald). modified: linden/indra/newview/llfolderview.cpp diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h index 0acbcb9..0004e92 100644 --- a/linden/indra/llwindow/llwindow.h +++ b/linden/indra/llwindow/llwindow.h @@ -202,6 +202,7 @@ public: virtual void updateLanguageTextInputArea() {} virtual void interruptLanguageTextInput() {} virtual void spawnWebBrowser(const std::string& escaped_url) {}; + virtual void ShellEx(const std::string& command) {}; static std::string getFontListSans(); diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index 2944511..a9c7758 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp @@ -2885,6 +2885,18 @@ S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 t return retval; } +void LLWindowWin32::ShellEx(const std::string& command ) +{ + LLWString url_wstring = utf8str_to_wstring( command ); + llutf16string url_utf16 = wstring_to_utf16str( url_wstring ); + + SHELLEXECUTEINFO sei = { sizeof( sei ) }; + sei.fMask = SEE_MASK_FLAG_DDEWAIT; + sei.nShow = SW_SHOWNORMAL; + sei.lpVerb = L"open"; + sei.lpFile = url_utf16.c_str(); + ShellExecuteEx( &sei ); +} void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url ) { diff --git a/linden/indra/llwindow/llwindowwin32.h b/linden/indra/llwindow/llwindowwin32.h index 795fc79..bea55c6 100644 --- a/linden/indra/llwindow/llwindowwin32.h +++ b/linden/indra/llwindow/llwindowwin32.h @@ -110,6 +110,7 @@ public: /*virtual*/ void updateLanguageTextInputArea(); /*virtual*/ void interruptLanguageTextInput(); /*virtual*/ void spawnWebBrowser(const std::string& escaped_url); + /*virtual*/ void ShellEx(const std::string& command); static std::string getFontListSans(); 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 diff --git a/linden/indra/newview/llimpanel.h b/linden/indra/newview/llimpanel.h index 0f9c0f3..0699b12 100644 --- a/linden/indra/newview/llimpanel.h +++ b/linden/indra/newview/llimpanel.h @@ -230,6 +230,7 @@ public: static void onTabClick( void* userdata ); static void onClickProfile( void* userdata ); + static void onClickHistory( void* userdata ); static void onClickGroupInfo( void* userdata ); static void onClickOfferTeleport( void* userdata ); static void onClickClose( void* userdata ); diff --git a/linden/indra/newview/skins/default/xui/en-us/alerts.xml b/linden/indra/newview/skins/default/xui/en-us/alerts.xml index edfe62c..24683f0 100644 --- a/linden/indra/newview/skins/default/xui/en-us/alerts.xml +++ b/linden/indra/newview/skins/default/xui/en-us/alerts.xml @@ -5222,6 +5222,15 @@ WARNING: Don't restore if you aren't sure where the object will go! + + + IM history could not be found for [NAME]. + + + + diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml b/linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml index 9a60f57..22e7f1e 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_instant_message.xml @@ -39,9 +39,11 @@