diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llimpanel.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 014c050..25d0b63 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp | |||
@@ -73,6 +73,7 @@ | |||
73 | #include "llhttpclient.h" | 73 | #include "llhttpclient.h" |
74 | #include "llmutelist.h" | 74 | #include "llmutelist.h" |
75 | #include "llstylemap.h" | 75 | #include "llstylemap.h" |
76 | #include <sys/stat.h> | ||
76 | 77 | ||
77 | // | 78 | // |
78 | // Constants | 79 | // Constants |
@@ -1255,6 +1256,10 @@ BOOL LLFloaterIMPanel::postBuild() | |||
1255 | requires<LLLineEditor>("chat_editor"); | 1256 | requires<LLLineEditor>("chat_editor"); |
1256 | requires<LLTextEditor>("im_history"); | 1257 | requires<LLTextEditor>("im_history"); |
1257 | 1258 | ||
1259 | #if LL_LINUX || LL_DARWIN | ||
1260 | childSetVisible("history_btn", false); | ||
1261 | #endif | ||
1262 | |||
1258 | if (checkRequirements()) | 1263 | if (checkRequirements()) |
1259 | { | 1264 | { |
1260 | mInputEditor = getChild<LLLineEditor>("chat_editor"); | 1265 | mInputEditor = getChild<LLLineEditor>("chat_editor"); |
@@ -1269,6 +1274,7 @@ BOOL LLFloaterIMPanel::postBuild() | |||
1269 | 1274 | ||
1270 | childSetAction("profile_callee_btn", onClickProfile, this); | 1275 | childSetAction("profile_callee_btn", onClickProfile, this); |
1271 | childSetAction("group_info_btn", onClickGroupInfo, this); | 1276 | childSetAction("group_info_btn", onClickGroupInfo, this); |
1277 | childSetAction("history_btn", onClickHistory, this); | ||
1272 | 1278 | ||
1273 | childSetAction("start_call_btn", onClickStartCall, this); | 1279 | childSetAction("start_call_btn", onClickStartCall, this); |
1274 | childSetAction("end_call_btn", onClickEndCall, this); | 1280 | childSetAction("end_call_btn", onClickEndCall, this); |
@@ -1800,6 +1806,41 @@ void LLFloaterIMPanel::onClickProfile( void* userdata ) | |||
1800 | } | 1806 | } |
1801 | 1807 | ||
1802 | // static | 1808 | // static |
1809 | void LLFloaterIMPanel::onClickHistory( void* userdata ) | ||
1810 | { | ||
1811 | LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata; | ||
1812 | |||
1813 | if (self->mOtherParticipantUUID.notNull()) | ||
1814 | { | ||
1815 | struct stat fileInfo; | ||
1816 | int result; | ||
1817 | |||
1818 | std::string fullname = self->getTitle();; | ||
1819 | //gCacheName->getFullName(self->mOtherParticipantUUID, fullname); | ||
1820 | //if(fullname == "(Loading...)") | ||
1821 | std::string file_path = gDirUtilp->getPerAccountChatLogsDir() + "\\" + fullname + ".txt"; | ||
1822 | |||
1823 | // check if file exists by trying to get its attributes | ||
1824 | result = stat(file_path.c_str(), &fileInfo); | ||
1825 | if(result == 0) | ||
1826 | { | ||
1827 | char command[256]; | ||
1828 | sprintf(command, "\"%s\\%s.txt\"", gDirUtilp->getPerAccountChatLogsDir().c_str(),fullname.c_str()); | ||
1829 | gViewerWindow->getWindow()->ShellEx(command); | ||
1830 | |||
1831 | llinfos << command << llendl; | ||
1832 | } | ||
1833 | else | ||
1834 | { | ||
1835 | LLStringUtil::format_map_t args; | ||
1836 | args["[NAME]"] = fullname; | ||
1837 | gViewerWindow->alertXml("IMLogNotFound", args); | ||
1838 | llinfos << file_path << llendl; | ||
1839 | } | ||
1840 | } | ||
1841 | } | ||
1842 | |||
1843 | // static | ||
1803 | void LLFloaterIMPanel::onClickGroupInfo( void* userdata ) | 1844 | void LLFloaterIMPanel::onClickGroupInfo( void* userdata ) |
1804 | { | 1845 | { |
1805 | // Bring up the Profile window | 1846 | // Bring up the Profile window |