MAINT-117 FIXED Login screen didn't hide if you minimized viewer window right after pressing "Log In".

meow-7.2.2
Vadim ProductEngine 2012-04-03 18:33:42 +03:00
parent dc45a131a2
commit 686c7faf7a
2 changed files with 28 additions and 13 deletions

View File

@ -40,6 +40,7 @@
#include "llagent.h"
#include "llbutton.h"
#include "llcallbacklist.h"
#include "llfocusmgr.h"
#include "llnotifications.h"
#include "llprogressbar.h"
@ -72,6 +73,8 @@ LLProgressView::LLProgressView()
mStartupComplete(false)
{
mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1));
mFadeToWorldTimer.stop();
mFadeFromLoginTimer.stop();
}
BOOL LLProgressView::postBuild()
@ -87,8 +90,6 @@ BOOL LLProgressView::postBuild()
mCancelBtn = getChild<LLButton>("cancel_btn");
mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL );
mFadeToWorldTimer.stop();
mFadeFromLoginTimer.stop();
getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle()));
@ -106,6 +107,9 @@ BOOL LLProgressView::postBuild()
LLProgressView::~LLProgressView()
{
// Just in case something went wrong, make sure we deregister our idle callback.
gIdleCallbacks.deleteFunction(onIdle, this);
gFocusMgr.releaseFocusIfNeeded( this );
sInstance = NULL;
@ -154,6 +158,7 @@ void LLProgressView::revealIntroPanel()
}
mFadeFromLoginTimer.start();
gIdleCallbacks.addFunction(onIdle, this);
}
void LLProgressView::setStartupComplete()
@ -236,13 +241,6 @@ void LLProgressView::draw()
}
LLPanel::draw();
if (mFadeFromLoginTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME )
{
mFadeFromLoginTimer.stop();
LLPanelLogin::closePanel();
}
return;
}
@ -424,3 +422,21 @@ void LLProgressView::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent even
}
}
}
// static
void LLProgressView::onIdle(void* user_data)
{
LLProgressView* self = (LLProgressView*) user_data;
// Close login panel on mFadeToWorldTimer expiration.
if (self->mFadeFromLoginTimer.getStarted() &&
self->mFadeFromLoginTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME)
{
self->mFadeFromLoginTimer.stop();
LLPanelLogin::closePanel();
// Nothing to do anymore.
gIdleCallbacks.deleteFunction(onIdle, user_data);
}
}

View File

@ -41,6 +41,8 @@ class LLProgressView :
public LLViewerMediaObserver
{
LOG_CLASS(LLProgressView);
public:
LLProgressView();
virtual ~LLProgressView();
@ -74,10 +76,6 @@ public:
static void onClickMessage(void*);
bool onAlertModal(const LLSD& sd);
// note - this is not just hiding the intro panel - it also hides the parent panel
// and is used when the intro is finished and we want to show the world
void removeIntroPanel();
protected:
LLProgressBar* mProgressBar;
LLMediaCtrl* mMediaCtrl;
@ -96,6 +94,7 @@ protected:
LLEventStream mUpdateEvents;
bool handleUpdate(const LLSD& event_data);
static void onIdle(void* user_data);
};
#endif // LL_LLPROGRESSVIEW_H