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 Leylameow-7.2.2
|
|
@ -24,15 +24,26 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include <boost/coroutine/coroutine.hpp>
|
||||
#include <boost/coroutine/future.hpp>
|
||||
|
||||
#include "llpanelmarketplaceoutbox.h"
|
||||
|
||||
#include "llbutton.h"
|
||||
#include "llcoros.h"
|
||||
#include "lleventcoro.h"
|
||||
#include "llloadingindicator.h"
|
||||
#include "lltimer.h"
|
||||
|
||||
|
||||
static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> 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<LLButton>("outbox_sync_btn");
|
||||
mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this));
|
||||
|
||||
mSyncIndicator = getChild<LLLoadingIndicator>("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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,10 @@
|
|||
reference="AvatarListItemIconOfflineColor" />
|
||||
<color
|
||||
name="BadgeImageColor"
|
||||
value="0.25 0.85 0.25 1.0" />
|
||||
value="0.44 0.69 0.56 1.0" />
|
||||
<color
|
||||
name="BadgeImageBorderColor"
|
||||
value="0.9 0.9 0.9 1.0" />
|
||||
<color
|
||||
name="BadgeLabelColor"
|
||||
reference="White" />
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -72,11 +72,11 @@ with the same filename but different name
|
|||
<texture name="BackButton_Over" file_name="icons/back_arrow_over.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" />
|
||||
<texture name="BackButton_Press" file_name="icons/back_arrow_press.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" />
|
||||
|
||||
<texture name="Badge" file_name="widgets/Badge.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" />
|
||||
<texture name="Badge_Background" file_name="widgets/Badge_Background.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" />
|
||||
<texture name="Badge_Border" file_name="widgets/Badge_Border.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" />
|
||||
|
||||
<texture name="Blank" file_name="Blank.png" preload="false" />
|
||||
|
||||
|
||||
<texture name="BuyArrow_Over" file_name="navbar/BuyArrow_Over.png" preload="true" scale.left="0" scale.top="1" scale.right="0" scale.bottom="0" />
|
||||
<texture name="BuyArrow_Press" file_name="navbar/BuyArrow_Press.png" preload="true" scale.left="1" scale.top="1" scale.right="0" scale.bottom="0" />
|
||||
|
||||
|
|
@ -479,7 +479,16 @@ with the same filename but different name
|
|||
<texture name="StopReload_Off" file_name="icons/StopReload_Off.png" preload="false" />
|
||||
<texture name="StopReload_Over" file_name="icons/StopReload_Over.png" preload="false" />
|
||||
|
||||
<texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" />
|
||||
<texture name="Sync_Disabled" file_name="icons/Sync_Disabled.png" preload="true" />
|
||||
<texture name="Sync_Enabled" file_name="icons/Sync_Enabled.png" preload="true" />
|
||||
<texture name="Sync_Progress_1" file_name="icons/Sync_Progress_1.png" preload="true" />
|
||||
<texture name="Sync_Progress_2" file_name="icons/Sync_Progress_2.png" preload="true" />
|
||||
<texture name="Sync_Progress_3" file_name="icons/Sync_Progress_3.png" preload="true" />
|
||||
<texture name="Sync_Progress_4" file_name="icons/Sync_Progress_4.png" preload="true" />
|
||||
<texture name="Sync_Progress_5" file_name="icons/Sync_Progress_5.png" preload="true" />
|
||||
<texture name="Sync_Progress_6" file_name="icons/Sync_Progress_6.png" preload="true" />
|
||||
|
||||
<texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" />
|
||||
<texture name="TabIcon_Appearance_Selected" file_name="taskpanel/TabIcon_Appearance_Selected.png" preload="false" />
|
||||
<texture name="TabIcon_Close_Off" file_name="taskpanel/TabIcon_Close_Off.png" preload="false" />
|
||||
<texture name="TabIcon_Home_Off" file_name="taskpanel/TabIcon_Home_Off.png" preload="false" />
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 958 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -124,37 +124,60 @@
|
|||
height="125"
|
||||
width="310">
|
||||
<button
|
||||
label="MARKETPLACE OUTBOX"
|
||||
is_toggle="true"
|
||||
name="outbox_btn"
|
||||
follows="top|left|right"
|
||||
image_unselected="MarketplaceBtn_Off"
|
||||
image_selected="MarketplaceBtn_Selected"
|
||||
height="35"
|
||||
tab_stop="false"
|
||||
width="308"
|
||||
halign="left"
|
||||
pad_left="35"
|
||||
top="0"
|
||||
label="MARKETPLACE OUTBOX"
|
||||
is_toggle="true"
|
||||
name="outbox_btn"
|
||||
follows="top|left|right"
|
||||
image_unselected="MarketplaceBtn_Off"
|
||||
image_selected="MarketplaceBtn_Selected"
|
||||
height="35"
|
||||
tab_stop="false"
|
||||
width="308"
|
||||
halign="left"
|
||||
pad_left="35"
|
||||
top="0"
|
||||
left="0" />
|
||||
<button
|
||||
label="SYNC"
|
||||
<button
|
||||
image_disabled="Sync_Disabled"
|
||||
image_disabled_selected="Sync_Disabled"
|
||||
image_unselected="Sync_Enabled"
|
||||
image_selected="Sync_Enabled"
|
||||
label=""
|
||||
is_toggle="false"
|
||||
name="outbox_sync_btn"
|
||||
follows="top|right"
|
||||
height="25"
|
||||
height="16"
|
||||
tab_stop="false"
|
||||
width="45"
|
||||
width="16"
|
||||
halign="center"
|
||||
top="5"
|
||||
left="-50"
|
||||
top="10"
|
||||
left="-40"
|
||||
enabled="false" />
|
||||
<loading_indicator
|
||||
follows="top|right"
|
||||
name="outbox_sync_indicator"
|
||||
top="10"
|
||||
left="-40"
|
||||
height="16"
|
||||
width="16"
|
||||
images_per_sec="1.0"
|
||||
tab_stop="false"
|
||||
visible="false">
|
||||
<images>
|
||||
<image name="Sync_Progress_1"/>
|
||||
<image name="Sync_Progress_2"/>
|
||||
<image name="Sync_Progress_3"/>
|
||||
<image name="Sync_Progress_4"/>
|
||||
<image name="Sync_Progress_5"/>
|
||||
<image name="Sync_Progress_6"/>
|
||||
</images>
|
||||
</loading_indicator>
|
||||
<panel
|
||||
follows="all"
|
||||
left="0"
|
||||
height="90"
|
||||
width="250"
|
||||
top="30"
|
||||
follows="all"
|
||||
left="0"
|
||||
height="90"
|
||||
width="250"
|
||||
top="30"
|
||||
>
|
||||
<text
|
||||
left ="40"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<!-- Additional attributes:
|
||||
-->
|
||||
<badge font="SansSerifSmall"
|
||||
image="Badge"
|
||||
image="Badge_Background"
|
||||
image_color="BadgeImageColor"
|
||||
label_color="BadgeLabelColor"
|
||||
location="top_left"
|
||||
|
|
|
|||