diff options
| -rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 20 | ||||
| -rw-r--r-- | indra/newview/llpanelmaininventory.h | 2 | ||||
| -rw-r--r-- | indra/newview/llpanelmarketplaceinbox.cpp | 38 | ||||
| -rw-r--r-- | indra/newview/llpanelmarketplaceinbox.h | 2 | ||||
| -rw-r--r-- | indra/newview/llpanelmarketplaceoutbox.cpp | 28 | ||||
| -rw-r--r-- | indra/newview/llpanelmarketplaceoutbox.h | 2 | ||||
| -rw-r--r-- | indra/newview/llsidepanelinventory.cpp | 37 | ||||
| -rw-r--r-- | indra/newview/llsidepanelinventory.h | 8 | 
8 files changed, 123 insertions, 14 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index bc4998dd0c..9f797eb147 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -193,6 +193,9 @@ BOOL LLPanelMainInventory::postBuild()  	mMenuAdd->getChild<LLMenuItemGL>("Upload Animation")->setLabelArg("[COST]", upload_cost);  	mMenuAdd->getChild<LLMenuItemGL>("Bulk Upload")->setLabelArg("[COST]", upload_cost); +	// Trigger callback for focus received so we can deselect items in inbox/outbox +	LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this)); +  	return TRUE;  } @@ -572,6 +575,23 @@ void LLPanelMainInventory::updateItemcountText()  	getChild<LLUICtrl>("ItemcountText")->setValue(text);  } +void LLPanelMainInventory::onFocusReceived() +{ +	LLInventoryPanel * inbox_panel = findChild<LLInventoryPanel>("inventory_inbox"); + +	if (inbox_panel) +	{ +		inbox_panel->clearSelection(); +	} + +	LLInventoryPanel * outbox_panel = findChild<LLInventoryPanel>("inventory_outbox"); + +	if (outbox_panel) +	{ +		outbox_panel->clearSelection(); +	} +} +  void LLPanelMainInventory::setFilterTextFromFilter()   {   	mFilterText = mActivePanel->getFilter()->getFilterText();  diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 2b2ee1c0c9..86b2c87e0b 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -114,6 +114,8 @@ protected:  	bool isSaveTextureEnabled(const LLSD& userdata);  	void updateItemcountText(); +	void onFocusReceived(); +  private:  	LLFloaterInventoryFinder* getFinder(); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 0fe2560fbf..eff27aa541 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -31,6 +31,11 @@  #include "llappviewer.h"  #include "llbutton.h"  #include "llinventorypanel.h" +#include "llsidepanelinventory.h" + + +#define SUPPORTING_FRESH_ITEM_COUNT	0 +  static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox"); @@ -59,6 +64,8 @@ BOOL LLPanelMarketplaceInbox::postBuild()  	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); +	LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); +  	return TRUE;  } @@ -68,6 +75,28 @@ void LLPanelMarketplaceInbox::handleLoginComplete()  	LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this);  } +void LLPanelMarketplaceInbox::onFocusReceived() +{ +	LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + +	if (sidepanel_inventory) +	{ +		LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + +		if (inv_panel) +		{ +			inv_panel->clearSelection(); +		} +	 +		LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox"); + +		if (outbox_panel) +		{ +			outbox_panel->clearSelection(); +		} +	} +} +  BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg)  {  	*accept = ACCEPT_NO; @@ -126,8 +155,9 @@ std::string LLPanelMarketplaceInbox::getBadgeString() const  {  	std::string item_count_str(""); -	// If side panel collapsed or expanded and not inventory -	if (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")) +	// If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel +	if (getParent()->getVisible() && +		(LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")))  	{  		U32 item_count = getFreshItemCount(); @@ -154,6 +184,7 @@ void LLPanelMarketplaceInbox::draw()  		args["[NUM]"] = item_count_str;  		getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); +#if SUPPORTING_FRESH_ITEM_COUNT  		// set green text to fresh item count  		U32 fresh_item_count = getFreshItemCount();  		fresh_new_count_view->setVisible((fresh_item_count > 0)); @@ -162,6 +193,9 @@ void LLPanelMarketplaceInbox::draw()  		{  			getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count));  		} +#else +		fresh_new_count_view->setVisible(FALSE); +#endif  	}  	else  	{ diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 21069a0ea1..d5b216b56d 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -63,6 +63,8 @@ public:  private:  	void handleLoginComplete(); +	void onFocusReceived(); +  private:  	LLInventoryPanel* mInventoryPanel;  }; diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 96695becf0..c8752b3e0f 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -31,7 +31,11 @@  #include "llbutton.h"  #include "llcoros.h"  #include "lleventcoro.h" +#include "llinventorypanel.h"  #include "llloadingindicator.h" +#include "llpanelmarketplaceinbox.h" +#include "llsidepanelinventory.h" +#include "llsidetray.h"  #include "lltimer.h" @@ -60,9 +64,33 @@ BOOL LLPanelMarketplaceOutbox::postBuild()  	mSyncButton->setEnabled(!isOutboxEmpty()); +	LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceOutbox::onFocusReceived, this)); +  	return TRUE;  } +void LLPanelMarketplaceOutbox::onFocusReceived() +{ +	LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + +	if (sidepanel_inventory) +	{ +		LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + +		if (inv_panel) +		{ +			inv_panel->clearSelection(); +		} + +		LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox"); + +		if (inbox_panel) +		{ +			inbox_panel->clearSelection(); +		} +	} +} +  bool LLPanelMarketplaceOutbox::isOutboxEmpty() const  {  	// TODO: Check for contents of outbox diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h index 2fbe819762..94bc066224 100644 --- a/indra/newview/llpanelmarketplaceoutbox.h +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -54,6 +54,8 @@ protected:  	void onSyncButtonClicked();  	void updateSyncButtonStatus(); +	void onFocusReceived(); +  private:  	LLButton *				mSyncButton;  	LLLoadingIndicator *	mSyncIndicator; 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);  } diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 25fc28d56b..b68abd65cc 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -43,8 +43,10 @@ public:  	LLSidepanelInventory();  	virtual ~LLSidepanelInventory(); +private:  	void handleLoginComplete(); +public:  	/*virtual*/ BOOL postBuild();  	/*virtual*/ void onOpen(const LLSD& key); @@ -65,6 +67,9 @@ public:  	void enableInbox(bool enabled);  	void enableOutbox(bool enabled); +	bool isInboxEnabled() const { return mInboxEnabled; } +	bool isOutboxEnabled() const { return mOutboxEnabled; } +  protected:  	// Tracks highlighted (selected) item in inventory panel.  	LLInventoryItem *getSelectedItem(); @@ -107,7 +112,8 @@ private:  	LLButton*					mOverflowBtn;  	LLButton*					mShopBtn; -	bool						mInventoryFetched; +	bool						mInboxEnabled; +	bool						mOutboxEnabled;  	LLInventoryCategoriesObserver* 			mCategoriesObserver;  };  | 
