summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2009-12-21 14:27:47 -0800
committerMark Palange (Mani) <palange@lindenlab.com>2009-12-21 14:27:47 -0800
commitb5ed2038fbbf591cb743c4e18e8c5dfcfbea074e (patch)
treebb811ea463d158913b772d955816bcfc9ca98902 /indra/newview
parenta32f857fe68f6b191f8029b1a5b137aaa364395b (diff)
parente6349ac1927cb311c714e37c710c069b6de67a0b (diff)
Automated merge with ssh://hg.lindenlab.com/viewer/viewer-2-0
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lllogininstance.cpp41
-rw-r--r--indra/newview/lllogininstance.h2
-rw-r--r--indra/newview/llprogressview.cpp27
-rw-r--r--indra/newview/llprogressview.h6
-rw-r--r--indra/newview/llstartup.cpp22
-rw-r--r--indra/newview/llstartup.h1
6 files changed, 65 insertions, 34 deletions
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index 2dc9f255d7..24c72c65ce 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -76,6 +76,7 @@ LLLoginInstance::LLLoginInstance() :
mDispatcher.add("fail.login", boost::bind(&LLLoginInstance::handleLoginFailure, this, _1));
mDispatcher.add("connect", boost::bind(&LLLoginInstance::handleLoginSuccess, this, _1));
mDispatcher.add("disconnect", boost::bind(&LLLoginInstance::handleDisconnect, this, _1));
+ mDispatcher.add("indeterminate", boost::bind(&LLLoginInstance::handleIndeterminate, this, _1));
}
LLLoginInstance::~LLLoginInstance()
@@ -204,6 +205,8 @@ bool LLLoginInstance::handleLoginEvent(const LLSD& event)
mTransferRate = event["transfer_rate"].asReal();
}
+
+
// Call the method registered in constructor, if any, for more specific
// handling
LLEventDispatcher::Callable method(mDispatcher.get(event["change"]));
@@ -295,6 +298,22 @@ void LLLoginInstance::handleDisconnect(const LLSD& event)
// placeholder
}
+void LLLoginInstance::handleIndeterminate(const LLSD& event)
+{
+ // The indeterminate response means that the server
+ // gave the viewer a new url and params to try.
+ // The login module handles the retry, but it gives us the
+ // server response so that we may show
+ // the user some status.
+ LLSD message = event.get("data").get("message");
+ if(message.isDefined())
+ {
+ LLSD progress_update;
+ progress_update["desc"] = message;
+ LLEventPumps::getInstance()->obtain("LLProgressView").post(progress_update);
+ }
+}
+
bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key)
{
if(accepted)
@@ -374,28 +393,6 @@ void LLLoginInstance::updateApp(bool mandatory, const std::string& auth_msg)
mNotifications->add(notification_name, args, payload,
boost::bind(&LLLoginInstance::updateDialogCallback, this, _1, _2));
}
-
- /* *NOTE:Mani Experiment with Event API interface.
- if(!mUpdateAppResponse)
- {
- bool make_unique = true;
- mUpdateAppResponse.reset(new LLEventStream("logininstance_updateapp", make_unique));
- mUpdateAppResponse->listen("diaupdateDialogCallback",
- boost::bind(&LLLoginInstance::updateDialogCallback,
- this, _1
- )
- );
- }
-
- LLSD event;
- event["op"] = "requestAdd";
- event["name"] = notification_name;
- event["substitutions"] = args;
- event["payload"] = payload;
- event["reply"] = mUpdateAppResponse->getName();
-
- LLEventPumps::getInstance()->obtain("LLNotifications").post(event);
- */
}
bool LLLoginInstance::updateDialogCallback(const LLSD& notification, const LLSD& response)
diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h
index 19d7449bc1..c8704eddb4 100644
--- a/indra/newview/lllogininstance.h
+++ b/indra/newview/lllogininstance.h
@@ -89,6 +89,7 @@ private:
void handleLoginFailure(const LLSD& event);
void handleLoginSuccess(const LLSD& event);
void handleDisconnect(const LLSD& event);
+ void handleIndeterminate(const LLSD& event);
bool handleTOSResponse(bool v, const std::string& key);
@@ -107,7 +108,6 @@ private:
std::string mSerialNumber;
int mLastExecEvent;
UpdaterLauncherCallback mUpdaterLauncher;
- boost::scoped_ptr<LLEventStream> mUpdateAppResponse;
LLEventDispatcher mDispatcher;
};
diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp
index 5f6b210767..7a48f890e0 100644
--- a/indra/newview/llprogressview.cpp
+++ b/indra/newview/llprogressview.cpp
@@ -72,10 +72,12 @@ const S32 ANIMATION_FRAMES = 1; //13;
LLProgressView::LLProgressView(const LLRect &rect)
: LLPanel(),
mPercentDone( 0.f ),
- mMouseDownInActiveArea( false )
+ mMouseDownInActiveArea( false ),
+ mUpdateEvents("LLProgressView")
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_progress.xml");
reshape(rect.getWidth(), rect.getHeight());
+ mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1));
}
BOOL LLProgressView::postBuild()
@@ -260,3 +262,26 @@ void LLProgressView::onClickMessage(void* data)
}
}
}
+
+bool LLProgressView::handleUpdate(const LLSD& event_data)
+{
+ LLSD message = event_data.get("message");
+ LLSD desc = event_data.get("desc");
+ LLSD percent = event_data.get("percent");
+
+ if(message.isDefined())
+ {
+ setMessage(message.asString());
+ }
+
+ if(desc.isDefined())
+ {
+ setText(desc.asString());
+ }
+
+ if(percent.isDefined())
+ {
+ setPercent(percent.asReal());
+ }
+ return false;
+}
diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h
index 865646c85d..6853674d88 100644
--- a/indra/newview/llprogressview.h
+++ b/indra/newview/llprogressview.h
@@ -35,6 +35,7 @@
#include "llpanel.h"
#include "llframetimer.h"
+#include "llevents.h"
class LLImageRaw;
class LLButton;
@@ -75,7 +76,12 @@ protected:
LLRect mOutlineRect;
bool mMouseDownInActiveArea;
+ // The LLEventStream mUpdateEvents depends upon this class being a singleton
+ // to avoid pump name conflicts.
static LLProgressView* sInstance;
+ LLEventStream mUpdateEvents;
+
+ bool handleUpdate(const LLSD& event_data);
};
#endif // LL_LLPROGRESSVIEW_H
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 73e7d99815..eb2275bff0 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -1082,6 +1082,17 @@ bool idle_startup()
credentials["passwd"] = gPassword;
login->connect(credentials);
+ LLStartUp::setStartupState( STATE_LOGIN_CURL_UNSTUCK );
+ return FALSE;
+ }
+
+ if(STATE_LOGIN_CURL_UNSTUCK == LLStartUp::getStartupState())
+ {
+ // If we get here we have gotten past the potential stall
+ // in curl, so take "may appear frozen" out of progress bar. JC
+ auth_desc = LLTrans::getString("LoginInProgressNoFrozen");
+ set_startup_status(progress, auth_desc, auth_message);
+
LLStartUp::setStartupState( STATE_LOGIN_PROCESS_RESPONSE );
return FALSE;
}
@@ -1168,16 +1179,6 @@ bool idle_startup()
show_connect_box = true;
}
}
- else
- {
- // Still waiting for response.
- // *TODO:Mani - Actually check for login progress.
- // If we get here we have gotten past the potential stall
- // in curl, so take "may appear frozen" out of progress bar. JC
- auth_desc = LLTrans::getString("LoginInProgressNoFrozen");
- set_startup_status(progress, auth_desc, auth_message);
- }
-
return FALSE;
}
@@ -2703,6 +2704,7 @@ std::string LLStartUp::startupStateToString(EStartupState state)
RTNENUM( STATE_LOGIN_WAIT );
RTNENUM( STATE_LOGIN_CLEANUP );
RTNENUM( STATE_LOGIN_AUTH_INIT );
+ RTNENUM( STATE_LOGIN_CURL_UNSTUCK );
RTNENUM( STATE_LOGIN_PROCESS_RESPONSE );
RTNENUM( STATE_WORLD_INIT );
RTNENUM( STATE_MULTIMEDIA_INIT );
diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h
index ab11b42e74..92fe9521d3 100644
--- a/indra/newview/llstartup.h
+++ b/indra/newview/llstartup.h
@@ -55,6 +55,7 @@ typedef enum {
STATE_LOGIN_WAIT, // Wait for user input at login screen
STATE_LOGIN_CLEANUP, // Get rid of login screen and start login
STATE_LOGIN_AUTH_INIT, // Start login to SL servers
+ STATE_LOGIN_CURL_UNSTUCK, // Update progress to remove "SL appears frozen" msg.
STATE_LOGIN_PROCESS_RESPONSE, // Check authentication reply
STATE_WORLD_INIT, // Start building the world
STATE_MULTIMEDIA_INIT, // Init the rest of multimedia library