summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelinventory.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-06-22 16:12:01 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-06-22 16:12:01 -0700
commit5999574c106d0d2566d191c754f6a630d8407787 (patch)
tree7083e8708b6eecdec5f3e159f6441de7f86b5328 /indra/newview/llsidepanelinventory.cpp
parente2f9276a083f5883e250b0edcc5c68273985be8b (diff)
making it so that inbox shows up quicker
Diffstat (limited to 'indra/newview/llsidepanelinventory.cpp')
-rw-r--r--indra/newview/llsidepanelinventory.cpp64
1 files changed, 9 insertions, 55 deletions
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 79d68de289..19c8ee0123 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -52,7 +52,6 @@
#include "llstring.h"
#include "lltabcontainer.h"
#include "llviewermedia.h"
-#include "llviewernetwork.h"
#include "llweb.h"
static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_inventory");
@@ -79,37 +78,6 @@ static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"
// Helpers
//
-class LLInventoryUserStatusResponder : public LLHTTPClient::Responder
-{
-public:
- LLInventoryUserStatusResponder(LLSidepanelInventory * sidepanelInventory)
- : LLCurl::Responder()
- , mSidepanelInventory(sidepanelInventory)
- {
- }
-
- void completed(U32 status, const std::string& reason, const LLSD& content)
- {
- if (isGoodStatus(status))
- {
- // Complete success
- mSidepanelInventory->enableInbox(true);
- }
- else if (status == 401)
- {
- // API is available for use but OpenID authorization failed
- mSidepanelInventory->enableInbox(true);
- }
- else
- {
- // API in unavailable
- llinfos << "Marketplace API is unavailable -- Inbox Disabled" << llendl;
- }
- }
-
-private:
- LLSidepanelInventory * mSidepanelInventory;
-};
//
// Implementation
@@ -135,6 +103,13 @@ LLSidepanelInventory::~LLSidepanelInventory()
delete mCategoriesObserver;
}
+void handleInventoryDisplayInboxChanged()
+{
+ LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
+
+ sidepanel_inventory->enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox"));
+}
+
BOOL LLSidepanelInventory::postBuild()
{
// UI elements from inventory panel
@@ -226,35 +201,14 @@ BOOL LLSidepanelInventory::postBuild()
LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::handleLoginComplete, this));
}
+ gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged));
+
return TRUE;
}
void LLSidepanelInventory::handleLoginComplete()
{
//
- // Hard coding this as a temporary way to determine whether or not to display the inbox
- //
-
- std::string url = "https://marketplace.secondlife.com/";
-
- if (!LLGridManager::getInstance()->isInProductionGrid())
- {
- std::string gridLabel = LLGridManager::getInstance()->getGridLabel();
- url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str());
- }
-
- url += "api/1/users/";
- url += gAgent.getID().getString();
- url += "/user_status";
-
- LLSD headers = LLSD::emptyMap();
- headers["Accept"] = "*/*";
- headers["Cookie"] = LLViewerMedia::getOpenIDCookie();
- headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent();
-
- LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this), headers);
-
- //
// Track inbox and outbox folder changes
//