summaryrefslogtreecommitdiff
path: root/indra/newview/llprogressview.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-06-27 11:33:19 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-06-27 11:33:19 -0400
commit1f234f8593cb556d6515b7bbf3ac99d19fa4c5c3 (patch)
tree16d26c0c5af67114eec8f91a853cc5e0356b4131 /indra/newview/llprogressview.cpp
parent99c1c64aa494c0b9085f0766b951fedfb60ce412 (diff)
parent0730b24d7cb0a0ce0d6d08bc4e98387124bf03d0 (diff)
merge
Diffstat (limited to 'indra/newview/llprogressview.cpp')
-rw-r--r--indra/newview/llprogressview.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp
index 5d7a5b1c59..f86e583b9e 100644
--- a/indra/newview/llprogressview.cpp
+++ b/indra/newview/llprogressview.cpp
@@ -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);
+ }
+}