aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:59 -0500
committerJacek Antonelli2008-08-15 23:45:59 -0500
commit6e91a9cc3d5a610198cf526a76e2ab642f10ecd7 (patch)
treeb023869f9daa7f61ea3ab27112d37524bdd88de4 /linden/indra/newview/llappviewer.cpp
parentSecond Life viewer sources 1.20.12 (diff)
downloadmeta-impy-6e91a9cc3d5a610198cf526a76e2ab642f10ecd7.zip
meta-impy-6e91a9cc3d5a610198cf526a76e2ab642f10ecd7.tar.gz
meta-impy-6e91a9cc3d5a610198cf526a76e2ab642f10ecd7.tar.bz2
meta-impy-6e91a9cc3d5a610198cf526a76e2ab642f10ecd7.tar.xz
Second Life viewer sources 1.20.13
Diffstat (limited to 'linden/indra/newview/llappviewer.cpp')
-rw-r--r--linden/indra/newview/llappviewer.cpp72
1 files changed, 39 insertions, 33 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index 1ec2c14..6e8528c 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -621,6 +621,9 @@ bool LLAppViewer::init()
621 // Need to do this initialization before we do anything else, since anything 621 // Need to do this initialization before we do anything else, since anything
622 // that touches files should really go through the lldir API 622 // that touches files should really go through the lldir API
623 gDirUtilp->initAppDirs("SecondLife"); 623 gDirUtilp->initAppDirs("SecondLife");
624 // set skin search path to default, will be overridden later
625 // this allows simple skinned file lookups to work
626 gDirUtilp->setSkinFolder("default");
624 627
625 initLogging(); 628 initLogging();
626 629
@@ -684,6 +687,8 @@ bool LLAppViewer::init()
684 */ 687 */
685#endif 688#endif
686 689
690 //test_cached_control();
691
687 // track number of times that app has run 692 // track number of times that app has run
688 mNumSessions = gSavedSettings.getS32("NumSessions"); 693 mNumSessions = gSavedSettings.getS32("NumSessions");
689 mNumSessions++; 694 mNumSessions++;
@@ -697,12 +702,12 @@ bool LLAppViewer::init()
697 } 702 }
698 703
699 // Load art UUID information, don't require these strings to be declared in code. 704 // Load art UUID information, don't require these strings to be declared in code.
700 LLString colors_base_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors_base.xml"); 705 LLString colors_base_filename = gDirUtilp->findSkinnedFilename("colors_base.xml");
701 LL_DEBUGS("InitInfo") << "Loading base colors from " << colors_base_filename << LL_ENDL; 706 LL_DEBUGS("InitInfo") << "Loading base colors from " << colors_base_filename << LL_ENDL;
702 gColors.loadFromFileLegacy(colors_base_filename.c_str(), FALSE, TYPE_COL4U); 707 gColors.loadFromFileLegacy(colors_base_filename.c_str(), FALSE, TYPE_COL4U);
703 708
704 // Load overrides from user colors file 709 // Load overrides from user colors file
705 LLString user_colors_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors.xml"); 710 LLString user_colors_filename = gDirUtilp->findSkinnedFilename("colors.xml");
706 LL_DEBUGS("InitInfo") << "Loading user colors from " << user_colors_filename << LL_ENDL; 711 LL_DEBUGS("InitInfo") << "Loading user colors from " << user_colors_filename << LL_ENDL;
707 if (gColors.loadFromFileLegacy(user_colors_filename.c_str(), FALSE, TYPE_COL4U) == 0) 712 if (gColors.loadFromFileLegacy(user_colors_filename.c_str(), FALSE, TYPE_COL4U) == 0)
708 { 713 {
@@ -1474,7 +1479,7 @@ bool LLAppViewer::initLogging()
1474 return true; 1479 return true;
1475} 1480}
1476 1481
1477void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index) 1482void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_defaults)
1478{ 1483{
1479 for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr) 1484 for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr)
1480 { 1485 {
@@ -1507,7 +1512,7 @@ void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index)
1507 llwarns << "Cannot load " << settings_file << " - No matching settings group for name " << settings_name << llendl; 1512 llwarns << "Cannot load " << settings_file << " - No matching settings group for name " << settings_name << llendl;
1508 continue; 1513 continue;
1509 } 1514 }
1510 if(!gSettings[settings_name]->loadFromFile(full_settings_path)) 1515 if(!gSettings[settings_name]->loadFromFile(full_settings_path, set_defaults))
1511 { 1516 {
1512 llwarns << "Cannot load " << full_settings_path << " - No settings found." << llendl; 1517 llwarns << "Cannot load " << full_settings_path << " - No settings found." << llendl;
1513 } 1518 }
@@ -1556,7 +1561,8 @@ bool LLAppViewer::initConfiguration()
1556 // - load per account settings (happens in llstartup 1561 // - load per account settings (happens in llstartup
1557 1562
1558 // - load defaults 1563 // - load defaults
1559 loadSettingsFromDirectory(LL_PATH_APP_SETTINGS); 1564 bool set_defaults = true;
1565 loadSettingsFromDirectory(LL_PATH_APP_SETTINGS, set_defaults);
1560 1566
1561 // - set procedural settings 1567 // - set procedural settings
1562 gSavedSettings.setString("ClientSettingsFile", 1568 gSavedSettings.setString("ClientSettingsFile",
@@ -1820,7 +1826,7 @@ bool LLAppViewer::initConfiguration()
1820 } 1826 }
1821 } 1827 }
1822 1828
1823 const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinFolder"); 1829 const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent");
1824 if(skinfolder && LLString::null != skinfolder->getValue().asString()) 1830 if(skinfolder && LLString::null != skinfolder->getValue().asString())
1825 { 1831 {
1826 gDirUtilp->setSkinFolder(skinfolder->getValue().asString()); 1832 gDirUtilp->setSkinFolder(skinfolder->getValue().asString());
@@ -1832,33 +1838,33 @@ bool LLAppViewer::initConfiguration()
1832 gSecondLife = "Second Life"; 1838 gSecondLife = "Second Life";
1833 1839
1834 // Read skin/branding settings if specified. 1840 // Read skin/branding settings if specified.
1835 if (! gDirUtilp->getSkinDir().empty() ) 1841 //if (! gDirUtilp->getSkinDir().empty() )
1836 { 1842 //{
1837 std::string skin_def_file = gDirUtilp->getExpandedFilename(LL_PATH_TOP_SKIN, "skin.xml"); 1843 // std::string skin_def_file = gDirUtilp->findSkinnedFilename("skin.xml");
1838 LLXmlTree skin_def_tree; 1844 // LLXmlTree skin_def_tree;
1839 1845
1840 if (!skin_def_tree.parseFile(skin_def_file)) 1846 // if (!skin_def_tree.parseFile(skin_def_file))
1841 { 1847 // {
1842 llerrs << "Failed to parse skin definition." << llendl; 1848 // llerrs << "Failed to parse skin definition." << llendl;
1843 } 1849 // }
1844 1850
1845 LLXmlTreeNode* rootp = skin_def_tree.getRoot(); 1851 // LLXmlTreeNode* rootp = skin_def_tree.getRoot();
1846 LLXmlTreeNode* disabled_message_node = rootp->getChildByName("disabled_message"); 1852 // LLXmlTreeNode* disabled_message_node = rootp->getChildByName("disabled_message");
1847 if (disabled_message_node) 1853 // if (disabled_message_node)
1848 { 1854 // {
1849 gDisabledMessage = disabled_message_node->getContents(); 1855 // gDisabledMessage = disabled_message_node->getContents();
1850 } 1856 // }
1851 1857
1852 static LLStdStringHandle hide_links_string = LLXmlTree::addAttributeString("hide_links"); 1858 // static LLStdStringHandle hide_links_string = LLXmlTree::addAttributeString("hide_links");
1853 rootp->getFastAttributeBOOL(hide_links_string, gHideLinks); 1859 // rootp->getFastAttributeBOOL(hide_links_string, gHideLinks);
1854 1860
1855 // Legacy string. This flag really meant we didn't want to expose references to "Second Life". 1861 // // Legacy string. This flag really meant we didn't want to expose references to "Second Life".
1856 // Just set gHideLinks instead. 1862 // // Just set gHideLinks instead.
1857 static LLStdStringHandle silent_string = LLXmlTree::addAttributeString("silent_update"); 1863 // static LLStdStringHandle silent_string = LLXmlTree::addAttributeString("silent_update");
1858 BOOL silent_update; 1864 // BOOL silent_update;
1859 rootp->getFastAttributeBOOL(silent_string, silent_update); 1865 // rootp->getFastAttributeBOOL(silent_string, silent_update);
1860 gHideLinks = (gHideLinks || silent_update); 1866 // gHideLinks = (gHideLinks || silent_update);
1861 } 1867 //}
1862 1868
1863#if LL_DARWIN 1869#if LL_DARWIN
1864 // Initialize apple menubar and various callbacks 1870 // Initialize apple menubar and various callbacks