diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index e8a86a1880..54cebef21d 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -155,6 +155,7 @@ public: virtual void updateLanguageTextInputArea() {} virtual void interruptLanguageTextInput() {} virtual void spawnWebBrowser(const std::string& escaped_url, bool async) {}; + virtual void openFile(const std::string& file_name) {}; static std::vector getDynamicFallbackFontList(); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 68bc8398f8..e58db36be1 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2969,8 +2969,18 @@ S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 t return retval; } - - +void LLWindowWin32::openFile(const std::string& file_name ) +{ + LLWString url_wstring = utf8str_to_wstring( file_name ); + 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, bool async) { bool found = false; diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 387e4cbdb6..ad237b67f5 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -109,6 +109,7 @@ public: /*virtual*/ void updateLanguageTextInputArea(); /*virtual*/ void interruptLanguageTextInput(); /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); + void openFile(const std::string& file_name); LLWindowCallbacks::DragNDropResult completeDragNDropRequest( const LLCoordGL gl_coord, const MASK mask, LLWindowCallbacks::DragNDropAction action, const std::string url ); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 87a980cd76..6c6fe3b3f2 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -310,6 +310,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.BrowseCache", boost::bind(&LLFloaterPreference::onClickBrowseCache, this)); mCommitCallbackRegistrar.add("Pref.BrowseCrashLogs", boost::bind(&LLFloaterPreference::onClickBrowseCrashLogs, this)); mCommitCallbackRegistrar.add("Pref.BrowseSettingsDir", boost::bind(&LLFloaterPreference::onClickBrowseSettingsDir, this)); + mCommitCallbackRegistrar.add("Pref.BrowseLogPath", boost::bind(&LLFloaterPreference::onClickBrowseChatLogDir, this)); mCommitCallbackRegistrar.add("Pref.ResetCache", boost::bind(&LLFloaterPreference::onClickResetCache, this)); mCommitCallbackRegistrar.add("Pref.ClearCache", boost::bind(&LLFloaterPreference::onClickClearCache, this)); // mCommitCallbackRegistrar.add("Pref.ClickSkin", boost::bind(&LLFloaterPreference::onClickSkin, this,_1, _2)); @@ -789,15 +790,19 @@ void LLFloaterPreference::onClickSetCache() } void LLFloaterPreference::onClickBrowseCache() { - //todo: add window open (JL) + gViewerWindow->getWindow()->openFile(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"")); } void LLFloaterPreference::onClickBrowseCrashLogs() { - //todo: add window open (JL) + gViewerWindow->getWindow()->openFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"")); } void LLFloaterPreference::onClickBrowseSettingsDir() { - //todo: add window open (JL) + gViewerWindow->getWindow()->openFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"")); +} +void LLFloaterPreference::onClickBrowseChatLogDir() +{ + gViewerWindow->getWindow()->openFile(gDirUtilp->getExpandedFilename(LL_PATH_CHAT_LOGS,"")); } void LLFloaterPreference::onClickResetCache() { diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 5488ab6909..2fb5351e61 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -118,6 +118,7 @@ public: void onClickSetCache(); void onClickBrowseCache(); void onClickBrowseCrashLogs(); + void onClickBrowseChatLogDir(); void onClickResetCache(); void onClickClearCache(); void onClickBrowseSettingsDir(); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 6adbeeb71a..6912e2482a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -160,7 +160,7 @@ top_pad="5" width="270" />