summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorLogan Dethrow <log@lindenlab.com>2011-07-19 15:06:56 -0400
committerLogan Dethrow <log@lindenlab.com>2011-07-19 15:06:56 -0400
commit0f501293bdf5498369e5b6e4409cfdc758366d9e (patch)
treee8cd32ff25f2ef00d43a69491a37a3b59f169e85 /indra/newview/llappviewer.cpp
parent792667ff8ef13e16823d96b490ea9a4f498425ea (diff)
parent4dc0850da7469906e5ad052da71830b05005295b (diff)
merge
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp86
1 files changed, 37 insertions, 49 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 3e9ff4d3a7..866fdb97cb 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -470,18 +470,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()
@@ -613,9 +601,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;
@@ -773,16 +758,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
/////////////////////////////////////////////////
@@ -1057,7 +1032,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"));
@@ -1710,10 +1685,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);
@@ -1843,7 +1814,6 @@ bool LLAppViewer::cleanup()
gSavedSettings.cleanup();
LLUIColorTable::instance().clear();
- gCrashSettings.cleanup();
LLWatchdog::getInstance()->cleanup();
@@ -1988,7 +1958,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)
@@ -2021,11 +1990,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);
@@ -2171,8 +2144,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
@@ -2303,15 +2274,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;
}
}
}
@@ -2768,7 +2757,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");
@@ -2777,7 +2767,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;
}
@@ -2834,10 +2824,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");
}
@@ -2847,8 +2836,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);
}
@@ -4519,7 +4507,7 @@ void LLAppViewer::idleShutdown()
void LLAppViewer::sendLogoutRequest()
{
- if(!mLogoutRequestSent)
+ if(!mLogoutRequestSent && gMessageSystem)
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_LogoutRequest);