summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelinventory.cpp
diff options
context:
space:
mode:
authorLeslie Linden <none@none>2011-06-16 17:14:51 -0700
committerLeslie Linden <none@none>2011-06-16 17:14:51 -0700
commit0d246c0c5fc3ddef2022572b560eaec0018a722e (patch)
tree9417e06f6d1a5d6d1bf0d5f6ff454225e99170d2 /indra/newview/llsidepanelinventory.cpp
parent1be0392d4a0a89aea824ab00d8b9bb60c83267d8 (diff)
EXP-872 PROGRESS -- Hide Inbox unless applicable
EXP-910 FIX -- Newness badge shown on suitcase inventory icon when InventoryDisplayInbox is set to False EXP-895 FIX -- Selecting items in Marketplace Inbox does not change focus in inventory panel away from items selected in inventory panel * Main inventory, outbox and inbox all clear the selection of the others when they gain focus * The Fresh Item Count badge is no longer displayed on the inventory side tab button when the inbox is disabled * The New Item Count text is no longer displayed. (we will enable it again when freshness is supported)
Diffstat (limited to 'indra/newview/llsidepanelinventory.cpp')
-rw-r--r--indra/newview/llsidepanelinventory.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index d916c430a8..32394da042 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -32,10 +32,10 @@
#include "llappviewer.h"
#include "llavataractions.h"
#include "llbutton.h"
-#include "llcurl.h"
#include "lldate.h"
#include "llfirstuse.h"
#include "llfoldertype.h"
+#include "llhttpclient.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llinventorymodel.h"
@@ -69,6 +69,9 @@ static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel";
static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel";
static const char * const MAIN_INVENTORY_LAYOUT_PANEL = "main_inventory_layout_panel";
+static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox";
+static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox";
+
static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack";
//
@@ -84,14 +87,23 @@ public:
{
}
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ void completed(U32 status, const std::string& reason, const LLSD& content)
{
- llinfos << "Marketplace Inbox Disabled" << llendl;
- }
-
- void result(const LLSD& content)
- {
- mSidepanelInventory->enableInbox(true);
+ 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:
@@ -106,7 +118,8 @@ LLSidepanelInventory::LLSidepanelInventory()
: LLPanel()
, mItemPanel(NULL)
, mPanelMainInventory(NULL)
- , mInventoryFetched(false)
+ , mInboxEnabled(false)
+ , mOutboxEnabled(false)
, mCategoriesObserver(NULL)
{
//buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
@@ -205,8 +218,8 @@ BOOL LLSidepanelInventory::postBuild()
outbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this));
// Set the inbox and outbox visible based on debug settings (final setting comes from http request below)
- inbox_panel->setVisible(gSavedSettings.getBOOL("InventoryDisplayInbox"));
- outbox_panel->setVisible(gSavedSettings.getBOOL("InventoryDisplayOutbox"));
+ enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox"));
+ enableOutbox(gSavedSettings.getBOOL("InventoryDisplayOutbox"));
// Trigger callback for after login so we can setup to track inbox and outbox changes after initial inventory load
LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::handleLoginComplete, this));
@@ -258,11 +271,13 @@ void LLSidepanelInventory::handleLoginComplete()
void LLSidepanelInventory::enableInbox(bool enabled)
{
+ mInboxEnabled = enabled;
getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME)->setVisible(enabled);
}
void LLSidepanelInventory::enableOutbox(bool enabled)
{
+ mOutboxEnabled = enabled;
getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME)->setVisible(enabled);
}