diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index a8d430ca5..5dc3e4324 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -650,13 +650,12 @@ void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) //self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); } +void show_log_browser(const std::string& name = "chat", const std::string& id = "chat"); + // static void LLFloaterChat::onClickChatHistoryOpen(void* userdata) { - std::string command("\"" + LLLogChat::makeLogFileName("chat") + "\""); - gViewerWindow->getWindow()->ShellEx(command); - - llinfos << command << llendl; + show_log_browser(); } //static diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 9925dabc6..a394f8fd7 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -41,6 +41,7 @@ #include "llcombobox.h" #include "llfloaterchat.h" #include "llfloaterinventory.h" +#include "llfloaterwebcontent.h" // For web browser display of logs #include "llgroupactions.h" #include "llhttpclient.h" #include "llimview.h" @@ -1086,17 +1087,24 @@ void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value) } } +void show_log_browser(const std::string& name, const std::string& id) +{ + LLFloaterWebContent::Params p; + p.url("file:///" + LLLogChat::makeLogFileName(name)); + p.id(id); + p.show_chrome(false); + p.trusted_content(true); + LLFloaterWebContent::showInstance("log", p); // If we passed id instead of "log", there would be no control over how many log browsers opened at once. +} + void LLFloaterIMPanel::onClickHistory() { if (mOtherParticipantUUID.notNull()) { // [Ansariel: Display name support] - //std::string command("\"" + LLLogChat::makeLogFileName(getTitle()) + "\""); - std::string command("\"" + LLLogChat::makeLogFileName(mSessionLabel) + "\""); + //show_log_browser(getTitle(), mOtherParticipantUUID.asString()); + show_log_browser(mSessionLabel, mOtherParticipantUUID.asString()); // [/Ansariel: Display name support] - gViewerWindow->getWindow()->ShellEx(command); - - llinfos << command << llendl; } }