summaryrefslogtreecommitdiff
path: root/indra/newview/llprogressview.cpp
diff options
context:
space:
mode:
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);
+ }
+}