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 ++++++++++++++++++++- indra/newview/llpanelmarketplaceoutbox.h | 19 +++++ indra/newview/skins/default/colors.xml | 5 +- .../skins/default/textures/icons/Inv_Gift.png | Bin 0 -> 1335 bytes .../skins/default/textures/icons/Sync_Disabled.png | Bin 0 -> 1187 bytes .../skins/default/textures/icons/Sync_Enabled.png | Bin 0 -> 1168 bytes .../default/textures/icons/Sync_Progress_1.png | Bin 0 -> 1149 bytes .../default/textures/icons/Sync_Progress_2.png | Bin 0 -> 1147 bytes .../default/textures/icons/Sync_Progress_3.png | Bin 0 -> 1211 bytes .../default/textures/icons/Sync_Progress_4.png | Bin 0 -> 1205 bytes .../default/textures/icons/Sync_Progress_5.png | Bin 0 -> 1137 bytes .../default/textures/icons/Sync_Progress_6.png | Bin 0 -> 1164 bytes indra/newview/skins/default/textures/textures.xml | 15 +++- .../skins/default/textures/widgets/Badge.png | Bin 958 -> 0 bytes .../default/textures/widgets/Badge_Background.png | Bin 0 -> 1352 bytes .../default/textures/widgets/Badge_Border.png | Bin 0 -> 1565 bytes .../skins/default/xui/en/sidepanel_inventory.xml | 69 ++++++++++----- .../newview/skins/default/xui/en/widgets/badge.xml | 2 +- 18 files changed, 173 insertions(+), 30 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Inv_Gift.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Disabled.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Enabled.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_1.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_2.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_3.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_4.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_5.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_6.png delete mode 100644 indra/newview/skins/default/textures/widgets/Badge.png create mode 100644 indra/newview/skins/default/textures/widgets/Badge_Background.png create mode 100644 indra/newview/skins/default/textures/widgets/Badge_Border.png (limited to 'indra') 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()); + } +} diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h index a6a28e0a83..2fbe819762 100644 --- a/indra/newview/llpanelmarketplaceoutbox.h +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -29,6 +29,11 @@ #include "llpanel.h" + +class LLButton; +class LLLoadingIndicator; + + class LLPanelMarketplaceOutbox : public LLPanel { public: @@ -39,6 +44,20 @@ public: ~LLPanelMarketplaceOutbox(); /*virtual*/ BOOL postBuild(); + + bool isOutboxEmpty() const; + bool isSyncInProgress() const; + + void onSyncComplete(); + +protected: + void onSyncButtonClicked(); + void updateSyncButtonStatus(); + +private: + LLButton * mSyncButton; + LLLoadingIndicator * mSyncIndicator; + bool mSyncInProgress; }; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 0795e38366..a548849d60 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -134,7 +134,10 @@ reference="AvatarListItemIconOfflineColor" /> + value="0.44 0.69 0.56 1.0" /> + diff --git a/indra/newview/skins/default/textures/icons/Inv_Gift.png b/indra/newview/skins/default/textures/icons/Inv_Gift.png new file mode 100644 index 0000000000..5afe85d72d Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Inv_Gift.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Disabled.png b/indra/newview/skins/default/textures/icons/Sync_Disabled.png new file mode 100644 index 0000000000..ca2e8def97 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Disabled.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Enabled.png b/indra/newview/skins/default/textures/icons/Sync_Enabled.png new file mode 100644 index 0000000000..bc236c8b98 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Enabled.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_1.png b/indra/newview/skins/default/textures/icons/Sync_Progress_1.png new file mode 100644 index 0000000000..624e556376 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_1.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_2.png b/indra/newview/skins/default/textures/icons/Sync_Progress_2.png new file mode 100644 index 0000000000..5769803b3f Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_2.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_3.png b/indra/newview/skins/default/textures/icons/Sync_Progress_3.png new file mode 100644 index 0000000000..92d4bfb020 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_3.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_4.png b/indra/newview/skins/default/textures/icons/Sync_Progress_4.png new file mode 100644 index 0000000000..6d43eb3a9f Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_4.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_5.png b/indra/newview/skins/default/textures/icons/Sync_Progress_5.png new file mode 100644 index 0000000000..766d063c99 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_5.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_6.png b/indra/newview/skins/default/textures/icons/Sync_Progress_6.png new file mode 100644 index 0000000000..dfe7f68b72 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_6.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index f0a1893502..a6e71cc38e 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -72,11 +72,11 @@ with the same filename but different name - + + - @@ -479,7 +479,16 @@ with the same filename but different name - + + + + + + + + + + diff --git a/indra/newview/skins/default/textures/widgets/Badge.png b/indra/newview/skins/default/textures/widgets/Badge.png deleted file mode 100644 index 862b13d219..0000000000 Binary files a/indra/newview/skins/default/textures/widgets/Badge.png and /dev/null differ diff --git a/indra/newview/skins/default/textures/widgets/Badge_Background.png b/indra/newview/skins/default/textures/widgets/Badge_Background.png new file mode 100644 index 0000000000..5089c30312 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/Badge_Background.png differ diff --git a/indra/newview/skins/default/textures/widgets/Badge_Border.png b/indra/newview/skins/default/textures/widgets/Badge_Border.png new file mode 100644 index 0000000000..4b086a63fb Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/Badge_Border.png differ diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index fa79975669..ffc018b856 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -124,37 +124,60 @@ height="125" width="310">