From b7ac6c6b537fe144f2f9b01d04c3c87103bad548 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 24 Jun 2013 16:49:47 -0400 Subject: CHOP-955, CHOP-957: Platform-specific switches files => settings_install.xml. Instead of generating viewer command-line switch overrides into the Windows shortcut, an arguments.txt file on Mac, or a gridargs.dat file on Linux, generate a platform-independent settings_install.xml file containing 'sourceid' key (if 'sourceid' found in TeamCity environment variables). All command-line override switches previously found in the aforementioned files have happily become moot. --- indra/newview/viewer_manifest.py | 76 +++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 35451c9621..eb2cd73cc9 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -34,9 +34,13 @@ import tarfile import time import random viewer_dir = os.path.dirname(__file__) -# add llmanifest library to our path so we don't have to muck with PYTHONPATH -sys.path.append(os.path.join(viewer_dir, '../lib/python/indra/util')) -from llmanifest import LLManifest, main, proper_windows_path, path_ancestors +# add indra/lib/python to our path so we don't have to muck with PYTHONPATH +sys.path.append(os.path.join(viewer_dir, os.pardir, "lib", "python")) +from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors +try: + from llbase import llsd +except ImportError: + from indra.base import llsd class ViewerManifest(LLManifest): def is_packaging_viewer(self): @@ -99,6 +103,21 @@ class ViewerManifest(LLManifest): self.path("dictionaries") self.end_prefix(pkgdir) + # CHOP-955: If we have "sourceid" in the build process + # environment, generate it into settings_install.xml. + try: + sourceid = os.environ["sourceid"] + except KeyError: + # no sourceid, no settings_install.xml file + pass + else: + # Single-entry subset of the LLSD content of settings.xml + content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers', + Persist=1, + Type='String', + Value=sourceid)) + self.put_in_file(llsd.format_pretty_xml(content), "settings_install.xml") + self.end_prefix("app_settings") if self.prefix(src="character"): @@ -196,24 +215,26 @@ class ViewerManifest(LLManifest): """ Convenience function that returns the command-line flags for the grid""" - # Set command line flags relating to the target grid - grid_flags = '' - if not self.default_grid(): - grid_flags = "--grid %(grid)s "\ - "--helperuri http://preview-%(grid)s.secondlife.com/helpers/" %\ - {'grid':self.grid()} - - # Deal with settings - setting_flags = '' - if not self.default_channel() or not self.default_grid(): - if self.default_grid(): - setting_flags = '--settings settings_%s.xml'\ - % self.channel_lowerword() - else: - setting_flags = '--settings settings_%s_%s.xml'\ - % (self.grid(), self.channel_lowerword()) - - return " ".join((grid_flags, setting_flags)).strip() + # The original role of this method seems to have been to build a + # grid-specific viewer: one that would, on launch, preselect a + # particular grid. (Apparently that dates back to when the protocol + # between viewer and simulator required them to be updated in + # lockstep, so that "the beta grid" required "a beta viewer.") But + # those viewer command-line switches no longer work without tweaking + # user_settings/grids.xml. In fact, going forward, it's unclear what + # use case that would address. + + # This method also set a channel-specific (or grid-and-channel- + # specific) user_settings/settings_something.xml file. It has become + # clear that saving user settings in a channel-specific file causes + # more problems (confusion) than it solves, so we've discontinued that. + + # In fact we now avoid forcing viewer command-line switches at all, + # instead introducing a settings_install.xml file. Command-line + # switches don't aggregate well; for instance the generated --channel + # switch actually prevented the user specifying --channel on the + # command line. Settings files have well-defined override semantics. + return None def extract_names(self,src): try: @@ -529,8 +550,7 @@ class WindowsManifest(ViewerManifest): 'final_exe' : self.final_exe(), 'grid':self.args['grid'], 'grid_caps':self.args['grid'].upper(), - # escape quotes becase NSIS doesn't handle them well - 'flags':self.flags_list().replace('"', '$\\"'), + 'flags':'', 'channel':self.channel(), 'channel_oneword':self.channel_oneword(), 'channel_unique':self.channel_unique(), @@ -757,9 +777,6 @@ class DarwinManifest(ViewerManifest): self.end_prefix("llplugin") - # command line arguments for connecting to the proper grid - self.put_in_file(self.flags_list(), 'arguments.txt') - self.end_prefix("Resources") self.end_prefix("Contents") @@ -805,10 +822,6 @@ class DarwinManifest(ViewerManifest): 'bundle': self.get_dst_prefix() }) - channel_standin = 'Second Life Viewer' # hah, our default channel is not usable on its own - if not self.default_channel(): - channel_standin = self.channel() - imagename="SecondLife_" + '_'.join(self.args['version']) # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning. @@ -926,9 +939,6 @@ class LinuxManifest(ViewerManifest): self.path("install.sh") self.end_prefix("linux_tools") - # Create an appropriate gridargs.dat for this package, denoting required grid. - self.put_in_file(self.flags_list(), 'etc/gridargs.dat') - if self.prefix(src="", dst="bin"): self.path("secondlife-bin","do-not-directly-run-secondlife-bin") self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin") -- cgit v1.2.3 From 316f1fd02629f6cdae6d08644c8d45085dd19166 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 25 Jun 2013 17:08:16 -0400 Subject: CHOP-957: Stop reading gridargs.dat in 'secondlife' wrapper script. However, for backwards compatibility, continue to recognize and discard --skip-gridargs switch. --- indra/newview/linux_tools/wrapper.sh | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index d8440eebf1..c23401d5a6 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -121,37 +121,21 @@ export SAVED_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH="$PWD/lib:${LD_LIBRARY_PATH}" -# Have to deal specially with gridargs.dat; typical contents look like: -# --channel "Second Life Test" --settings settings_test.xml -# Simply embedding $( Date: Tue, 25 Jun 2013 17:33:36 -0400 Subject: CHOP-957: Stop looking for, or parsing, Mac arguments.txt file. --- indra/newview/llappviewermacosx.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 4d340cafa9..c7b437598c 100755 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -148,28 +148,13 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) // The next two lines add the support for parsing the mac -psn_XXX arg. clp.addOptionDesc("psn", NULL, 1, "MacOSX process serial number"); clp.setCustomParser(parse_psn); - - // First read in the args from arguments txt. - const char* filename = "arguments.txt"; - llifstream ifs(filename, llifstream::binary); - if (!ifs.is_open()) - { - llwarns << "Unable to open file" << filename << llendl; - return false; - } - - if(clp.parseCommandLineFile(ifs) == false) - { - return false; - } - // Then parse the user's command line, so that any --url arg can appear last - // Succesive calls to clp.parse... will NOT override earlier options. + // parse the user's command line if(clp.parseCommandLine(gArgC, gArgV) == false) { return false; } - + // Get the user's preferred language string based on the Mac OS localization mechanism. // To add a new localization: // go to the "Resources" section of the project -- cgit v1.2.3 From d5febe1ab553749808198ec4e0c78ec64d4d9588 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 27 Jun 2013 11:07:12 -0400 Subject: CHOP-956: Add settings_install.xml to settings_files.xml. Also clarify comment for ELLPath in lldir.h: ELLPath int values are read from settings_files.xml. --- indra/newview/app_settings/settings_files.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings_files.xml b/indra/newview/app_settings/settings_files.xml index bfc09286e3..4a9e522a96 100755 --- a/indra/newview/app_settings/settings_files.xml +++ b/indra/newview/app_settings/settings_files.xml @@ -4,6 +4,9 @@ + -- cgit v1.2.3 From e060f7a6e529d0ef83106db85969a2d047a2247a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 27 Jun 2013 12:50:06 -0400 Subject: CHOP-955, CHOP-957: Prioritize indra.util.llmanifest in same source repo. It seems that certain build hosts have an (obsolete? broken?) install of indra.util.llmanifest under the system Python. If we append the local repo indra/lib/python to sys.path, viewer_manifest.py pulls in the broken llmanifest. Prepend to sys.path instead to ensure we get the right one. --- indra/newview/viewer_manifest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index eb2cd73cc9..1429fe4c7a 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -34,8 +34,10 @@ import tarfile import time import random viewer_dir = os.path.dirname(__file__) -# add indra/lib/python to our path so we don't have to muck with PYTHONPATH -sys.path.append(os.path.join(viewer_dir, os.pardir, "lib", "python")) +# Add indra/lib/python to our path so we don't have to muck with PYTHONPATH. +# Put it FIRST because some of our build hosts have an ancient install of +# indra.util.llmanifest under their system Python! +sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python")) from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors try: from llbase import llsd -- cgit v1.2.3 From 4a9b688b4d46f67e1b00e04ebe972470b61e560a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 27 Jun 2013 16:11:48 -0400 Subject: CHOP-959: Make settings.xml actually valid XML LLSD. UserLoginInfo block had Value without the required subsequent element to provide any actual value. This confused at least the Python LLSD reader. --- indra/newview/app_settings/settings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 12ca902c59..997bde37ce 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -12859,12 +12859,13 @@ UserLoginInfo Comment - Users loging data. + User login data. Persist 1 Type LLSD Value + VFSOldSize -- cgit v1.2.3 From c08b60ac6fee74f613ed3f5f8702291ed1c2376f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 28 Jun 2013 15:26:18 -0400 Subject: CHOP-959: Streamline processing for --graphicslevel switch. Use map-to in cmd_line.xml to inform the command-line processor that the target variable for --graphicslevel is RenderQualityPerformance. That lets us eliminate clunky llappviewer.cpp switch from '0' to 0, etc. Moreover, previous switch statement only accepted 0 - 3, whereas LLFeatureManager::setGraphicsLevel() actually accepts 0 - 6. Introduce LLFeatureManager::isValidGraphicsLevel() and use that to validate. Replace switch statement in setGraphicsLevel() mapping int constants to string literals with static vector of level names, using same data for mapping as for validating level numbers. --- indra/newview/app_settings/cmd_line.xml | 2 + indra/newview/llappviewer.cpp | 43 ++---------- indra/newview/llfeaturemanager.cpp | 117 +++++++++++++++++++------------- indra/newview/llfeaturemanager.h | 14 +++- 4 files changed, 88 insertions(+), 88 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 7ab7787d77..8ca33fbf54 100755 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -96,6 +96,8 @@ 0 - low, 1 - medium, 2 - high, 3 - ultra count 1 + map-to + RenderQualityPerformance grid diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f92274dbbd..5b301c03a1 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2311,13 +2311,6 @@ bool LLAppViewer::initConfiguration() { //Load settings files list std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml"); - //LLControlGroup settings_control("SettingsFiles"); - //llinfos << "Loading settings file list " << settings_file_list << llendl; - //if (0 == settings_control.loadFromFile(settings_file_list)) - //{ - // llerrs << "Cannot load default configuration file " << settings_file_list << llendl; - //} - LLXMLNodePtr root; BOOL success = LLXMLNode::parseFile(settings_file_list, root, NULL); if (!success) @@ -2376,9 +2369,7 @@ bool LLAppViewer::initConfiguration() { c->setValue(true, false); } -#endif -#ifndef LL_RELEASE_FOR_DOWNLOAD gSavedSettings.setBOOL("QAMode", TRUE ); gSavedSettings.setS32("WatchdogEnabled", 0); #endif @@ -2582,36 +2573,10 @@ bool LLAppViewer::initConfiguration() if (clp.hasOption("graphicslevel")) { - const LLCommandLineParser::token_vector_t& value = clp.getOption("graphicslevel"); - if(value.size() != 1) - { - llwarns << "Usage: -graphicslevel <0-3>" << llendl; - } - else - { - std::string detail = value.front(); - mForceGraphicsDetail = TRUE; - - switch (detail.c_str()[0]) - { - case '0': - gSavedSettings.setU32("RenderQualityPerformance", 0); - break; - case '1': - gSavedSettings.setU32("RenderQualityPerformance", 1); - break; - case '2': - gSavedSettings.setU32("RenderQualityPerformance", 2); - break; - case '3': - gSavedSettings.setU32("RenderQualityPerformance", 3); - break; - default: - mForceGraphicsDetail = FALSE; - llwarns << "Usage: -graphicslevel <0-3>" << llendl; - break; - } - } + // User explicitly requested --graphicslevel on the command line. + // We expect this switch has already set RenderQualityPerformance. + mForceGraphicsDetail = + LLFeatureManager::instance().isValidGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance")); } if (clp.hasOption("analyzeperformance")) diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index ddb9d3bc43..9d292ce7bb 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -30,6 +30,7 @@ #include #include +#include #include "llfeaturemanager.h" #include "lldir.h" @@ -52,6 +53,8 @@ #include "llboost.h" #include "llweb.h" #include "llviewershadermgr.h" +#include "llstring.h" +#include "stringize.h" #if LL_WINDOWS #include "lldxhardware.h" @@ -187,6 +190,55 @@ void LLFeatureList::dump() LL_DEBUGS("RenderInit") << LL_ENDL; } +static const std::vector sGraphicsLevelNames = boost::assign::list_of + ("Low") + ("LowMid") + ("Mid") + ("MidHigh") + ("High") + ("HighUltra") + ("Ultra") +; + +U32 LLFeatureManager::getMaxGraphicsLevel() const +{ + return sGraphicsLevelNames.size() - 1; +} + +bool LLFeatureManager::isValidGraphicsLevel(U32 level) const +{ + return (level <= getMaxGraphicsLevel()); +} + +std::string LLFeatureManager::getNameForGraphicsLevel(U32 level) const +{ + if (isValidGraphicsLevel(level)) + { + return sGraphicsLevelNames[level]; + } + return STRINGIZE("Invalid graphics level " << level << ", valid are 0 .. " + << getMaxGraphicsLevel()); +} + +S32 LLFeatureManager::getGraphicsLevelForName(const std::string& name) const +{ + const std::string FixedFunction("FixedFunction"); + std::string rname(name); + if (LLStringUtil::endsWith(rname, FixedFunction)) + { + // chop off any "FixedFunction" suffix + rname = rname.substr(0, rname.length() - FixedFunction.length()); + } + for (S32 i(0), iend(getMaxGraphicsLevel()); i <= iend; ++i) + { + if (sGraphicsLevelNames[i] == rname) + { + return i; + } + } + return -1; +} + LLFeatureList *LLFeatureManager::findMask(const std::string& name) { if (mMaskList.count(name)) @@ -620,7 +672,7 @@ void LLFeatureManager::applyRecommendedSettings() { // apply saved settings // cap the level at 2 (high) - S32 level = llmax(GPU_CLASS_0, llmin(mGPUClass, GPU_CLASS_5)); + U32 level = llmax(GPU_CLASS_0, llmin(mGPUClass, GPU_CLASS_5)); llinfos << "Applying Recommended Features" << llendl; @@ -696,62 +748,33 @@ void LLFeatureManager::applyFeatures(bool skipFeatures) } } -void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures) +void LLFeatureManager::setGraphicsLevel(U32 level, bool skipFeatures) { LLViewerShaderMgr::sSkipReload = true; applyBaseMasks(); - - switch (level) + + // if we're passed an invalid level, default to "Low" + std::string features(isValidGraphicsLevel(level)? getNameForGraphicsLevel(level) : "Low"); + if (features == "Low") { - case 0: #if LL_DARWIN - // This Mac-specific change is to insure that we force 'Basic Shaders' for all Mac - // systems which support them instead of falling back to fixed-function unnecessarily - // MAINT-2157 - // - if (gGLManager.mGLVersion < 2.1f) - { - maskFeatures("LowFixedFunction"); - } - else - { //same as low, but with "Basic Shaders" enabled - maskFeatures("Low"); - } + // This Mac-specific change is to insure that we force 'Basic Shaders' for all Mac + // systems which support them instead of falling back to fixed-function unnecessarily + // MAINT-2157 + if (gGLManager.mGLVersion < 2.1f) #else - if (gGLManager.mGLVersion < 3.f || gGLManager.mIsIntel) - { //only use fixed function by default if GL version < 3.0 or this is an intel graphics chip - maskFeatures("LowFixedFunction"); - } - else - { //same as low, but with "Basic Shaders" enabled - maskFeatures("Low"); - } + // only use fixed function by default if GL version < 3.0 or this is an intel graphics chip + if (gGLManager.mGLVersion < 3.f || gGLManager.mIsIntel) #endif - break; - case 1: - maskFeatures("LowMid"); - break; - case 2: - maskFeatures("Mid"); - break; - case 3: - maskFeatures("MidHigh"); - break; - case 4: - maskFeatures("High"); - break; - case 5: - maskFeatures("HighUltra"); - break; - case 6: - maskFeatures("Ultra"); - break; - default: - maskFeatures("Low"); - break; + { + // same as Low, but with "Basic Shaders" disabled + features = "LowFixedFunction"; + } } + maskFeatures(features); + applyFeatures(skipFeatures); LLViewerShaderMgr::sSkipReload = false; diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index ad72c16743..3b8d251236 100755 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -134,8 +134,18 @@ public: // skipFeatures forces skipping of mostly hardware settings // that we don't want to change when we change graphics // settings - void setGraphicsLevel(S32 level, bool skipFeatures); - + void setGraphicsLevel(U32 level, bool skipFeatures); + + // What 'level' values are valid to pass to setGraphicsLevel()? + // 0 is the low end... + U32 getMaxGraphicsLevel() const; + bool isValidGraphicsLevel(U32 level) const; + + // setGraphicsLevel() levels have names. + std::string getNameForGraphicsLevel(U32 level) const; + // returns -1 for unrecognized name (hence S32 rather than U32) + S32 getGraphicsLevelForName(const std::string& name) const; + void applyBaseMasks(); void applyRecommendedSettings(); -- cgit v1.2.3 From 3d9c74dcc869d7ce3708426a0b45bfb838529d3f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 1 Jul 2013 16:19:24 -0400 Subject: CHOP-959: Introduce and use settings vars for some cmd_line switches. The cmd_line.xml entries: analyzeperformance crashonstartup debugsession disablecrashlogger logmetrics logperformance noquicktime replaysession all specify map-to settings.xml variables -- none of which existed! Introduce such variables. Instead of detecting the presence of a particular switch in the command-line parser, use the value of its corresponding settings variable. --- indra/newview/app_settings/settings.xml | 88 +++++++++++++++++++++++++++++++++ indra/newview/llappviewer.cpp | 52 ++++++------------- 2 files changed, 103 insertions(+), 37 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 997bde37ce..a39b447cca 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -126,6 +126,17 @@ Value 1 + AnalyzePerformance + + Comment + Request performance analysis for a particular viewer run + Persist + 0 + Type + Boolean + Value + 0 + AnimateTextures Comment @@ -1916,6 +1927,17 @@ Value 262144 + CrashOnStartup + + Comment + User-requested crash on viewer startup + Persist + 0 + Type + Boolean + Value + 0 + CreateToolCopyCenters Comment @@ -2158,6 +2180,17 @@ Value 0 + DebugSession + + Comment + Request debugging for a particular viewer session + Persist + 0 + Type + Boolean + Value + 0 + DebugShowColor Comment @@ -2972,6 +3005,17 @@ Value 0 + DisableCrashLogger + + Comment + Do not send crash report to Linden server + Persist + 0 + Type + Boolean + Value + 0 + DisableMouseWarp Comment @@ -5217,6 +5261,28 @@ Value 0 + LogMetrics + + Comment + Log viewer metrics + Persist + 0 + Type + String + Value + + + LogPerformance + + Comment + Log performance analysis for a particular viewer run + Persist + 0 + Type + Boolean + Value + 0 + LogTextureNetworkTraffic Comment @@ -6394,6 +6460,17 @@ Value 0 + NoQuickTime + + Comment + Disable QuickTime for a particular viewer run + Persist + 0 + Type + Boolean + Value + 0 + NoVerifySSLCert Comment @@ -9643,6 +9720,17 @@ Value 1 + ReplaySession + + Comment + Request replay of previously-recorded pilot file + Persist + 0 + Type + Boolean + Value + 0 + RotateRight Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5b301c03a1..613a23630f 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2463,7 +2463,7 @@ bool LLAppViewer::initConfiguration() // Register the core crash option as soon as we can // if we want gdb post-mortem on cores we need to be up and running // ASAP or we might miss init issue etc. - if(clp.hasOption("disablecrashlogger")) + if(gSavedSettings.getBOOL("DisableCrashLogger")) { llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << llendl; LLAppViewer::instance()->disableCrashlogger(); @@ -2542,59 +2542,37 @@ bool LLAppViewer::initConfiguration() } // If we have specified crash on startup, set the global so we'll trigger the crash at the right time - if(clp.hasOption("crashonstartup")) - { - gCrashOnStartup = TRUE; - } + gCrashOnStartup = gSavedSettings.getBOOL("CrashOnStartup"); - if (clp.hasOption("logperformance")) + if (gSavedSettings.getBOOL("LogPerformance")) { LLFastTimer::sLog = TRUE; LLFastTimer::sLogName = std::string("performance"); } - - if (clp.hasOption("logmetrics")) - { - LLFastTimer::sMetricLog = TRUE ; - // '--logmetrics' can be specified with a named test metric argument so the data gathering is done only on that test - // In the absence of argument, every metric is gathered (makes for a rather slow run and hard to decipher report...) - std::string test_name = clp.getOption("logmetrics")[0]; + + std::string test_name(gSavedSettings.getString("LogMetrics")); + if (! test_name.empty()) + { + LLFastTimer::sMetricLog = TRUE ; + // '--logmetrics' is specified with a named test metric argument so the data gathering is done only on that test + // In the absence of argument, every metric would be gathered (makes for a rather slow run and hard to decipher report...) llinfos << "'--logmetrics' argument : " << test_name << llendl; - if (test_name == "") - { - llwarns << "No '--logmetrics' argument given, will output all metrics to " << DEFAULT_METRIC_NAME << llendl; - LLFastTimer::sLogName = DEFAULT_METRIC_NAME; - } - else - { - LLFastTimer::sLogName = test_name; - } + LLFastTimer::sLogName = test_name; } if (clp.hasOption("graphicslevel")) { // User explicitly requested --graphicslevel on the command line. // We expect this switch has already set RenderQualityPerformance. + // Check that value for validity; if valid, we'll engage it later. mForceGraphicsDetail = LLFeatureManager::instance().isValidGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance")); } - if (clp.hasOption("analyzeperformance")) - { - LLFastTimerView::sAnalyzePerformance = TRUE; - } + LLFastTimerView::sAnalyzePerformance = gSavedSettings.getBOOL("AnalyzePerformance"); + gAgentPilot.setReplaySession(gSavedSettings.getBOOL("ReplaySession")); - if (clp.hasOption("replaysession")) - { - gAgentPilot.setReplaySession(TRUE); - } - - if (clp.hasOption("nonotifications")) - { - gSavedSettings.getControl("IgnoreAllNotifications")->setValue(true, false); - } - - if (clp.hasOption("debugsession")) + if (gSavedSettings.getBOOL("DebugSession")) { gDebugSession = TRUE; gDebugGL = TRUE; -- cgit v1.2.3 From 774c410cc7538c1fdfcbf17250aa38532012d683 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 2 Jul 2013 10:09:37 -0400 Subject: CHOP-959: add POSITION_LOCAL to LLFloaterAbout::getInfo() blob. The existing POSITION variable gives "global" position: that is, your region- local coordinates plus the (somewhat arbitrary) global coordinates of the region's corner within the whole world. That may be meaningful to people on the mainland, hard to say, but it correlates with nothing else available from the viewer. POSITION_LOCAL gives you region-local coordinates, which could be used (for instance) to construct a SLURL. --- indra/newview/llfloaterabout.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 83fb887d81..318a03f755 100755 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -250,8 +250,9 @@ LLSD LLFloaterAbout::getInfo() LLViewerRegion* region = gAgent.getRegion(); if (region) { - const LLVector3d &pos = gAgent.getPositionGlobal(); + LLVector3d pos = gAgent.getPositionGlobal(); info["POSITION"] = ll_sd_from_vector3d(pos); + info["POSITION_LOCAL"] = ll_sd_from_vector3(gAgent.getPosAgentFromGlobal(pos)); info["REGION"] = gAgent.getRegion()->getName(); info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName(); info["HOSTIP"] = gAgent.getRegion()->getHost().getString(); -- cgit v1.2.3 From c71b02b743c41b00970425da14ceb437370aeaf8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 2 Jul 2013 10:15:41 -0400 Subject: CHOP-959: Report region-local position in Help -> About box. I've never really understood the usefulness of displaying world-global coordinates in the Help -> About box. It seems to me far more useful to know where you are within the current region. If that proves problematic, we can display both sets of coordinates -- but let's try it this way first. --- indra/newview/skins/default/xui/da/floater_about.xml | 2 +- indra/newview/skins/default/xui/de/floater_about.xml | 2 +- indra/newview/skins/default/xui/en/floater_about.xml | 2 +- indra/newview/skins/default/xui/es/floater_about.xml | 2 +- indra/newview/skins/default/xui/fr/floater_about.xml | 2 +- indra/newview/skins/default/xui/it/floater_about.xml | 2 +- indra/newview/skins/default/xui/ja/floater_about.xml | 2 +- indra/newview/skins/default/xui/pl/floater_about.xml | 2 +- indra/newview/skins/default/xui/pt/floater_about.xml | 2 +- indra/newview/skins/default/xui/ru/floater_about.xml | 2 +- indra/newview/skins/default/xui/tr/floater_about.xml | 2 +- indra/newview/skins/default/xui/zh/floater_about.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/da/floater_about.xml b/indra/newview/skins/default/xui/da/floater_about.xml index fc8bc33096..9206690c8f 100755 --- a/indra/newview/skins/default/xui/da/floater_about.xml +++ b/indra/newview/skins/default/xui/da/floater_about.xml @@ -8,7 +8,7 @@ Bygget med [COMPILER] version [COMPILER_VERSION] - Du er ved [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] i regionen [REGION] lokaliseret ved <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Du er ved [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] i regionen [REGION] lokaliseret ved <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/de/floater_about.xml b/indra/newview/skins/default/xui/de/floater_about.xml index 4387a61963..5245467183 100755 --- a/indra/newview/skins/default/xui/de/floater_about.xml +++ b/indra/newview/skins/default/xui/de/floater_about.xml @@ -8,7 +8,7 @@ Kompiliert mit [COMPILER] version [COMPILER_VERSION] - Sie befinden sich in [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] auf <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Sie befinden sich in [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] auf <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 63eb87f27a..d9e4b5b70c 100755 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -22,7 +22,7 @@ Built with [COMPILER] version [COMPILER_VERSION] -You are at [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] located at <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +You are at [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] located at <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/es/floater_about.xml b/indra/newview/skins/default/xui/es/floater_about.xml index 3696c7e12c..7ca1e3721f 100755 --- a/indra/newview/skins/default/xui/es/floater_about.xml +++ b/indra/newview/skins/default/xui/es/floater_about.xml @@ -8,7 +8,7 @@ Compilado con [COMPILER], versión [COMPILER_VERSION] - Estás en la posición [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1], de [REGION], alojada en <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Estás en la posición [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1], de [REGION], alojada en <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/fr/floater_about.xml b/indra/newview/skins/default/xui/fr/floater_about.xml index a659cb4245..d45bdccf3e 100755 --- a/indra/newview/skins/default/xui/fr/floater_about.xml +++ b/indra/newview/skins/default/xui/fr/floater_about.xml @@ -8,7 +8,7 @@ Compilé avec [COMPILER] version [COMPILER_VERSION] - Vous êtes à [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] dans [REGION], se trouvant à <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Vous êtes à [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] dans [REGION], se trouvant à <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/it/floater_about.xml b/indra/newview/skins/default/xui/it/floater_about.xml index c672511fc5..b0fb585fa2 100755 --- a/indra/newview/skins/default/xui/it/floater_about.xml +++ b/indra/newview/skins/default/xui/it/floater_about.xml @@ -8,7 +8,7 @@ Generato con [COMPILER] versione [COMPILER_VERSION] - Tu sei [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] che si trova a <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Tu sei [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] che si trova a <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/ja/floater_about.xml b/indra/newview/skins/default/xui/ja/floater_about.xml index 6d5df75645..eae52c98ec 100755 --- a/indra/newview/skins/default/xui/ja/floater_about.xml +++ b/indra/newview/skins/default/xui/ja/floater_about.xml @@ -8,7 +8,7 @@ コンパイラー [COMPILER] [COMPILER_VERSION] バージョン - あなたの現在地は、[POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] の [REGION] です。位置は <nolink>[HOSTNAME]</nolink> です。([HOSTIP]) + あなたの現在地は、[POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] の [REGION] です。位置は <nolink>[HOSTNAME]</nolink> です。([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/pl/floater_about.xml b/indra/newview/skins/default/xui/pl/floater_about.xml index 409429ffaa..61a72ff27d 100755 --- a/indra/newview/skins/default/xui/pl/floater_about.xml +++ b/indra/newview/skins/default/xui/pl/floater_about.xml @@ -8,7 +8,7 @@ Buduj z [COMPILER] wersją [COMPILER_VERSION] - Położenie [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] w [REGION] zlokalizowanym w <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Położenie [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] w [REGION] zlokalizowanym w <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/pt/floater_about.xml b/indra/newview/skins/default/xui/pt/floater_about.xml index 299f88b22a..d089266342 100755 --- a/indra/newview/skins/default/xui/pt/floater_about.xml +++ b/indra/newview/skins/default/xui/pt/floater_about.xml @@ -7,7 +7,7 @@ Construído com [COMPILER] versão [COMPILER_VERSION] - Você está em [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] em [REGION] localizado em [HOSTNAME]</nolink>([HOSTIP]) + Você está em [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] em [REGION] localizado em [HOSTNAME]</nolink>([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/ru/floater_about.xml b/indra/newview/skins/default/xui/ru/floater_about.xml index bb6266ac9a..2b2b3cf453 100755 --- a/indra/newview/skins/default/xui/ru/floater_about.xml +++ b/indra/newview/skins/default/xui/ru/floater_about.xml @@ -8,7 +8,7 @@ Использован компилятор [COMPILER], версия [COMPILER_VERSION] - Вы в точке [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] в регионе «[REGION]», расположенном на <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Вы в точке [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] в регионе «[REGION]», расположенном на <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/tr/floater_about.xml b/indra/newview/skins/default/xui/tr/floater_about.xml index 9cc9c7a220..4dcf6200c6 100755 --- a/indra/newview/skins/default/xui/tr/floater_about.xml +++ b/indra/newview/skins/default/xui/tr/floater_about.xml @@ -8,7 +8,7 @@ [COMPILER] [COMPILER_VERSION] sürümü ile oluşturuldu - <nolink>[HOSTNAME]</nolink> ([HOSTIP]) üzerinde bulunan [REGION] içerisinde [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] konumundasınız + <nolink>[HOSTNAME]</nolink> ([HOSTIP]) üzerinde bulunan [REGION] içerisinde [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] konumundasınız [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/zh/floater_about.xml b/indra/newview/skins/default/xui/zh/floater_about.xml index 643881e416..1193243c7e 100755 --- a/indra/newview/skins/default/xui/zh/floater_about.xml +++ b/indra/newview/skins/default/xui/zh/floater_about.xml @@ -8,7 +8,7 @@ 以 [COMPILER_VERSION] 版本 [COMPILER] 建置 - 你的方位是 [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1],地區名:[REGION],主機:<nolink>[HOSTNAME]</nolink> ([HOSTIP]) + 你的方位是 [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1],地區名:[REGION],主機:<nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] -- cgit v1.2.3 From 09d8d17382c72b7741fde1334e832f39d773299f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 2 Jul 2013 15:30:49 -0400 Subject: CHOP-959: Introduce CmdLineLoginLocation var for --url and --slurl. Route --url and --slurl command-line switches through a common settings variable. Treat them uniformly now. (Previously, passing --url would notice a grid-specific SLURL and preselect that grid; --slurl wouldn't. Now both do.) --- indra/newview/app_settings/cmd_line.xml | 6 ++++-- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 27 +++++++++++---------------- 3 files changed, 26 insertions(+), 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 8ca33fbf54..71a052057c 100755 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -372,7 +372,8 @@ true last_option true - + map-to + CmdLineLoginLocation url @@ -383,7 +384,8 @@ 1 last_option true - + map-to + CmdLineLoginLocation usersessionsettings diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a39b447cca..8a50ca146b 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1795,6 +1795,17 @@ + CmdLineLoginLocation + + Comment + Startup destination requested on command line + Persist + 0 + Type + String + Value + + ConnectAsGod Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 613a23630f..3116dd4b00 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2597,20 +2597,16 @@ bool LLAppViewer::initConfiguration() // What can happen is that someone can use IE (or potentially // other browsers) and do the rough equivalent of command // injection and steal passwords. Phoenix. SL-55321 - if(clp.hasOption("url")) - { - LLStartUp::setStartSLURL(LLSLURL(clp.getOption("url")[0])); - if(LLStartUp::getStartSLURL().getType() == LLSLURL::LOCATION) - { - LLGridManager::getInstance()->setGridChoice(LLStartUp::getStartSLURL().getGrid()); - - } - } - else if(clp.hasOption("slurl")) - { - LLSLURL start_slurl(clp.getOption("slurl")[0]); + std::string CmdLineLoginLocation(gSavedSettings.getString("CmdLineLoginLocation")); + if(! CmdLineLoginLocation.empty()) + { + LLSLURL start_slurl(CmdLineLoginLocation); LLStartUp::setStartSLURL(start_slurl); - } + if(start_slurl.getType() == LLSLURL::LOCATION) + { + LLGridManager::getInstance()->setGridChoice(start_slurl.getGrid()); + } + } const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) @@ -2753,9 +2749,8 @@ bool LLAppViewer::initConfiguration() LL_DEBUGS("AppInit")<<"set start from NextLoginLocation: "< Date: Tue, 2 Jul 2013 16:33:40 -0400 Subject: CHOP-959: Introduce CmdLineChannel settings var, map --channel to it. --- indra/newview/app_settings/cmd_line.xml | 3 ++- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 7 ++++--- 3 files changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 71a052057c..74117dbd85 100755 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -22,7 +22,8 @@ count 1 - + map-to + CmdLineChannel console diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8a50ca146b..6f50a72016 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1749,6 +1749,17 @@ Value 0 + CmdLineChannel + + Comment + Command line specified channel name + Persist + 0 + Type + String + Value + + CmdLineDisableVoice Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3116dd4b00..37f1f11451 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2536,9 +2536,10 @@ bool LLAppViewer::initConfiguration() } } - if(clp.hasOption("channel")) - { - LLVersionInfo::resetChannel(clp.getOption("channel")[0]); + std::string CmdLineChannel(gSavedSettings.getString("CmdLineChannel")); + if(! CmdLineChannel.empty()) + { + LLVersionInfo::resetChannel(CmdLineChannel); } // If we have specified crash on startup, set the global so we'll trigger the crash at the right time -- cgit v1.2.3 From 879dfd161ef19f73371b69e5db6b044f8b118ca1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 11 Jul 2013 19:42:43 -0400 Subject: CHOP-959: Re-add global coordinates, plus SLURL, to About box. --- indra/newview/llfloaterabout.cpp | 5 +++++ indra/newview/skins/default/xui/en/floater_about.xml | 2 ++ 2 files changed, 7 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 318a03f755..163f294d2a 100755 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -33,8 +33,10 @@ // Viewer includes #include "llagent.h" +#include "llagentui.h" #include "llappviewer.h" #include "llsecondlifeurls.h" +#include "llslurl.h" #include "llvoiceclient.h" #include "lluictrlfactory.h" #include "llviewertexteditor.h" @@ -257,6 +259,9 @@ LLSD LLFloaterAbout::getInfo() info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName(); info["HOSTIP"] = gAgent.getRegion()->getHost().getString(); info["SERVER_VERSION"] = gLastVersionChannel; + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + info["SLURL"] = slurl.getSLURLString(); } // CPU diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index d9e4b5b70c..703015af20 100755 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -23,6 +23,8 @@ Built with [COMPILER] version [COMPILER_VERSION] You are at [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] located at <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +SLURL: <nolink>[SLURL]</nolink> +(global coordinates [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] -- cgit v1.2.3 From cfd17448be0c464c1ca64b1e8f3260aa4e98b0ca Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 16 Jul 2013 14:17:00 -0400 Subject: CHOP-960: Validate cmd_line.xml for map-to real settings.xml vars. A small, fixed set of cmd_line.xml switches can't reasonably be mapped to settings variables, mostly because they affect the settings machinery itself. Other than those, every new cmd_line.xml switch should map-to a settings variable. Validate that only the known set does not have map-to; validate that map-to variable actually exists. --- indra/newview/llcommandlineparser.cpp | 46 +++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 17d403bbe1..7adc6b8c5e 100755 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -39,13 +39,17 @@ #include #include -#include +#include +#include #if _MSC_VER # pragma warning(pop) #endif #include "llsdserialize.h" +#include "llerror.h" +#include +#include #include #include @@ -63,6 +67,18 @@ namespace po = boost::program_options; // This could be good or bad, and probably won't matter for most use cases. namespace { + // List of command-line switches that can't map-to settings variables. + // Going forward, we want every new command-line switch to map-to some + // settings variable. This list is used to validate that. + const std::set unmapped_options = boost::assign::list_of + ("help") + ("set") + ("setdefault") + ("settings") + ("sessionsettings") + ("usersessionsettings") + ; + po::options_description gOptionsDesc; po::positional_options_description gPositionalOptions; po::variables_map gVariableMap; @@ -561,9 +577,35 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG } boost::function1 callback; - if(option_params.has("map-to") && (NULL != controlGroup)) + if (! option_params.has("map-to")) + { + // If this option isn't mapped to a settings variable, is it + // one of the ones for which that's unreasonable, or did + // someone carelessly add a new option? (Make all these + // configuration errors fatal so a maintainer will catch them + // right away.) + std::set::const_iterator found = unmapped_options.find(long_name); + if (found == unmapped_options.end()) + { + llerrs << "New command-line option " << long_name + << " should map-to a variable in settings.xml" << llendl; + } + } + else // option specifies map-to { std::string controlName = option_params["map-to"].asString(); + if (! controlGroup) + { + llerrs << "Must pass gSavedSettings to LLControlGroupCLP::configure() for " + << long_name << " (map-to " << controlName << ")" << llendl; + } + + if (! controlGroup->getControl(controlName)) + { + llerrs << "Option " << long_name << " specifies map-to " << controlName + << " which does not exist" << llendl; + } + callback = boost::bind(setControlValueCB, _1, controlName, controlGroup); } -- cgit v1.2.3 From 2b3c1bd40d11b02cb097cb3dba7a661a4b528a91 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 17 Jul 2013 08:23:42 -0400 Subject: CHOP-962: Make LLControlGroup::declare* return LLControlVariable* LLControlGroup::declareControl(), declareString() etc. etc. all used to return BOOL -- which no one ever examines because it unconditionally returned TRUE. Make it return the (possibly new) LLControlVariable* instead. --- indra/newview/tests/llagentaccess_test.cpp | 4 ++-- indra/newview/tests/lllogininstance_test.cpp | 4 ++-- indra/newview/tests/llsecapi_test.cpp | 4 ++-- indra/newview/tests/llsechandler_basic_test.cpp | 4 ++-- indra/newview/tests/llslurl_test.cpp | 4 ++-- indra/newview/tests/llviewerhelputil_test.cpp | 4 ++-- indra/newview/tests/llviewernetwork_test.cpp | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index 3ba25f3c10..1f379ead32 100755 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -49,10 +49,10 @@ LLControlGroup::~LLControlGroup() } // Implementation of just the LLControlGroup methods we requre -BOOL LLControlGroup::declareU32(const std::string& name, U32 initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareU32(const std::string& name, U32 initial_val, const std::string& comment, BOOL persist) { test_preferred_maturity = initial_val; - return true; + return NULL; } void LLControlGroup::setU32(const std::string& name, U32 val) diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index f038112fd0..4768d9351e 100755 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -175,8 +175,8 @@ F32 LLControlGroup::getF32(const std::string& name) { return 0.0f; } U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only) { return 1; } void LLControlGroup::setString(const std::string& name, const std::string& val) {} std::string LLControlGroup::getString(const std::string& name) { return "test_string"; } -BOOL LLControlGroup::declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, BOOL persist) { return TRUE; } -BOOL LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, BOOL persist) { return TRUE; } +LLControlVariable* LLControlGroup::declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, BOOL persist) { return NULL; } +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, BOOL persist) { return NULL; } #include "lluicolortable.h" void LLUIColorTable::saveUserSettings(void)const {} diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index 703603e2db..05bac0e23b 100755 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -39,10 +39,10 @@ LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + BOOL persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string LLControlGroup::getString(const std::string& name) { diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index 0235400976..3fbb45f8b4 100755 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -71,10 +71,10 @@ std::string gLastName; LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + BOOL persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string LLControlGroup::getString(const std::string& name) { diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index 09343ef227..a3735388df 100755 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -37,10 +37,10 @@ LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + BOOL persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string gCmdLineLoginURI; diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 710881d811..8e9cc7111b 100755 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -49,10 +49,10 @@ static std::string gOS; LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + BOOL persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string LLControlGroup::getString(const std::string& name) { diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index a1e97ea17e..f80c02475d 100755 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -37,10 +37,10 @@ LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + BOOL persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string gCmdLineLoginURI; -- cgit v1.2.3 From 10c8fbbedbee07355f71ef206c50957a422d7ccf Mon Sep 17 00:00:00 2001 From: JJ Linden Date: Wed, 24 Jul 2013 14:38:23 -0700 Subject: added default sourceid and check that sourceid is not blank, hoping to get the windows builds to recognize the value --- indra/newview/viewer_manifest.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 206f81cdc2..827a8f44c3 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -113,12 +113,14 @@ class ViewerManifest(LLManifest): # no sourceid, no settings_install.xml file pass else: - # Single-entry subset of the LLSD content of settings.xml - content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers', - Persist=1, - Type='String', - Value=sourceid)) - self.put_in_file(llsd.format_pretty_xml(content), "settings_install.xml") + if len(sourceid) > 0: + print "Using sourceid: " + sourceid + # Single-entry subset of the LLSD content of settings.xml + content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers', + Persist=1, + Type='String', + Value=sourceid)) + self.put_in_file(llsd.format_pretty_xml(content), "settings_install.xml") self.end_prefix("app_settings") -- cgit v1.2.3 From d2386652f8a44c5adcc7fbcc65741649dd90aa2b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 25 Jul 2013 16:46:51 -0400 Subject: CHOP-962: Make LLControlVariable::setPersist() accept only enum. Initial change made LLControlVariable::mPersist an enum, but retained bool/BOOL public API. setPersist(true) set one value, setPersist(false) set another, forcePersist() set the third. Per code review, expose enum to public, make setPersist() (and LLControlVariable constructor, and LLControlGroup:: declareControl(), and all the LLControlGroup::declareMumble() methods, and all the unit-test dummy declareMumble() method bodies) accept that enum. Remove forcePersist(). Fix calls to LLControlGroup::declareMumble() accordingly. Also rename PERSIST_YES to PERSIST_NONDFT, also per code review. --- indra/newview/llagent.cpp | 2 +- indra/newview/llfloaterimnearbychat.cpp | 2 +- indra/newview/tests/llagentaccess_test.cpp | 12 ++++++------ indra/newview/tests/lllogininstance_test.cpp | 18 +++++++++--------- indra/newview/tests/llsecapi_test.cpp | 2 +- indra/newview/tests/llsechandler_basic_test.cpp | 2 +- indra/newview/tests/llslurl_test.cpp | 2 +- indra/newview/tests/llviewerhelputil_test.cpp | 2 +- indra/newview/tests/llviewernetwork_test.cpp | 2 +- indra/newview/tests/llxmlrpclistener_test.cpp | 4 ++-- 10 files changed, 24 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3e94c5edf7..05f3824485 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -433,7 +433,7 @@ void LLAgent::init() { mMoveTimer.start(); - gSavedSettings.declareBOOL("SlowMotionAnimation", FALSE, "Declared in code", FALSE); + gSavedSettings.declareBOOL("SlowMotionAnimation", FALSE, "Declared in code", LLControlVariable::PERSIST_NO); gSavedSettings.getControl("SlowMotionAnimation")->getSignal()->connect(boost::bind(&handleSlowMotionAnimation, _2)); // *Note: this is where LLViewerCamera::getInstance() used to be constructed. diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 56b0c15cb9..38592b3f65 100755 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -125,7 +125,7 @@ BOOL LLFloaterIMNearbyChat::postBuild() setTitle(LLTrans::getString("NearbyChatTitle")); // obsolete, but may be needed for backward compatibility? - gSavedSettings.declareS32("nearbychat_showicons_and_names", 2, "NearByChat header settings", true); + gSavedSettings.declareS32("nearbychat_showicons_and_names", 2, "NearByChat header settings", LLControlVariable::PERSIST_NONDFT); if (gSavedPerAccountSettings.getBOOL("LogShowHistory")) { diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index 1f379ead32..a40b5c9a3d 100755 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -49,7 +49,7 @@ LLControlGroup::~LLControlGroup() } // Implementation of just the LLControlGroup methods we requre -LLControlVariable* LLControlGroup::declareU32(const std::string& name, U32 initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareU32(const std::string& name, U32 initial_val, const std::string& comment, LLControlVariable::ePersist persist) { test_preferred_maturity = initial_val; return NULL; @@ -80,7 +80,7 @@ namespace tut void agentaccess_object_t::test<1>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); cgr.setU32("PreferredMaturity", SIM_ACCESS_PG); @@ -109,7 +109,7 @@ namespace tut void agentaccess_object_t::test<2>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); // make sure default is PG @@ -157,7 +157,7 @@ namespace tut void agentaccess_object_t::test<3>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); #ifndef HACKED_GODLIKE_VIEWER @@ -195,7 +195,7 @@ namespace tut void agentaccess_object_t::test<4>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); #ifndef HACKED_GODLIKE_VIEWER @@ -272,7 +272,7 @@ namespace tut void agentaccess_object_t::test<5>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index 4768d9351e..272a46aa8d 100755 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -175,8 +175,8 @@ F32 LLControlGroup::getF32(const std::string& name) { return 0.0f; } U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only) { return 1; } void LLControlGroup::setString(const std::string& name, const std::string& val) {} std::string LLControlGroup::getString(const std::string& name) { return "test_string"; } -LLControlVariable* LLControlGroup::declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, BOOL persist) { return NULL; } -LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, BOOL persist) { return NULL; } +LLControlVariable* LLControlGroup::declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return NULL; } +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return NULL; } #include "lluicolortable.h" void LLUIColorTable::saveUserSettings(void)const {} @@ -344,13 +344,13 @@ namespace tut gTOSReplyPump = 0; // clear the callback. - gSavedSettings.declareBOOL("NoInventoryLibrary", FALSE, "", FALSE); - gSavedSettings.declareBOOL("ConnectAsGod", FALSE, "", FALSE); - gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "", FALSE); - gSavedSettings.declareBOOL("ForceMandatoryUpdate", FALSE, "", FALSE); - gSavedSettings.declareString("ClientSettingsFile", "test_settings.xml", "", FALSE); - gSavedSettings.declareString("NextLoginLocation", "", "", FALSE); - gSavedSettings.declareBOOL("LoginLastLocation", FALSE, "", FALSE); + gSavedSettings.declareBOOL("NoInventoryLibrary", FALSE, "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareBOOL("ConnectAsGod", FALSE, "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareBOOL("ForceMandatoryUpdate", FALSE, "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareString("ClientSettingsFile", "test_settings.xml", "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareString("NextLoginLocation", "", "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareBOOL("LoginLastLocation", FALSE, "", LLControlVariable::PERSIST_NO); LLSD authenticator = LLSD::emptyMap(); LLSD identifier = LLSD::emptyMap(); diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index 05bac0e23b..d7e87ed52e 100755 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -42,7 +42,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return NULL;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string LLControlGroup::getString(const std::string& name) { diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index 3fbb45f8b4..2a8dc15346 100755 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -74,7 +74,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return NULL;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string LLControlGroup::getString(const std::string& name) { diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index a3735388df..86229ad636 100755 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -40,7 +40,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return NULL;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string gCmdLineLoginURI; diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 8e9cc7111b..f6456a2839 100755 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -52,7 +52,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return NULL;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string LLControlGroup::getString(const std::string& name) { diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index f80c02475d..06de1cbfa2 100755 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -40,7 +40,7 @@ LLControlGroup::~LLControlGroup() {} LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return NULL;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string gCmdLineLoginURI; diff --git a/indra/newview/tests/llxmlrpclistener_test.cpp b/indra/newview/tests/llxmlrpclistener_test.cpp index 711c2a3d51..20f913b670 100755 --- a/indra/newview/tests/llxmlrpclistener_test.cpp +++ b/indra/newview/tests/llxmlrpclistener_test.cpp @@ -62,8 +62,8 @@ namespace tut // These variables are required by machinery used by // LLXMLRPCTransaction. The values reflect reality for this test // executable; hopefully these values are correct. - gSavedSettings.declareBOOL("BrowserProxyEnabled", FALSE, "", FALSE); // don't persist - gSavedSettings.declareBOOL("NoVerifySSLCert", TRUE, "", FALSE); // don't persist + gSavedSettings.declareBOOL("BrowserProxyEnabled", FALSE, "", LLControlVariable::PERSIST_NO); // don't persist + gSavedSettings.declareBOOL("NoVerifySSLCert", TRUE, "", LLControlVariable::PERSIST_NO); // don't persist } // LLEventPump listener signature -- cgit v1.2.3 From c109361861a9f96566ae4acbc2b42e6afd5180bf Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 26 Jul 2013 08:58:47 -0400 Subject: CHOP-962: per code review, comment that other code relies on "Global". The comment advises grepping for "Global" rather than specifically pointing to llcontrol.cpp because that's NOT the only place that relies on the name "Global"! Besides, by the time someone does want to change the name, still other such dependencies could've crept in. --- indra/newview/llviewercontrol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index afbb59e723..744ec4de2b 100755 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -83,7 +83,9 @@ BOOL gHackGodmode = FALSE; #endif - +// Should you contemplate changing the name "Global", please first grep for +// that string literal. There are at least a couple other places in the C++ +// code that assume the LLControlGroup named "Global" is gSavedSettings. LLControlGroup gSavedSettings("Global"); // saved at end of session LLControlGroup gSavedPerAccountSettings("PerAccount"); // saved at end of session LLControlGroup gCrashSettings("CrashSettings"); // saved at end of session -- cgit v1.2.3 From a207b24d331539e16bd66ca09df3c585529c99f0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 26 Jul 2013 10:42:13 -0400 Subject: CHOP-955: Include app_settings/settings_install.xml in file_list. viewer_manifest.py uses its base-class llmanifest.LLManifest.put_in_file() method to create several different files in the install image being marshalled. I based the logic to create settings_install.xml on that example. Unfortunately I failed to notice that after every existing call, the script also explicitly appended the newly-created file to self.file_list... which only matters on Windows. file_list is fed to the NSIS installer. Change put_in_file() method to implicitly append to self.file_list. Change every existing viewer_manifest.py call to pass new put_in_file(src=) param instead of explicitly appending to self.file_list. --- indra/newview/viewer_manifest.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 827a8f44c3..b9da6c9280 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -71,13 +71,13 @@ class ViewerManifest(LLManifest): # include the entire shaders directory recursively self.path("shaders") # include the extracted list of contributors - contributor_names = self.extract_names("../../doc/contributions.txt") - self.put_in_file(contributor_names, "contributors.txt") - self.file_list.append(["../../doc/contributions.txt",self.dst_path_of("contributors.txt")]) + contributions_path = "../../doc/contributions.txt" + contributor_names = self.extract_names(contributions_path) + self.put_in_file(contributor_names, "contributors.txt", src=contributions_path) # include the extracted list of translators - translator_names = self.extract_names("../../doc/translations.txt") - self.put_in_file(translator_names, "translators.txt") - self.file_list.append(["../../doc/translations.txt",self.dst_path_of("translators.txt")]) + translations_path = "../../doc/translations.txt" + translator_names = self.extract_names(translations_path) + self.put_in_file(translator_names, "translators.txt", src=translations_path) # include the list of Lindens (if any) # see https://wiki.lindenlab.com/wiki/Generated_Linden_Credits linden_names_path = os.getenv("LINDEN_CREDITS") @@ -91,10 +91,9 @@ class ViewerManifest(LLManifest): else: # all names should be one line, but the join below also converts to a string linden_names = ', '.join(linden_file.readlines()) - self.put_in_file(linden_names, "lindens.txt") + self.put_in_file(linden_names, "lindens.txt", src=linden_names_path) linden_file.close() print "Linden names extracted from '%s'" % linden_names_path - self.file_list.append([linden_names_path,self.dst_path_of("lindens.txt")]) # ... and the entire windlight directory self.path("windlight") @@ -113,14 +112,18 @@ class ViewerManifest(LLManifest): # no sourceid, no settings_install.xml file pass else: - if len(sourceid) > 0: - print "Using sourceid: " + sourceid + if sourceid: # Single-entry subset of the LLSD content of settings.xml content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers', Persist=1, Type='String', Value=sourceid)) - self.put_in_file(llsd.format_pretty_xml(content), "settings_install.xml") + # put_in_file(src=) need not be an actual pathname; it + # only needs to be non-empty + settings_install = self.put_in_file(llsd.format_pretty_xml(content), + "settings_install.xml", + src="environment") + print "Put sourceid '%s' in %s" % (sourceid, settings_install) self.end_prefix("app_settings") -- cgit v1.2.3 From 32a953f65eae51850bad1b2c4c2a63d3dff12a68 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 2 Aug 2013 10:50:19 -0400 Subject: CHOP-959: Honor --graphicslevel switch even on first viewer run. Previous CHOP-959 logic set a flag to remember that settings variable RenderQualityPerformance was set (by --graphicslevel), so it could be applied once LLViewerWindow is constructed. But on first viewer run, LLViewerWindow constructor calls LLFeatureManager::applyRecommendedSettings(), which resets that settings variable! So don't just set a flag, actually capture the requested RenderQualityPerformance value for later. --- indra/newview/llappviewer.cpp | 26 +++++++++++++++++--------- indra/newview/llappviewer.h | 3 ++- 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 37f1f11451..6132e9b466 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -668,7 +668,6 @@ LLAppViewer::LLAppViewer() : mSecondInstance(false), mSavedFinalSnapshot(false), mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded. - mForceGraphicsDetail(false), mQuitRequested(false), mLogoutRequestSent(false), mYieldTime(-1), @@ -2563,11 +2562,19 @@ bool LLAppViewer::initConfiguration() if (clp.hasOption("graphicslevel")) { - // User explicitly requested --graphicslevel on the command line. - // We expect this switch has already set RenderQualityPerformance. - // Check that value for validity; if valid, we'll engage it later. - mForceGraphicsDetail = - LLFeatureManager::instance().isValidGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance")); + // User explicitly requested --graphicslevel on the command line. We + // expect this switch has already set RenderQualityPerformance. Check + // that value for validity. + U32 graphicslevel = gSavedSettings.getU32("RenderQualityPerformance"); + if (LLFeatureManager::instance().isValidGraphicsLevel(graphicslevel)) + { + // graphicslevel is valid: save it and engage it later. Capture + // the requested value separately from the settings variable + // because, if this is the first run, LLViewerWindow's constructor + // will call LLFeatureManager::applyRecommendedSettings(), which + // overwrites this settings variable! + mForceGraphicsLevel = graphicslevel; + } } LLFastTimerView::sAnalyzePerformance = gSavedSettings.getBOOL("AnalyzePerformance"); @@ -3125,11 +3132,12 @@ bool LLAppViewer::initWindow() // Initialize GL stuff // - if (mForceGraphicsDetail) + if (mForceGraphicsLevel) { - LLFeatureManager::getInstance()->setGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance"), false); + LLFeatureManager::getInstance()->setGraphicsLevel(*mForceGraphicsLevel, false); + gSavedSettings.setU32("RenderQualityPerformance", *mForceGraphicsLevel); } - + // Set this flag in case we crash while initializing GL gSavedSettings.setBOOL("RenderInitError", TRUE); gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index cd91ae8b2b..3af360b529 100755 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -32,6 +32,7 @@ #include "llsys.h" // for LLOSInfo #include "lltimer.h" #include "llappcorehttp.h" +#include class LLCommandLineParser; class LLFrameTimer; @@ -258,7 +259,7 @@ private: bool mSavedFinalSnapshot; bool mSavePerAccountSettings; // only save per account settings if login succeeded - bool mForceGraphicsDetail; + boost::optional mForceGraphicsLevel; bool mQuitRequested; // User wants to quit, may have modified documents open. bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. -- cgit v1.2.3 From 7f6e7fc0cb15d5367d48a3d8084d1a0b319575b7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 5 Aug 2013 19:43:06 -0400 Subject: CHOP-951, IQA-1477: Validate args for numeric command-line switches. The logic in llcommandlineparser.cpp's setControlValueCB() callback function for converting command-line switch argument values from string to the actual type of the map-to settings variable had a couple special cases for boolean and LLSD array. But for S32, U32 and F32, it simply used default LLSD string-to-numeric conversion. LLSD's string-to-numeric conversion is a bit lame: for non-numeric strings, it shrugs and returns 0. Introduce onevalue() and badvalue() helper functions that, like certain errors during command-line parsing, throw LLCLPError. Use them to streamline certain redundancies in setControlValueCB(). Introduce convertTo() helper function that uses boost::lexical_cast() for slightly more stringent conversions. Add cases for U32, S32 and F32 targets. setControlValueCB() is actually called only by LLControlGroupCLP::notify(), not during actual command-line parsing. Make LLControlGroupCLP::notify() return bool. Make it catch LLCLPError, set the error for getErrorMessage() and return false on that exception. Package LLAppViewer::initConfiguration()'s response to initParseCommandLine() returning false as a new handleCommandLineError() function; invoke it both there and when LLControlGroupCLP::notify() returns false. --- indra/newview/llappviewer.cpp | 28 +++++-- indra/newview/llcommandlineparser.cpp | 154 +++++++++++++++++++++++++++------- indra/newview/llcommandlineparser.h | 2 +- 3 files changed, 145 insertions(+), 39 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6132e9b466..b2aadf9cc0 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2306,6 +2306,20 @@ void LLAppViewer::loadColorSettings() LLUIColorTable::instance().loadFromSettings(); } +namespace +{ + void handleCommandLineError(LLControlGroupCLP& clp) + { + llwarns << "Error parsing command line options. Command Line options ignored." << llendl; + + llinfos << "Command line usage:\n" << clp << llendl; + + OSMessageBox(STRINGIZE(LLTrans::getString("MBCmdLineError") << clp.getErrorMessage()), + LLStringUtil::null, + OSMB_OK); + } +} // anonymous namespace + bool LLAppViewer::initConfiguration() { //Load settings files list @@ -2404,13 +2418,7 @@ bool LLAppViewer::initConfiguration() if(!initParseCommandLine(clp)) { - llwarns << "Error parsing command line options. Command Line options ignored." << llendl; - - llinfos << "Command line usage:\n" << clp << llendl; - - std::ostringstream msg; - msg << LLTrans::getString("MBCmdLineError") << clp.getErrorMessage(); - OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); + handleCommandLineError(clp); return false; } @@ -2457,7 +2465,11 @@ bool LLAppViewer::initConfiguration() loadSettingsFromDirectory("UserSession"); // - apply command line settings - clp.notify(); + if (! clp.notify()) + { + handleCommandLineError(clp); + return false; + } // Register the core crash option as soon as we can // if we want gdb post-mortem on cores we need to be up and running diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 7adc6b8c5e..a6384ded12 100755 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -38,6 +38,7 @@ #endif #include +#include #include #include #include @@ -48,10 +49,12 @@ #include "llsdserialize.h" #include "llerror.h" +#include "stringize.h" #include #include #include #include +#include #include "llcontrol.h" @@ -82,7 +85,7 @@ namespace po::options_description gOptionsDesc; po::positional_options_description gPositionalOptions; po::variables_map gVariableMap; - + const LLCommandLineParser::token_vector_t gEmptyValue; void read_file_into_string(std::string& str, const std::basic_istream < char >& file) @@ -400,9 +403,19 @@ bool LLCommandLineParser::parseCommandLineFile(const std::basic_istream < char > return parseCommandLineString(args); } -void LLCommandLineParser::notify() +bool LLCommandLineParser::notify() { - po::notify(gVariableMap); + try + { + po::notify(gVariableMap); + return true; + } + catch (const LLCLPError& e) + { + llwarns << "Caught Error: " << e.what() << llendl; + mErrorMsg = e.what(); + return false; + } } void LLCommandLineParser::printOptions() const @@ -444,43 +457,129 @@ const LLCommandLineParser::token_vector_t& LLCommandLineParser::getOption(const //---------------------------------------------------------------------------- // LLControlGroupCLP defintions //---------------------------------------------------------------------------- +namespace { +LLCommandLineParser::token_vector_t::value_type +onevalue(const std::string& option, + const LLCommandLineParser::token_vector_t& value) +{ + if (value.empty()) + { + // What does it mean when the user specifies a command-line switch + // that requires a value, but omits the value? Complain. + throw LLCLPError(STRINGIZE("No value specified for --" << option << "!")); + } + else if (value.size() > 1) + { + llwarns << "Ignoring extra tokens specified for --" + << option << "." << llendl; + } + return value[0]; +} + +void badvalue(const std::string& option, + const std::string& varname, + const std::string& type, + const std::string& value) +{ + // If the user passes an unusable value for a command-line switch, it + // seems like a really bad idea to just ignore it, even with a log + // warning. + throw LLCLPError(STRINGIZE("Invalid value specified by command-line switch '" << option + << "' for variable '" << varname << "' of type " << type + << ": '" << value << "'")); +} + +template +T convertTo(const std::string& option, + const std::string& varname, + const LLCommandLineParser::token_vector_t::value_type& value) +{ + try + { + return boost::lexical_cast(value); + } + catch (const boost::bad_lexical_cast&) + { + badvalue(option, varname, typeid(T).name(), value); + // bogus return; compiler unaware that badvalue() won't return + return T(); + } +} + void setControlValueCB(const LLCommandLineParser::token_vector_t& value, - const std::string& opt_name, - LLControlGroup* ctrlGroup) + const std::string& option, + LLControlVariable* ctrl) { - // *FIX: Do sematic conversion here. + // *FIX: Do semantic conversion here. // LLSD (ImplString) Is no good for doing string to type conversion for... // booleans // compound types // ?... - LLControlVariable* ctrl = ctrlGroup->getControl(opt_name); if(NULL != ctrl) { switch(ctrl->type()) { case TYPE_BOOLEAN: - if(value.size() > 1) + if (value.empty()) { - llwarns << "Ignoring extra tokens." << llendl; + // Boolean-valued command-line switches are unusual. If you + // simply specify the switch without an explicit value, we can + // infer you mean 'true'. + ctrl->setValue(LLSD(true), false); } - - if(value.size() > 0) + else { + // Only call onevalue() AFTER handling value.empty() case! + std::string token(onevalue(option, value)); + // There's a token. check the string for true/false/1/0 etc. BOOL result = false; - BOOL gotSet = LLStringUtil::convertToBOOL(value[0], result); - if(gotSet) + BOOL gotSet = LLStringUtil::convertToBOOL(token, result); + if (gotSet) { ctrl->setValue(LLSD(result), false); } + else + { + badvalue(option, ctrl->getName(), "bool", token); + } + } + break; + + case TYPE_U32: + { + std::string token(onevalue(option, value)); + // To my surprise, for an unsigned target, lexical_cast() doesn't + // complain about an input string such as "-17". In that case, you + // get a very large positive result. So for U32, make sure there's + // no minus sign! + if (token.find('-') == std::string::npos) + { + ctrl->setValue(LLSD::Integer(convertTo(option, ctrl->getName(), token)), + false); } else { - ctrl->setValue(LLSD(true), false); + badvalue(option, ctrl->getName(), "unsigned", token); } break; + } + + case TYPE_S32: + ctrl->setValue(convertTo(option, ctrl->getName(), + onevalue(option, value)), false); + break; + + case TYPE_F32: + ctrl->setValue(convertTo(option, ctrl->getName(), + onevalue(option, value)), false); + break; + // It appears that no one has yet tried to define a command-line + // switch mapped to a settings variable of TYPE_VEC3, TYPE_VEC3D, + // TYPE_RECT, TYPE_COL4, TYPE_COL3. Such types would certainly seem to + // call for a bit of special handling here... default: { // For the default types, let llsd do the conversion. @@ -497,16 +596,9 @@ void setControlValueCB(const LLCommandLineParser::token_vector_t& value, ctrl->setValue(llsdArray, false); } - else if(value.size() > 0) + else { - if(value.size() > 1) - { - llwarns << "Ignoring extra tokens mapped to the setting: " << opt_name << "." << llendl; - } - - LLSD llsdValue; - llsdValue.assign(LLSD::String(value[0])); - ctrl->setValue(llsdValue, false); + ctrl->setValue(onevalue(option, value), false); } } break; @@ -514,12 +606,14 @@ void setControlValueCB(const LLCommandLineParser::token_vector_t& value, } else { - llwarns << "Command Line option mapping '" - << opt_name - << "' not found! Ignoring." - << llendl; + // This isn't anything a user can affect -- it's a misconfiguration on + // the part of the coder. Rub the coder's nose in the problem right + // away so even preliminary testing will surface it. + llerrs << "Command Line option --" << option + << " maps to unknown setting!" << llendl; } } +} // anonymous namespace void LLControlGroupCLP::configure(const std::string& config_filename, LLControlGroup* controlGroup) { @@ -600,14 +694,14 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG << long_name << " (map-to " << controlName << ")" << llendl; } - if (! controlGroup->getControl(controlName)) + LLControlVariable* ctrl = controlGroup->getControl(controlName); + if (! ctrl) { llerrs << "Option " << long_name << " specifies map-to " << controlName << " which does not exist" << llendl; } - callback = boost::bind(setControlValueCB, _1, - controlName, controlGroup); + callback = boost::bind(setControlValueCB, _1, long_name, ctrl); } this->addOptionDesc( diff --git a/indra/newview/llcommandlineparser.h b/indra/newview/llcommandlineparser.h index 44f2a26843..71388b8217 100755 --- a/indra/newview/llcommandlineparser.h +++ b/indra/newview/llcommandlineparser.h @@ -86,7 +86,7 @@ public: * * Use this to handle the results of parsing. */ - void notify(); + bool notify(); /** @brief Print a description of the configured options. * -- cgit v1.2.3