From 95b8020d21b1ad60f82c767df7d7aac019ad8353 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 23 May 2011 16:11:50 -0700 Subject: adding marketplace inbox and outbox reviewed by Leslie --- indra/newview/llpanelmarketplaceoutbox.cpp | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 indra/newview/llpanelmarketplaceoutbox.cpp (limited to 'indra/newview/llpanelmarketplaceoutbox.cpp') diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp new file mode 100644 index 0000000000..1f58fb33a4 --- /dev/null +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -0,0 +1,47 @@ +/** + * @file llpanelmarketplaceoutbox.cpp + * @brief Panel for marketplace outbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplaceoutbox.h" + +static LLRegisterPanelClassWrapper t_panel_marketplace_outbox("panel_marketplace_outbox"); + +// protected +LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox() +: LLPanel() +{ +} + +LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox() +{ +} + +// virtual +BOOL LLPanelMarketplaceOutbox::postBuild() +{ + return TRUE; +} -- cgit v1.2.3 From cbf38d7c95e5968f47850d082eee223e1cef1aff Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 1 Jun 2011 12:28:49 -0700 Subject: EXP-841 FIX -- Create outbox sync button with basic enable/disable logic and animation Functions are stubbed out. Time delay happens through basic coroutine to allow animation viewing. Reviewed by Leyla --- indra/newview/llpanelmarketplaceoutbox.cpp | 93 +++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmarketplaceoutbox.cpp') diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 1f58fb33a4..0151276f99 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -24,15 +24,26 @@ * $/LicenseInfo$ */ -#include "llviewerprecompiledheaders.h" +#include +#include #include "llpanelmarketplaceoutbox.h" +#include "llbutton.h" +#include "llcoros.h" +#include "lleventcoro.h" +#include "llloadingindicator.h" +#include "lltimer.h" + + static LLRegisterPanelClassWrapper t_panel_marketplace_outbox("panel_marketplace_outbox"); // protected LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox() -: LLPanel() + : LLPanel() + , mSyncButton(NULL) + , mSyncIndicator(NULL) + , mSyncInProgress(false) { } @@ -43,5 +54,83 @@ LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox() // virtual BOOL LLPanelMarketplaceOutbox::postBuild() { + mSyncButton = getChild("outbox_sync_btn"); + mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this)); + + mSyncIndicator = getChild("outbox_sync_indicator"); + + mSyncButton->setEnabled(!isOutboxEmpty()); + return TRUE; } + +bool LLPanelMarketplaceOutbox::isOutboxEmpty() const +{ + // TODO: Check for contents of outbox + + return false; +} + +bool LLPanelMarketplaceOutbox::isSyncInProgress() const +{ + return mSyncInProgress; +} + + +std::string gTimeDelayDebugFunc = ""; + +void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) +{ + waitForEventOn(self, "mainloop"); + + LLTimer delayTimer; + delayTimer.reset(); + delayTimer.setTimerExpirySec(5.0f); + + while (!delayTimer.hasExpired()) + { + waitForEventOn(self, "mainloop"); + } + + outboxPanel->onSyncComplete(); + + gTimeDelayDebugFunc = ""; +} + +void LLPanelMarketplaceOutbox::onSyncButtonClicked() +{ + // TODO: Actually trigger sync to marketplace + + mSyncInProgress = true; + updateSyncButtonStatus(); + + // Set a timer (for testing only) + + gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this)); +} + +void LLPanelMarketplaceOutbox::onSyncComplete() +{ + mSyncInProgress = false; + + updateSyncButtonStatus(); +} + +void LLPanelMarketplaceOutbox::updateSyncButtonStatus() +{ + if (isSyncInProgress()) + { + mSyncButton->setVisible(false); + + mSyncIndicator->setVisible(true); + mSyncIndicator->start(); + } + else + { + mSyncIndicator->stop(); + mSyncIndicator->setVisible(false); + + mSyncButton->setVisible(true); + mSyncButton->setEnabled(!isOutboxEmpty()); + } +} -- cgit v1.2.3 From 98bcd9e2efe4cc0dc5e51da09c6f18424b9d9144 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 6 Jun 2011 17:00:59 -0700 Subject: EXP-859 FIX -- Save setting for last time inbox expanded EXP-841 PROGRESS -- Create outbox sync button with basic enable/disable logic and animation EXP-866 PROGRESS -- Create inbox observer to dynamically update inbox item count and badge value EXP-872 PROGRESS -- Hide inbox and outbox unless applicable Inbox expansion time is now saved as setting variable "LastInventoryInboxExpand". New outbox sync button art. Observers for items and categories are now implemented in the LLSidepanelInventory but the exact method of use is still to be determined. Functions are in place to show and hide the inbox and outbox panels but the logic around the decision is TBD. The resize bar for the inbox/outbox is now disabled when both inbox and outbox are collapsed. Reviewed by Leyla. --- indra/newview/llpanelmarketplaceoutbox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmarketplaceoutbox.cpp') diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 0151276f99..822286783f 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -81,7 +81,7 @@ std::string gTimeDelayDebugFunc = ""; void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) { - waitForEventOn(self, "mainloop"); + waitForEventOn(self, "mainloop"); LLTimer delayTimer; delayTimer.reset(); @@ -89,7 +89,7 @@ void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) while (!delayTimer.hasExpired()) { - waitForEventOn(self, "mainloop"); + waitForEventOn(self, "mainloop"); } outboxPanel->onSyncComplete(); @@ -123,6 +123,7 @@ void LLPanelMarketplaceOutbox::updateSyncButtonStatus() mSyncButton->setVisible(false); mSyncIndicator->setVisible(true); + mSyncIndicator->reset(); mSyncIndicator->start(); } else -- cgit v1.2.3 From d8e84f85c9377a9bfd628d61ee1a661c31f3db84 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 7 Jun 2011 14:53:05 -0700 Subject: Fixing precompiled headers with outbox coroutine usage. Reviewed by Leyla. --- indra/newview/llpanelmarketplaceoutbox.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llpanelmarketplaceoutbox.cpp') diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 822286783f..96695becf0 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -24,8 +24,7 @@ * $/LicenseInfo$ */ -#include -#include +#include "llviewerprecompiledheaders.h" #include "llpanelmarketplaceoutbox.h" -- cgit v1.2.3 From 0d246c0c5fc3ddef2022572b560eaec0018a722e Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 16 Jun 2011 17:14:51 -0700 Subject: 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) --- indra/newview/llpanelmarketplaceoutbox.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'indra/newview/llpanelmarketplaceoutbox.cpp') 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("sidepanel_inventory"); + + if (sidepanel_inventory) + { + LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + + if (inv_panel) + { + inv_panel->clearSelection(); + } + + LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild("inventory_inbox"); + + if (inbox_panel) + { + inbox_panel->clearSelection(); + } + } +} + bool LLPanelMarketplaceOutbox::isOutboxEmpty() const { // TODO: Check for contents of outbox -- cgit v1.2.3 From 6c12a5ca550e06730e06d1a909fbf43d7bda16f5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 30 Jun 2011 16:25:19 -0700 Subject: EXP-919 FIX -- Items not shown in Received Items panel EXP-929 FIX -- First Direct Delivery item purchased while logged in: Received Items folder visible in inventory and item not visible in Received items panel - no badge count update * Inbox and Outbox inventory panels now live in their own XML files and are hot loaded into place when appropriate, like when the "Received Items" folder is first created, for example. * The Inbox and Outbox panels now show relevant default messages when the folders are empty or do not exist * Added LLInventoryCategoryAddedObserver, a new inventory observer type to observe added folders * Hacked LLInventoryPanel to properly set up inbox and outbox inventory views for the "Received Items" folder and the "Merchant Outbox" folder that aren't created with the proper system folder type * Changed inventory badge count computation to use LLFolderView rather than the inventory directly * Applied various focus, selection and other inbox fixes to the outbox Reviewed by Richard. --- indra/newview/llpanelmarketplaceoutbox.cpp | 63 +++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 9 deletions(-) (limited to 'indra/newview/llpanelmarketplaceoutbox.cpp') diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index c8752b3e0f..74d0de3b30 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -28,6 +28,7 @@ #include "llpanelmarketplaceoutbox.h" +#include "llappviewer.h" #include "llbutton.h" #include "llcoros.h" #include "lleventcoro.h" @@ -41,9 +42,15 @@ static LLRegisterPanelClassWrapper t_panel_marketplace_outbox("panel_marketplace_outbox"); +const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultParams() +{ + return LLUICtrlFactory::getDefaultParams(); +} + // protected -LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox() - : LLPanel() +LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox(const Params& p) + : LLPanel(p) + , mInventoryPanel(NULL) , mSyncButton(NULL) , mSyncIndicator(NULL) , mSyncInProgress(false) @@ -57,18 +64,22 @@ LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox() // virtual BOOL LLPanelMarketplaceOutbox::postBuild() { - mSyncButton = getChild("outbox_sync_btn"); - mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this)); - - mSyncIndicator = getChild("outbox_sync_indicator"); - - mSyncButton->setEnabled(!isOutboxEmpty()); - + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceOutbox::handleLoginComplete, this)); + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceOutbox::onFocusReceived, this)); return TRUE; } +void LLPanelMarketplaceOutbox::handleLoginComplete() +{ + mSyncButton = getChild("outbox_sync_btn"); + mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this)); + mSyncButton->setEnabled(!isOutboxEmpty()); + + mSyncIndicator = getChild("outbox_sync_indicator"); +} + void LLPanelMarketplaceOutbox::onFocusReceived() { LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); @@ -88,9 +99,43 @@ void LLPanelMarketplaceOutbox::onFocusReceived() { inbox_panel->clearSelection(); } + + sidepanel_inventory->updateVerbs(); } } +void LLPanelMarketplaceOutbox::onSelectionChange() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->updateVerbs(); +} + +void LLPanelMarketplaceOutbox::setupInventoryPanel() +{ + LLView * outbox_inventory_placeholder = getChild("outbox_inventory_placeholder"); + LLView * outbox_inventory_parent = outbox_inventory_placeholder->getParent(); + + mInventoryPanel = + LLUICtrlFactory::createFromFile("panel_outbox_inventory.xml", + outbox_inventory_parent, + LLInventoryPanel::child_registry_t::instance()); + + // Reshape the inventory to the proper size + LLRect inventory_placeholder_rect = outbox_inventory_placeholder->getRect(); + mInventoryPanel->setShape(inventory_placeholder_rect); + + // Set the sort order newest to oldest, and a selection change callback + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceOutbox::onSelectionChange, this)); + + // Set up the note to display when the outbox is empty + mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryOutboxNoItems"); + + // Hide the placeholder text + outbox_inventory_placeholder->setVisible(FALSE); +} + bool LLPanelMarketplaceOutbox::isOutboxEmpty() const { // TODO: Check for contents of outbox -- cgit v1.2.3