diff options
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r-- | indra/newview/llstartup.cpp | 192 |
1 files changed, 83 insertions, 109 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index eb2275bff0..025dd6029a 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -67,6 +67,7 @@ #include "llmemorystream.h" #include "llmessageconfig.h" #include "llmoveview.h" +#include "llnearbychat.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llteleporthistory.h" @@ -100,8 +101,7 @@ #include "lleventnotifier.h" #include "llface.h" #include "llfeaturemanager.h" -#include "llfirstuse.h" -#include "llfloaterchat.h" +//#include "llfirstuse.h" #include "llfloaterhud.h" #include "llfloaterland.h" #include "llfloaterpreference.h" @@ -121,9 +121,8 @@ #include "lllogininstance.h" // Host the login module. #include "llpanellogin.h" #include "llmutelist.h" -#include "llpanelavatar.h" #include "llavatarpropertiesprocessor.h" -#include "llpanelevent.h" +#include "llfloaterevent.h" #include "llpanelclassified.h" #include "llpanelpick.h" #include "llpanelplace.h" @@ -135,13 +134,14 @@ #include "llsecondlifeurls.h" #include "llselectmgr.h" #include "llsky.h" +#include "llsidetray.h" #include "llstatview.h" -#include "lltrans.h" #include "llstatusbar.h" // sendMoneyBalanceRequest(), owns L$ balance #include "llsurface.h" #include "lltexturecache.h" #include "lltexturefetch.h" #include "lltoolmgr.h" +#include "lltrans.h" #include "llui.h" #include "llurldispatcher.h" #include "llurlsimstring.h" @@ -199,10 +199,6 @@ #include "lldxhardware.h" #endif -#if (LL_LINUX || LL_SOLARIS) && LL_GTK -#include <glib/gspawn.h> -#endif - // // exported globals // @@ -308,59 +304,6 @@ void update_texture_fetch() gTextureList.updateImages(0.10f); } -//Copies landmarks from the "Library" to "My Favorites" -void populate_favorites_bar() -{ - //*TODO consider extending LLInventoryModel::findCategoryUUIDForType(...) to support both root's - LLInventoryModel::cat_array_t* lib_cats = NULL; - LLInventoryModel::item_array_t* lib_items = NULL; - gInventory.getDirectDescendentsOf(gInventory.getLibraryRootFolderID(), lib_cats, lib_items); - if (!lib_cats) return; - - LLUUID lib_landmarks(LLUUID::null); - S32 count = lib_cats->count(); - for(S32 i = 0; i < count; ++i) - { - if(lib_cats->get(i)->getPreferredType() == LLFolderType::FT_LANDMARK) - { - lib_landmarks = lib_cats->get(i)->getUUID(); - break; - } - } - if (lib_landmarks.isNull()) - { - llerror("Library inventory is missing Landmarks", 0); - return; - } - - LLInventoryModel::cat_array_t* lm_cats = NULL; - LLInventoryModel::item_array_t* lm_items = NULL; - gInventory.getDirectDescendentsOf(lib_landmarks, lm_cats, lm_items); - if (!lm_items) return; - - const LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); - if (favorites_id.isNull()) - { - llerror("My Inventory is missing My Favorites", 0); - return; - } - - S32 lm_count = lm_items->count(); - for (S32 i = 0; i < lm_count; ++i) - { - LLInventoryItem* item = lm_items->get(i); - if (item->getUUID().isNull()) continue; - - copy_inventory_item(gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - favorites_id, - std::string(), - LLPointer<LLInventoryCallback>(NULL)); - } -} - - // Returns false to skip other idle processing. Should only return // true when all initialization done. bool idle_startup() @@ -853,6 +796,9 @@ bool idle_startup() gLoginMenuBarView->setVisible( TRUE ); gLoginMenuBarView->setEnabled( TRUE ); + // Hide the splash screen + LLSplashScreen::hide(); + // Push our window frontmost gViewerWindow->getWindow()->show(); display_startup(); @@ -920,9 +866,9 @@ bool idle_startup() // create necessary directories // *FIX: these mkdir's should error check gDirUtilp->setLindenUserDir(gFirstname, gLastname); - LLFile::mkdir(gDirUtilp->getLindenUserDir()); - - // Set PerAccountSettingsFile to the default value. + LLFile::mkdir(gDirUtilp->getLindenUserDir()); + + // Set PerAccountSettingsFile to the default value. gSavedSettings.setString("PerAccountSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount"))); @@ -958,14 +904,8 @@ bool idle_startup() LLFile::mkdir(gDirUtilp->getChatLogsDir()); LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); - // chat history must be loaded AFTER chat directories are defined. - if (!gNoRender && gSavedPerAccountSettings.getBOOL("LogShowHistory")) - { - LLFloaterChat::loadHistory(); - } - - - //good as place as any to create user windlight directories + + //good a place as any to create user windlight directories std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", "")); LLFile::mkdir(user_windlight_path_name.c_str()); @@ -1257,6 +1197,7 @@ bool idle_startup() display_startup(); LLStartUp::setStartupState( STATE_MULTIMEDIA_INIT ); + return FALSE; } @@ -1309,6 +1250,7 @@ bool idle_startup() // Move the progress view in front of the UI gViewerWindow->moveProgressViewToFront(); + // direct logging to the debug console's line buffer LLError::logToFixedBuffer(gDebugView->mDebugConsolep); // set initial visibility of debug console @@ -1344,6 +1286,14 @@ bool idle_startup() LLAppViewer::instance()->loadNameCache(); } + //gCacheName is required for nearby chat history loading + //so I just moved nearby history loading a few states further + if (!gNoRender && gSavedPerAccountSettings.getBOOL("LogShowHistory")) + { + LLNearbyChat* nearby_chat = LLNearbyChat::getInstance(); + if (nearby_chat) nearby_chat->loadHistory(); + } + // *Note: this is where gWorldMap used to be initialized. // register null callbacks for audio until the audio system is initialized @@ -1712,12 +1662,6 @@ bool idle_startup() llinfos << "Creating Inventory Views" << llendl; LLFloaterReg::getInstance("inventory"); - //default initial content for Favorites Bar - if (gAgent.isFirstLogin()) - { - populate_favorites_bar(); - } - LLStartUp::setStartupState( STATE_MISC ); return FALSE; } @@ -1756,6 +1700,13 @@ bool idle_startup() << " kbps" << LL_ENDL; gViewerThrottle.setMaxBandwidth(FAST_RATE_BPS / 1024.f); } + + // Set the show start location to true, now that the user has logged + // on with this install. + gSavedSettings.setBOOL("ShowStartLocation", TRUE); + + LLSideTray::getInstance()->showPanel("panel_home", LLSD()); + } // We're successfully logged in. @@ -1915,21 +1866,6 @@ bool idle_startup() LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); } - - // We now have an inventory skeleton, so if this is a user's first - // login, we can start setting up their clothing and avatar - // appearance. This helps to avoid the generic "Ruth" avatar in - // the orientation island tutorial experience. JC - if (gAgent.isFirstLogin() - && !sInitialOutfit.empty() // registration set up an outfit - && !sInitialOutfitGender.empty() // and a gender - && gAgent.getAvatarObject() // can't wear clothes without object - && !gAgent.isGenderChosen() ) // nothing already loading - { - // Start loading the wearables, textures, gestures - LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); - } - // wait precache-delay and for agent's avatar or a lot longer. if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) || (timeout_frac > 3.f)) @@ -1949,7 +1885,7 @@ bool idle_startup() LLViewerShaderMgr::instance()->setShaders(); } } - + return TRUE; } @@ -2532,7 +2468,7 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFunc("MapBlockReply", LLWorldMapMessage::processMapBlockReply); msg->setHandlerFunc("MapItemReply", LLWorldMapMessage::processMapItemReply); - msg->setHandlerFunc("EventInfoReply", LLPanelEvent::processEventInfoReply); + msg->setHandlerFunc("EventInfoReply", LLFloaterEvent::processEventInfoReply); msg->setHandlerFunc("PickInfoReply", &LLAvatarPropertiesProcessor::processPickInfoReply); // msg->setHandlerFunc("ClassifiedInfoReply", LLPanelClassified::processClassifiedInfoReply); msg->setHandlerFunc("ClassifiedInfoReply", LLAvatarPropertiesProcessor::processClassifiedInfoReply); @@ -2592,6 +2528,13 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response) void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ) { + llinfos << "starting" << llendl; + + // Not going through the processAgentInitialWearables path, so need to set this here. + LLAppearanceManager::instance().setAttachmentInvLinkEnable(true); + // Initiate creation of COF, since we're also bypassing that. + gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); + S32 gender = 0; std::string gestures; if (gender_name == "male") @@ -2607,24 +2550,53 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, // try to find the outfit - if not there, create some default // wearables. - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - LLNameCategoryCollector has_name(outfit_folder_name); - gInventory.collectDescendentsIf(LLUUID::null, - cat_array, - item_array, - LLInventoryModel::EXCLUDE_TRASH, - has_name); - if (0 == cat_array.count()) + LLUUID cat_id = findDescendentCategoryIDByName( + gInventory.getLibraryRootFolderID(), + outfit_folder_name); + if (cat_id.isNull()) { gAgentWearables.createStandardWearables(gender); } else { - LLAppearanceManager::instance().wearOutfitByName(outfit_folder_name); + bool do_copy = true; + bool do_append = false; + LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); + LLAppearanceManager::instance().wearInventoryCategory(cat, do_copy, do_append); + } + + // Copy gestures + LLUUID dst_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE); + LLPointer<LLInventoryCallback> cb(NULL); + LLAppearanceManager *app_mgr = &(LLAppearanceManager::instance()); + + // - Copy gender-specific gestures. + LLUUID gestures_cat_id = findDescendentCategoryIDByName( + gInventory.getLibraryRootFolderID(), + gestures); + if (gestures_cat_id.notNull()) + { + callAfterCategoryFetch(gestures_cat_id, + boost::bind(&LLAppearanceManager::shallowCopyCategory, + app_mgr, + gestures_cat_id, + dst_id, + cb)); + } + + // - Copy common gestures. + LLUUID common_gestures_cat_id = findDescendentCategoryIDByName( + gInventory.getLibraryRootFolderID(), + COMMON_GESTURES_FOLDER); + if (common_gestures_cat_id.notNull()) + { + callAfterCategoryFetch(common_gestures_cat_id, + boost::bind(&LLAppearanceManager::shallowCopyCategory, + app_mgr, + common_gestures_cat_id, + dst_id, + cb)); } - LLAppearanceManager::instance().wearOutfitByName(gestures); - LLAppearanceManager::instance().wearOutfitByName(COMMON_GESTURES_FOLDER); // This is really misnamed -- it means we have started loading // an outfit/shape that will give the avatar a gender eventually. JC @@ -2922,7 +2894,9 @@ bool process_login_success_response() text = response["agent_region_access"].asString(); if (!text.empty()) { - int preferredMaturity = LLAgent::convertTextToMaturity(text[0]); + U32 preferredMaturity = + llmin((U32)LLAgent::convertTextToMaturity(text[0]), + gSavedSettings.getU32("PreferredMaturity")); gSavedSettings.setU32("PreferredMaturity", preferredMaturity); } // During the AO transition, this flag will be true. Then the flag will |