diff options
author | Richard Nelson <richard@lindenlab.com> | 2011-07-26 15:38:53 -0700 |
---|---|---|
committer | Richard Nelson <richard@lindenlab.com> | 2011-07-26 15:38:53 -0700 |
commit | 6bcb677c902215e1c9cc3267963e214ca6f9add9 (patch) | |
tree | 0d22a19700b272380f9f92ef9b83b390ae869e0c /indra | |
parent | df82fbffa29428af258dc84ce2acbb07180f557e (diff) | |
parent | 2c2a4c123eb9bfa80785e5509e73c8f7f236228f (diff) |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience-merge
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 80 | ||||
-rw-r--r-- | indra/newview/llinventorymodel.h | 3 | ||||
-rw-r--r-- | indra/newview/llmediactrl.h | 2 | ||||
-rw-r--r-- | indra/newview/llprogressview.cpp | 89 | ||||
-rw-r--r-- | indra/newview/llprogressview.h | 5 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llvieweraudio.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.h | 1 |
12 files changed, 200 insertions, 40 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ba4a11f0b9..2b4c460da5 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6592,7 +6592,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <string>0</string> + <integer>0</integer> </map> <key>PrecachingDelay</key> <map> diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 21d5de9a5b..50b5a2a5e5 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2168,6 +2168,9 @@ void LLInventoryModel::registerCallbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_RemoveInventoryFolder, processRemoveInventoryFolder, NULL); + msg->setHandlerFuncFast(_PREHASH_RemoveInventoryObjects, + processRemoveInventoryObjects, + NULL); //msg->setHandlerFuncFast(_PREHASH_ExchangeCallingCard, // processExchangeCallingcard, // NULL); @@ -2284,17 +2287,9 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account) } // static -void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**) +void LLInventoryModel::removeInventoryItem(LLUUID agent_id, LLMessageSystem* msg) { - lldebugs << "LLInventoryModel::processRemoveInventoryItem()" << llendl; - LLUUID agent_id, item_id; - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - if(agent_id != gAgent.getID()) - { - llwarns << "Got a RemoveInventoryItem for the wrong agent." - << llendl; - return; - } + LLUUID item_id; S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); uuid_vec_t item_ids; update_map_t update; @@ -2316,6 +2311,21 @@ void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**) { gInventory.deleteObject(*it); } +} + +// static +void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**) +{ + lldebugs << "LLInventoryModel::processRemoveInventoryItem()" << llendl; + LLUUID agent_id, item_id; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); + if(agent_id != gAgent.getID()) + { + llwarns << "Got a RemoveInventoryItem for the wrong agent." + << llendl; + return; + } + LLInventoryModel::removeInventoryItem(agent_id, msg); gInventory.notifyObservers(); } @@ -2380,18 +2390,10 @@ void LLInventoryModel::processUpdateInventoryFolder(LLMessageSystem* msg, } // static -void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg, - void**) +void LLInventoryModel::removeInventoryFolder(LLUUID agent_id, + LLMessageSystem* msg) { - lldebugs << "LLInventoryModel::processRemoveInventoryFolder()" << llendl; - LLUUID agent_id, folder_id; - msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_AgentID, agent_id); - if(agent_id != gAgent.getID()) - { - llwarns << "Got a RemoveInventoryFolder for the wrong agent." - << llendl; - return; - } + LLUUID folder_id; uuid_vec_t folder_ids; update_map_t update; S32 count = msg->getNumberOfBlocksFast(_PREHASH_FolderData); @@ -2410,6 +2412,42 @@ void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg, { gInventory.deleteObject(*it); } +} + +// static +void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg, + void**) +{ + lldebugs << "LLInventoryModel::processRemoveInventoryFolder()" << llendl; + LLUUID agent_id, session_id; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id); + if(agent_id != gAgent.getID()) + { + llwarns << "Got a RemoveInventoryFolder for the wrong agent." + << llendl; + return; + } + LLInventoryModel::removeInventoryFolder( agent_id, msg ); + gInventory.notifyObservers(); +} + +// static +void LLInventoryModel::processRemoveInventoryObjects(LLMessageSystem* msg, + void**) +{ + lldebugs << "LLInventoryModel::processRemoveInventoryObjects()" << llendl; + LLUUID agent_id, session_id; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id); + if(agent_id != gAgent.getID()) + { + llwarns << "Got a RemoveInventoryObjects for the wrong agent." + << llendl; + return; + } + LLInventoryModel::removeInventoryFolder( agent_id, msg ); + LLInventoryModel::removeInventoryItem( agent_id, msg ); gInventory.notifyObservers(); } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 15da09990f..c3775ac088 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -492,9 +492,12 @@ protected: //-------------------------------------------------------------------- public: static void processUpdateCreateInventoryItem(LLMessageSystem* msg, void**); + static void removeInventoryItem(LLUUID agent_id, LLMessageSystem* msg); static void processRemoveInventoryItem(LLMessageSystem* msg, void**); static void processUpdateInventoryFolder(LLMessageSystem* msg, void**); + static void removeInventoryFolder(LLUUID agent_id, LLMessageSystem* msg); static void processRemoveInventoryFolder(LLMessageSystem* msg, void**); + static void processRemoveInventoryObjects(LLMessageSystem* msg, void**); static void processSaveAssetIntoInventory(LLMessageSystem* msg, void**); static void processBulkUpdateInventory(LLMessageSystem* msg, void**); static void processInventoryDescendents(LLMessageSystem* msg, void**); diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 6833453616..0e4a5b1d65 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -166,6 +166,8 @@ public: // Incoming media event dispatcher virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + LLUUID getTextureID() {return mMediaTextureID;} + protected: void convertInputCoords(S32& x, S32& y); diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 028891a90e..a1f38f1854 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -50,6 +50,7 @@ #include "llappviewer.h" #include "llweb.h" #include "lluictrlfactory.h" +#include "llpanellogin.h" LLProgressView* LLProgressView::sInstance = NULL; @@ -66,7 +67,9 @@ LLProgressView::LLProgressView() mMediaCtrl( NULL ), mMouseDownInActiveArea( false ), mUpdateEvents("LLProgressView"), - mFadeToWorldTimer() + mFadeToWorldTimer(), + mFadeFromLoginTimer(), + mStartupComplete(false) { mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1)); } @@ -79,10 +82,13 @@ BOOL LLProgressView::postBuild() mMediaCtrl = getChild<LLMediaCtrl>("login_media_panel"); mMediaCtrl->setVisible( false ); // hidden initially mMediaCtrl->addObserver( this ); // watch events + + LLViewerMedia::setOnlyAudibleMediaTextureID(mMediaCtrl->getTextureID()); mCancelBtn = getChild<LLButton>("cancel_btn"); mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); mFadeToWorldTimer.stop(); + mFadeFromLoginTimer.stop(); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); @@ -130,18 +136,34 @@ void LLProgressView::revealIntroPanel() // if user hasn't yet seen intro video std::string intro_url = gSavedSettings.getString("PostFirstLoginIntroURL"); if ( intro_url.length() > 0 && + gSavedSettings.getBOOL("BrowserJavascriptEnabled") && gSavedSettings.getBOOL("PostFirstLoginIntroViewed" ) == FALSE ) { + // hide the progress bar + getChild<LLView>("stack1")->setVisible(false); + // navigate to intro URL and reveal widget mMediaCtrl->navigateTo( intro_url ); mMediaCtrl->setVisible( TRUE ); + // flag as having seen the new user post login intro gSavedSettings.setBOOL("PostFirstLoginIntroViewed", TRUE ); + + mMediaCtrl->setFocus(TRUE); } - else + + mFadeFromLoginTimer.start(); +} + +void LLProgressView::setStartupComplete() +{ + mStartupComplete = true; + + // if we are not showing a video, fade into world + if (!mMediaCtrl->getVisible()) { - // start the timer that will control the fade through to the world view + mFadeFromLoginTimer.stop(); mFadeToWorldTimer.start(); } } @@ -162,17 +184,15 @@ void LLProgressView::setVisible(BOOL visible) } } -void LLProgressView::draw() -{ - static LLTimer timer; - // Paint bitmap if we've got one +void LLProgressView::drawStartTexture(F32 alpha) +{ glPushMatrix(); if (gStartTexture) { LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->bind(gStartTexture.get()); - gGL.color4f(1.f, 1.f, 1.f, 1.f); + gGL.color4f(1.f, 1.f, 1.f, alpha); F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight; S32 width = getRect().getWidth(); S32 height = getRect().getHeight(); @@ -198,6 +218,33 @@ void LLProgressView::draw() gl_rect_2d(getRect()); } glPopMatrix(); +} + + +void LLProgressView::draw() +{ + static LLTimer timer; + + if (mFadeFromLoginTimer.getStarted()) + { + F32 alpha = clamp_rescale(mFadeFromLoginTimer.getElapsedTimeF32(), 0.f, FADE_TO_WORLD_TIME, 0.f, 1.f); + LLViewDrawContext context(alpha); + + if (!mMediaCtrl->getVisible()) + { + drawStartTexture(alpha); + } + + LLPanel::draw(); + + if (mFadeFromLoginTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME ) + { + mFadeFromLoginTimer.stop(); + LLPanelLogin::closePanel(); + } + + return; + } // handle fade out to world view when we're asked to if (mFadeToWorldTimer.getStarted()) @@ -205,6 +252,8 @@ void LLProgressView::draw() // draw fading panel F32 alpha = clamp_rescale(mFadeToWorldTimer.getElapsedTimeF32(), 0.f, FADE_TO_WORLD_TIME, 1.f, 0.f); LLViewDrawContext context(alpha); + + drawStartTexture(alpha); LLPanel::draw(); // faded out completely - remove panel and reveal world @@ -212,6 +261,8 @@ void LLProgressView::draw() { mFadeToWorldTimer.stop(); + LLViewerMedia::setOnlyAudibleMediaTextureID(LLUUID::null); + // Fade is complete, release focus gFocusMgr.releaseFocusIfNeeded( this ); @@ -235,6 +286,7 @@ void LLProgressView::draw() return; } + drawStartTexture(1.0f); // draw children LLPanel::draw(); } @@ -349,9 +401,26 @@ bool LLProgressView::onAlertModal(const LLSD& notify) void LLProgressView::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) { + // the intro web content calls javascript::window.close() when it's done if( event == MEDIA_EVENT_CLOSE_REQUEST ) { - // the intro web content calls javascript::window.close() when it's done - mFadeToWorldTimer.start(); + if (mStartupComplete) + { + //make sure other timer has stopped + mFadeFromLoginTimer.stop(); + mFadeToWorldTimer.start(); + } + else + { + // hide the media ctrl and wait for startup to be completed before fading to world + mMediaCtrl->setVisible(false); + if (mMediaCtrl->getMediaPlugin()) + { + mMediaCtrl->getMediaPlugin()->stop(); + } + + // show the progress bar + getChild<LLView>("stack1")->setVisible(true); + } } } diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index 73dd478e98..fac00ad04d 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -48,6 +48,7 @@ public: BOOL postBuild(); /*virtual*/ void draw(); + void drawStartTexture(F32 alpha); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); @@ -65,6 +66,8 @@ public: // turns on (under certain circumstances) the into video after login void revealIntroPanel(); + void setStartupComplete(); + void setCancelButtonVisible(BOOL b, const std::string& label); static void onCancelButtonClicked( void* ); @@ -82,8 +85,10 @@ protected: std::string mMessage; LLButton* mCancelBtn; LLFrameTimer mFadeToWorldTimer; + LLFrameTimer mFadeFromLoginTimer; LLRect mOutlineRect; bool mMouseDownInActiveArea; + bool mStartupComplete; // The LLEventStream mUpdateEvents depends upon this class being a singleton // to avoid pump name conflicts. diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 4dfcb85295..b390c933f7 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -897,7 +897,7 @@ bool idle_startup() if (show_connect_box) { LLSLURL slurl; - LLPanelLogin::closePanel(); + //LLPanelLogin::closePanel(); } @@ -944,6 +944,8 @@ bool idle_startup() gViewerWindow->setShowProgress(TRUE); gViewerWindow->setProgressCancelButtonVisible(TRUE, LLTrans::getString("Quit")); + gViewerWindow->revealIntroPanel(); + // Poke the VFS, which could potentially block for a while if // Windows XP is acting up set_startup_status(0.07f, LLTrans::getString("LoginVerifyingCache"), LLStringUtil::null); @@ -1962,8 +1964,8 @@ bool idle_startup() gViewerWindow->getWindow()->resetBusyCount(); gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); LL_DEBUGS("AppInit") << "Done releasing bitmap" << LL_ENDL; - gViewerWindow->revealIntroPanel(); - //gViewerWindow->setShowProgress(FALSE); // reveal intro video now handles this + //gViewerWindow->revealIntroPanel(); + gViewerWindow->setStartupComplete(); gViewerWindow->setProgressCancelButtonVisible(FALSE); // We're not away from keyboard, even though login might have taken diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index b19c738ed2..f7fa5690d6 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -36,6 +36,7 @@ #include "llviewerwindow.h" #include "llvoiceclient.h" #include "llviewermedia.h" +#include "llprogressview.h" ///////////////////////////////////////////////////////// @@ -101,7 +102,16 @@ void audio_update_volume(bool force_update) { F32 master_volume = gSavedSettings.getF32("AudioLevelMaster"); BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); - if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) + + LLProgressView* progress = gViewerWindow->getProgressView(); + BOOL progress_view_visible = FALSE; + + if (progress) + { + progress_view_visible = progress->getVisible(); + } + + if (!gViewerWindow->getActive() && gSavedSettings.getBOOL("MuteWhenMinimized")) { mute_audio = TRUE; } @@ -114,7 +124,7 @@ void audio_update_volume(bool force_update) gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); - gAudiop->setMuted(mute_audio); + gAudiop->setMuted(mute_audio || progress_view_visible); if (force_update) { @@ -136,7 +146,7 @@ void audio_update_volume(bool force_update) F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); music_volume = mute_volume * master_volume * music_volume; - gAudiop->setInternetStreamGain ( music_muted ? 0.f : music_volume ); + gAudiop->setInternetStreamGain ( music_muted || progress_view_visible ? 0.f : music_volume ); } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1be58eae45..384f7cd61d 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -344,6 +344,8 @@ static LLViewerMedia::impl_id_map sViewerMediaTextureIDMap; static LLTimer sMediaCreateTimer; static const F32 LLVIEWERMEDIA_CREATE_DELAY = 1.0f; static F32 sGlobalVolume = 1.0f; +static bool sForceUpdate = false; +static LLUUID sOnlyAudibleTextureID = LLUUID::null; static F64 sLowestLoadableImplInterest = 0.0f; static bool sAnyMediaShowing = false; static boost::signals2::connection sTeleportFinishConnection; @@ -606,7 +608,7 @@ bool LLViewerMedia::textureHasMedia(const LLUUID& texture_id) // static void LLViewerMedia::setVolume(F32 volume) { - if(volume != sGlobalVolume) + if(volume != sGlobalVolume || sForceUpdate) { sGlobalVolume = volume; impl_list::iterator iter = sViewerMediaImplList.begin(); @@ -617,6 +619,8 @@ void LLViewerMedia::setVolume(F32 volume) LLViewerMediaImpl* pimpl = *iter; pimpl->updateVolume(); } + + sForceUpdate = false; } } @@ -1626,6 +1630,15 @@ void LLViewerMedia::onTeleportFinished() gSavedSettings.setBOOL("MediaTentativeAutoPlay", true); } + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id) +{ + sOnlyAudibleTextureID = texture_id; + sForceUpdate = true; +} + ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// @@ -2188,7 +2201,14 @@ void LLViewerMediaImpl::updateVolume() } } - mMediaSource->setVolume(volume); + if (sOnlyAudibleTextureID == LLUUID::null || sOnlyAudibleTextureID == mTextureId) + { + mMediaSource->setVolume(volume); + } + else + { + mMediaSource->setVolume(0.0f); + } } } diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index a70c6f4887..aeac6ba29a 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -160,6 +160,8 @@ public: static void createSpareBrowserMediaSource(); static LLPluginClassMedia* getSpareBrowserMediaSource(); + + static void setOnlyAudibleMediaTextureID(const LLUUID& texture_id); private: static void setOpenIDCookie(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c31e1c3ba9..1e5f8e8771 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4537,6 +4537,14 @@ void LLViewerWindow::setShowProgress(const BOOL show) } } +void LLViewerWindow::setStartupComplete() +{ + if (mProgressView) + { + mProgressView->setStartupComplete(); + } +} + BOOL LLViewerWindow::getShowProgress() const { return (mProgressView && mProgressView->getVisible()); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index ff49ed1f62..edd241a742 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -272,6 +272,7 @@ public: void setProgressCancelButtonVisible( BOOL b, const std::string& label = LLStringUtil::null ); LLProgressView *getProgressView() const; void revealIntroPanel(); + void setStartupComplete(); void updateObjectUnderCursor(); |