diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/cmd_line.xml | 13 | ||||
-rw-r--r-- | indra/newview/app_settings/settings_files.xml | 5 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 84 | ||||
-rw-r--r-- | indra/newview/llappviewerlinux.cpp | 63 | ||||
-rw-r--r-- | indra/newview/llappviewerwin32.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llviewercontrol.cpp | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_setup.xml | 2 |
8 files changed, 73 insertions, 109 deletions
diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 89e5949fbe..15434f2b8f 100644 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -220,8 +220,7 @@ <map> <key>desc</key> <string>Set the detail level. - 0 - low, 1 - medium, 2 - high, 3 - ultra - </string> +0 - low, 1 - medium, 2 - high, 3 - ultra</string> <key>count</key> <integer>1</integer> </map> @@ -229,10 +228,7 @@ <key>setdefault</key> <map> <key>desc</key> - <string> specify the value of a particular - configuration variable which can be - overridden by settings.xml - </string> + <string>specify the value of a particular configuration variable which can be overridden by settings.xml.</string> <key>count</key> <integer>2</integer> <!-- Special case. Mapped to settings procedurally. --> @@ -241,10 +237,7 @@ <key>set</key> <map> <key>desc</key> - <string> specify the value of a particular - configuration variable that - overrides all other settings - </string> + <string>specify the value of a particular configuration variable that overrides all other settings.</string> <key>count</key> <integer>2</integer> <key>compose</key> diff --git a/indra/newview/app_settings/settings_files.xml b/indra/newview/app_settings/settings_files.xml index 079a54f957..bfc09286e3 100644 --- a/indra/newview/app_settings/settings_files.xml +++ b/indra/newview/app_settings/settings_files.xml @@ -20,7 +20,8 @@ file_name="settings.xml" file_name_setting="ClientSettingsFile"/> <file name="CrashSettings" - file_name="settings_crash_behavior"/> + file_name="settings_crash_behavior.xml" + file_name_setting="CrashSettingsFile"/> <file name="Warnings" file_name="ignorable_dialogs.xml" file_name_setting="WarningSettingsFile"/> @@ -61,4 +62,4 @@ file_name="colors.xml" file_name_setting="SkinningSettingsFile"/> </group> -</settings_files>
\ No newline at end of file +</settings_files> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 80ac385e3b..92e0513464 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -469,18 +469,6 @@ void request_initial_instant_messages() } } -// A settings system callback for CrashSubmitBehavior -bool handleCrashSubmitBehaviorChanged(const LLSD& newvalue) -{ - S32 cb = newvalue.asInteger(); - const S32 NEVER_SUBMIT_REPORT = 2; - if(cb == NEVER_SUBMIT_REPORT) - { - LLAppViewer::instance()->destroyMainloopTimeout(); - } - return true; -} - // Use these strictly for things that are constructed at startup, // or for things that are performance critical. JC static void settings_to_globals() @@ -612,9 +600,6 @@ bool LLAppViewer::sendURLToOtherInstance(const std::string& url) // Static members. // The single viewer app. LLAppViewer* LLAppViewer::sInstance = NULL; - -const std::string LLAppViewer::sGlobalSettingsName = "Global"; - LLTextureCache* LLAppViewer::sTextureCache = NULL; LLImageDecodeThread* LLAppViewer::sImageDecodeThread = NULL; LLTextureFetch* LLAppViewer::sTextureFetch = NULL; @@ -772,16 +757,6 @@ bool LLAppViewer::init() LL_INFOS("InitInfo") << "J2C Engine is: " << LLImageJ2C::getEngineInfo() << LL_ENDL; LL_INFOS("InitInfo") << "libcurl version is: " << LLCurl::getVersionString() << LL_ENDL; - // Get the single value from the crash settings file, if it exists - std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); - gCrashSettings.loadFromFile(crash_settings_filename); - if(gSavedSettings.getBOOL("IgnoreAllNotifications")) - { - gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ALWAYS_SEND); - gCrashSettings.saveToFile(crash_settings_filename, FALSE); - } - LL_INFOS("InitInfo") << "Crash settings done." << LL_ENDL ; - ///////////////////////////////////////////////// // OS-specific login dialogs ///////////////////////////////////////////////// @@ -1056,7 +1031,7 @@ bool LLAppViewer::init() //EXT-7013 - On windows for some locale (Japanese) standard //datetime formatting functions didn't support some parameters such as "weekday". //Names for days and months localized in xml are also useful for Polish locale(STORM-107). - std::string language = LLControlGroup::getInstance(sGlobalSettingsName)->getString("Language"); + std::string language = gSavedSettings.getString("Language"); if(language == "ja" || language == "pl") { LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames")); @@ -1709,10 +1684,6 @@ bool LLAppViewer::cleanup() llinfos << "Saved settings" << llendflush; } - std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); - // save all settings, even if equals defaults - gCrashSettings.saveToFile(crash_settings_filename, FALSE); - std::string warnings_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Warnings")); gWarningSettings.saveToFile(warnings_settings_filename, TRUE); @@ -1842,7 +1813,6 @@ bool LLAppViewer::cleanup() gSavedSettings.cleanup(); LLUIColorTable::instance().clear(); - gCrashSettings.cleanup(); LLWatchdog::getInstance()->cleanup(); @@ -1985,7 +1955,6 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, llerrs << "Invalid settings location list" << llendl; } - LLControlGroup* global_settings = LLControlGroup::getInstance(sGlobalSettingsName); for(LLInitParam::ParamIterator<SettingsGroup>::const_iterator it = mSettingsLocationList->groups.begin(), end_it = mSettingsLocationList->groups.end(); it != end_it; ++it) @@ -2018,11 +1987,15 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, std::string full_settings_path; if (file_it->file_name_setting.isProvided() - && global_settings->controlExists(file_it->file_name_setting)) + && gSavedSettings.controlExists(file_it->file_name_setting)) { // try to find filename stored in file_name_setting control - full_settings_path = global_settings->getString(file_it->file_name_setting); - if (!gDirUtilp->fileExists(full_settings_path)) + full_settings_path = gSavedSettings.getString(file_it->file_name_setting); + if (full_settings_path.empty()) + { + continue; + } + else if (!gDirUtilp->fileExists(full_settings_path)) { // search in default path full_settings_path = gDirUtilp->getExpandedFilename((ELLPath)path_index, full_settings_path); @@ -2168,8 +2141,6 @@ bool LLAppViewer::initConfiguration() gSavedSettings.setS32("WatchdogEnabled", 0); #endif - gCrashSettings.getControl(CRASH_BEHAVIOR_SETTING)->getSignal()->connect(boost::bind(&handleCrashSubmitBehaviorChanged, _2)); - // These are warnings that appear on the first experience of that condition. // They are already set in the settings_default.xml file, but still need to be added to LLFirstUse // for disable/reset ability @@ -2300,15 +2271,33 @@ bool LLAppViewer::initConfiguration() { const std::string& name = *itr; const std::string& value = *(++itr); - LLControlVariable* c = LLControlGroup::getInstance(sGlobalSettingsName)->getControl(name); - if(c) + std::string name_part; + std::string group_part; + LLControlVariable* control = NULL; + + // Name can be further split into ControlGroup.Name, with the default control group being Global + size_t pos = name.find('.'); + if (pos != std::string::npos) + { + group_part = name.substr(0, pos); + name_part = name.substr(pos+1); + llinfos << "Setting " << group_part << "." << name_part << " to " << value << llendl; + LLControlGroup* g = LLControlGroup::getInstance(group_part); + if (g) control = g->getControl(name_part); + } + else + { + llinfos << "Setting Global." << name << " to " << value << llendl; + control = gSavedSettings.getControl(name); + } + + if (control) { - c->setValue(value, false); + control->setValue(value, false); } else { - llwarns << "'--set' specified with unknown setting: '" - << name << "'." << llendl; + llwarns << "Failed --set " << name << ": setting name unknown." << llendl; } } } @@ -2765,7 +2754,8 @@ void LLAppViewer::checkForCrash(void) // Pop up a freeze or crash warning dialog // S32 choice; - if(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING) == CRASH_BEHAVIOR_ASK) + const S32 cb = gCrashSettings.getS32("CrashSubmitBehavior"); + if(cb == CRASH_BEHAVIOR_ASK) { std::ostringstream msg; msg << LLTrans::getString("MBFrozenCrashed"); @@ -2774,7 +2764,7 @@ void LLAppViewer::checkForCrash(void) alert, OSMB_YESNO); } - else if(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING) == CRASH_BEHAVIOR_NEVER_SEND) + else if(cb == CRASH_BEHAVIOR_NEVER_SEND) { choice = OSBTN_NO; } @@ -2831,10 +2821,9 @@ bool LLAppViewer::initWindow() LL_INFOS("AppInit") << "gViewerwindow created." << LL_ENDL; // Need to load feature table before cheking to start watchdog. - const S32 NEVER_SUBMIT_REPORT = 2; bool use_watchdog = false; int watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled"); - if(watchdog_enabled_setting == -1) + if (watchdog_enabled_setting == -1) { use_watchdog = !LLFeatureManager::getInstance()->isFeatureAvailable("WatchdogDisabled"); } @@ -2844,8 +2833,7 @@ bool LLAppViewer::initWindow() use_watchdog = bool(watchdog_enabled_setting); } - bool send_reports = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING) != NEVER_SUBMIT_REPORT; - if(use_watchdog && send_reports) + if (use_watchdog) { LLWatchdog::getInstance()->init(watchdog_killer_callback); } diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index 714e0e6163..48d02dfeaa 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -361,46 +361,35 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze) } else { - const S32 cb = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); - - // Always generate the report, have the logger do the asking, and - // don't wait for the logger before exiting (-> total cleanup). - if (CRASH_BEHAVIOR_NEVER_SEND != cb) - { - // launch the actual crash logger - const char* ask_dialog = "-dialog"; - if (CRASH_BEHAVIOR_ASK != cb) - ask_dialog = ""; // omit '-dialog' option - const char * cmdargv[] = - {cmd.c_str(), - ask_dialog, - "-user", - (char*)LLGridManager::getInstance()->getGridLabel().c_str(), - "-name", - LLAppViewer::instance()->getSecondLifeTitle().c_str(), - NULL}; - fflush(NULL); - pid_t pid = fork(); - if (pid == 0) - { // child - execv(cmd.c_str(), (char* const*) cmdargv); /* Flawfinder: ignore */ - llwarns << "execv failure when trying to start " << cmd << llendl; - _exit(1); // avoid atexit() + // launch the actual crash logger + const char * cmdargv[] = + {cmd.c_str(), + "-user", + (char*)LLGridManager::getInstance()->getGridLabel().c_str(), + "-name", + LLAppViewer::instance()->getSecondLifeTitle().c_str(), + NULL}; + fflush(NULL); + pid_t pid = fork(); + if (pid == 0) + { // child + execv(cmd.c_str(), (char* const*) cmdargv); /* Flawfinder: ignore */ + llwarns << "execv failure when trying to start " << cmd << llendl; + _exit(1); // avoid atexit() + } + else + { + if (pid > 0) + { + // DO NOT wait for child proc to die; we want + // the logger to outlive us while we quit to + // free up the screen/keyboard/etc. + ////int childExitStatus; + ////waitpid(pid, &childExitStatus, 0); } else { - if (pid > 0) - { - // DO NOT wait for child proc to die; we want - // the logger to outlive us while we quit to - // free up the screen/keyboard/etc. - ////int childExitStatus; - ////waitpid(pid, &childExitStatus, 0); - } - else - { - llwarns << "fork failure." << llendl; - } + llwarns << "fork failure." << llendl; } } // Sometimes signals don't seem to quit the viewer. Also, we may diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 445bd208ef..f94c843ad9 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -518,11 +518,7 @@ void LLAppViewerWin32::handleCrashReporting(bool reportFreeze) } else { - S32 cb = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); - if(cb != CRASH_BEHAVIOR_NEVER_SEND) - { - _spawnl(_P_NOWAIT, exe_path.c_str(), arg_str, NULL); - } + _spawnl(_P_NOWAIT, exe_path.c_str(), arg_str, NULL); } } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7848484ac6..5fd262a720 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -751,10 +751,7 @@ void LLFloaterPreference::onBtnOK() closeFloater(false); LLUIColorTable::instance().saveUserSettings(); - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); - std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); - // save all settings, even if equals defaults - gCrashSettings.saveToFile(crash_settings_filename, FALSE); + gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); } else { diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 87ca80260f..b87ca1eaec 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -566,7 +566,7 @@ bool toggle_show_object_render_cost(const LLSD& newvalue) return true; } -void toggle_updater_service_active(LLControlVariable* control, const LLSD& new_value) +void toggle_updater_service_active(const LLSD& new_value) { if(new_value.asInteger()) { @@ -735,7 +735,7 @@ void settings_setup_listeners() gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2)); gSavedSettings.getControl("ShowMiniLocationPanel")->getSignal()->connect(boost::bind(&toggle_show_mini_location_panel, _2)); gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2)); - gSavedSettings.getControl("UpdaterServiceSetting")->getSignal()->connect(&toggle_updater_service_active); + gSavedSettings.getControl("UpdaterServiceSetting")->getSignal()->connect(boost::bind(&toggle_updater_service_active, _2)); gSavedSettings.getControl("ForceShowGrid")->getSignal()->connect(boost::bind(&handleForceShowGrid, _2)); gSavedSettings.getControl("RenderTransparentWater")->getSignal()->connect(boost::bind(&handleRenderTransparentWaterChanged, _2)); } diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 1c22a5c02e..e639f0dc9d 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -268,7 +268,7 @@ height="23" layout="topleft" left_delta="50" - top_pad="5" + top_pad="5" name="updater_service_combobox" width="300"> <combo_box.item |