diff options
-rw-r--r-- | indra/llcommon/llapp.cpp | 72 | ||||
-rw-r--r-- | indra/llcommon/llapp.h | 16 | ||||
-rw-r--r-- | indra/newview/llappviewerwin32.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloateravatarpicker.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_avatar_picker.xml | 4 | ||||
-rw-r--r-- | indra/win_crash_logger/llcrashloggerwindows.cpp | 2 | ||||
-rw-r--r-- | indra/win_crash_logger/win_crash_logger.cpp | 11 |
9 files changed, 122 insertions, 21 deletions
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 2c76f29020..6cc9e804d4 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -256,6 +256,70 @@ bool LLApp::parseCommandOptions(int argc, char** argv) return true; } +bool LLApp::parseCommandOptions(int argc, wchar_t** wargv) +{ + LLSD commands; + std::string name; + std::string value; + for(int ii = 1; ii < argc; ++ii) + { + if(wargv[ii][0] != '-') + { + LL_INFOS() << "Did not find option identifier while parsing token: " + << wargv[ii] << LL_ENDL; + return false; + } + int offset = 1; + if(wargv[ii][1] == '-') ++offset; + +#if LL_WINDOWS + name.assign(utf16str_to_utf8str(&wargv[ii][offset])); +#else + name.assign(wstring_to_utf8str(&wargv[ii][offset])); +#endif + if(((ii+1) >= argc) || (wargv[ii+1][0] == '-')) + { + // we found another option after this one or we have + // reached the end. simply record that this option was + // found and continue. + int flag = name.compare("logfile"); + if (0 == flag) + { + commands[name] = "log"; + } + else + { + commands[name] = true; + } + + continue; + } + ++ii; + +#if LL_WINDOWS + value.assign(utf16str_to_utf8str((wargv[ii]))); +#else + value.assign(wstring_to_utf8str((wargv[ii]))); +#endif + +#if LL_WINDOWS + //Windows changed command line parsing. Deal with it. + S32 slen = value.length() - 1; + S32 start = 0; + S32 end = slen; + if (wargv[ii][start]=='"')start++; + if (wargv[ii][end]=='"')end--; + if (start!=0 || end!=slen) + { + value = value.substr (start,end); + } +#endif + + commands[name] = value; + } + setOptionData(PRIORITY_COMMAND_LINE, commands); + return true; +} void LLApp::manageLiveFile(LLLiveFile* livefile) { @@ -354,7 +418,7 @@ void LLApp::setupErrorHandling(bool second_instance) std::wstring wpipe_name; wpipe_name = mCrashReportPipeStr + wstringize(getPid()); - const std::wstring wdump_path(wstringize(mDumpPath)); + const std::wstring wdump_path(utf8str_to_utf16str(mDumpPath)); int retries = 30; for (; retries > 0; --retries) @@ -515,9 +579,9 @@ void LLApp::setMiniDumpDir(const std::string &path) if(mExceptionHandler == 0) return; #ifdef LL_WINDOWS - wchar_t buffer[MAX_MINDUMP_PATH_LENGTH]; - mbstowcs(buffer, mDumpPath.c_str(), MAX_MINDUMP_PATH_LENGTH); - mExceptionHandler->set_dump_path(std::wstring(buffer)); + std::wstring buffer(utf8str_to_utf16str(mDumpPath)); + if (buffer.size() > MAX_MINDUMP_PATH_LENGTH) buffer.resize(MAX_MINDUMP_PATH_LENGTH); + mExceptionHandler->set_dump_path(buffer); #elif LL_LINUX //google_breakpad::MinidumpDescriptor desc("/tmp"); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched. google_breakpad::MinidumpDescriptor desc(mDumpPath); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched. diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index ff9a92b45f..acd829d864 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -106,7 +106,7 @@ public: LLSD getOption(const std::string& name) const; /** - * @brief Parse command line options and insert them into + * @brief Parse ASCII command line options and insert them into * application command line options. * * The name inserted into the option will have leading option @@ -119,6 +119,20 @@ public: */ bool parseCommandOptions(int argc, char** argv); + /** + * @brief Parse Unicode command line options and insert them into + * application command line options. + * + * The name inserted into the option will have leading option + * identifiers (a minus or double minus) stripped. All options + * with values will be stored as a string, while all options + * without values will be stored as true. + * @param argc The argc passed into main(). + * @param wargv The wargv passed into main(). + * @return Returns true if the parse succeeded. + */ + bool parseCommandOptions(int argc, wchar_t** wargv); + /** * @brief Keep track of live files automatically. * diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 4268ecd91e..284a39301b 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -697,7 +697,7 @@ void LLAppViewerWin32::initCrashReporting(bool reportFreeze) exe_wstr = utf8str_to_utf16str(exe_path); std::wstring arg_wstr; - arg_wstr=wstringize(arg_str); + arg_wstr = utf8str_to_utf16str(arg_str); LL_INFOS("CrashReport") << "Creating crash reporter process " << exe_path << " with params: " << arg_str << LL_ENDL; if(CreateProcess(exe_wstr.c_str(), diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index c394eb815b..c5561fe011 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -496,6 +496,18 @@ void LLFloaterAvatarPicker::find() std::string text = getChild<LLUICtrl>("Edit")->getValue().asString(); + size_t separator_index = text.find_first_of(" ._"); + if (separator_index != text.npos) + { + std::string first = text.substr(0, separator_index); + std::string last = text.substr(separator_index+1, text.npos); + LLStringUtil::trim(last); + if("Resident" == last) + { + text = first; + } + } + mQueryID.generate(); std::string url; @@ -739,12 +751,13 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& if (search_results->isEmpty()) { - LLStringUtil::format_map_t map; - map["[TEXT]"] = getChild<LLUICtrl>("Edit")->getValue().asString(); + std::string name = "'" + getChild<LLUICtrl>("Edit")->getValue().asString() + "'"; LLSD item; item["id"] = LLUUID::null; item["columns"][0]["column"] = "name"; - item["columns"][0]["value"] = getString("not_found", map); + item["columns"][0]["value"] = name; + item["columns"][1]["column"] = "username"; + item["columns"][1]["value"] = getString("not_found_text"); search_results->addElement(item); search_results->setEnabled(false); getChildView("ok_btn")->setEnabled(false); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b0f91435a0..efcdb07176 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5260,13 +5260,13 @@ void LLVOAvatar::resetAnimations() // Override selectively based on avatar sex and whether we're using new // animations. -LLUUID LLVOAvatar::remapMotionID(const LLUUID& id, ESex gender) +LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) { BOOL use_new_walk_run = gSavedSettings.getBOOL("UseNewWalkRun"); LLUUID result = id; // start special case female walk for female avatars - if (gender == SEX_FEMALE) + if (getSex() == SEX_FEMALE) { if (id == ANIM_AGENT_WALK) { @@ -5312,7 +5312,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) { LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; - LLUUID remap_id = remapMotionID(id, getSex()); + LLUUID remap_id = remapMotionID(id); if (remap_id != id) { @@ -5334,13 +5334,8 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) { LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; - LLUUID remap_id = remapMotionID(id, getSex()); - if (findMotion(remap_id) == NULL) - { - //possibility of encountering animation from the previous gender - remap_id = remapMotionID(id, (getSex() == SEX_MALE) ? SEX_FEMALE : SEX_MALE); - } - + LLUUID remap_id = remapMotionID(id); + if (remap_id != id) { LL_DEBUGS() << "motion resultant " << remap_id.asString() << " " << gAnimLibrary.animationName(remap_id) << LL_ENDL; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 253d9c24f3..bd89d4ef23 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -188,7 +188,7 @@ public: /*virtual*/ LLVector3 getCharacterVelocity(); /*virtual*/ LLVector3 getCharacterAngularVelocity(); - /*virtual*/ LLUUID remapMotionID(const LLUUID& id, ESex gender); + /*virtual*/ LLUUID remapMotionID(const LLUUID& id); /*virtual*/ BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f); /*virtual*/ BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE); virtual bool hasMotionFromSource(const LLUUID& source_id); diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index 1a55dc2e2c..dddb258ed9 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -16,6 +16,10 @@ '[TEXT]' not found </floater.string> <floater.string + name="not_found_text"> + Resident wasn't found. + </floater.string> + <floater.string name="no_one_near"> No one near </floater.string> diff --git a/indra/win_crash_logger/llcrashloggerwindows.cpp b/indra/win_crash_logger/llcrashloggerwindows.cpp index 167acf6ac7..267224a79b 100644 --- a/indra/win_crash_logger/llcrashloggerwindows.cpp +++ b/indra/win_crash_logger/llcrashloggerwindows.cpp @@ -377,7 +377,7 @@ bool LLCrashLoggerWindows::initCrashServer() std::wstring wpipe_name; wpipe_name = mCrashReportPipeStr + std::wstring(wstringize(mPID)); - std::wstring wdump_path( wstringize(dump_path) ); + std::wstring wdump_path(utf8str_to_utf16str(dump_path)); //Pipe naming conventions: http://msdn.microsoft.com/en-us/library/aa365783%28v=vs.85%29.aspx mCrashHandler = new CrashGenerationServer( wpipe_name, diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp index 7466dbb766..58746eba02 100644 --- a/indra/win_crash_logger/win_crash_logger.cpp +++ b/indra/win_crash_logger/win_crash_logger.cpp @@ -29,15 +29,26 @@ #include <stdlib.h> #include "llcrashloggerwindows.h" +#ifdef _UNICODE +int APIENTRY wWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPWSTR lpCmdLine, + int nCmdShow) +#else int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +#endif //_UNICODE { LL_INFOS() << "Starting crash reporter with args" << &lpCmdLine << LL_ENDL; LLCrashLoggerWindows app; app.setHandle(hInstance); +#ifdef _UNICODE + app.parseCommandOptions(__argc, __wargv); +#else app.parseCommandOptions(__argc, __argv); +#endif //_UNICODE LLSD options = LLApp::instance()->getOptionData( LLApp::PRIORITY_COMMAND_LINE); |