Moved outbox import confirmations to window shades on the merchant outbox floater, rather than modal dialogs.

master
Leslie Linden 2011-12-09 16:19:03 -08:00
parent 8878a5e561
commit cc92db1f35
8 changed files with 113 additions and 31 deletions

View File

@ -297,6 +297,11 @@ void LLWindowShade::hide()
setMouseOpaque(false);
}
bool LLWindowShade::isShown() const
{
return getChildRef<LLLayoutPanel>("notification_area").getVisible();
}
void LLWindowShade::onCloseNotification()
{
LLNotifications::instance().cancel(mNotification);

View File

@ -48,6 +48,8 @@ public:
void show();
/*virtual*/ void draw();
void hide();
bool isShown() const;
private:
friend class LLUICtrlFactory;

View File

@ -33,11 +33,32 @@
#include "llinventoryobserver.h"
#include "llinventorypanel.h"
#include "llmarketplacefunctions.h"
#include "llnotificationhandler.h"
#include "llnotificationsutil.h"
#include "lltextbox.h"
#include "lltransientfloatermgr.h"
#include "lltrans.h"
#include "llviewernetwork.h"
#include "llwindowshade.h"
///----------------------------------------------------------------------------
/// LLOutboxNotification class
///----------------------------------------------------------------------------
bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLSD& notify)
{
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
if (notification)
{
LLFloaterOutbox* outbox_floater = LLFloaterReg::getTypedInstance<LLFloaterOutbox>("outbox");
outbox_floater->showNotification(notification);
}
return false;
}
///----------------------------------------------------------------------------
@ -89,6 +110,7 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key)
, mInventoryText(NULL)
, mInventoryTitle(NULL)
, mImportButton(NULL)
, mWindowShade(NULL)
{
}
@ -121,6 +143,16 @@ BOOL LLFloaterOutbox::postBuild()
return TRUE;
}
void LLFloaterOutbox::onClose(bool app_quitting)
{
if (mWindowShade)
{
delete mWindowShade;
mWindowShade = NULL;
}
}
void LLFloaterOutbox::onOpen(const LLSD& key)
{
//
@ -275,7 +307,8 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
{
// Pass drag and drop to this floater to the outbox inventory control
if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress())
if (LLMarketplaceInventoryImporter::getInstance()->isImportInProgress() ||
(mWindowShade && mWindowShade->isShown()))
{
return FALSE;
}
@ -369,3 +402,29 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
}
}
void LLFloaterOutbox::showNotification(LLNotificationPtr notify)
{
if (mWindowShade)
{
delete mWindowShade;
}
LLRect floater_rect = getLocalRect();
floater_rect.mTop -= getHeaderHeight();
floater_rect.stretch(-5, 0);
LLWindowShade::Params params;
params.name = "notification_shade";
params.rect = floater_rect;
params.follows.flags = FOLLOWS_ALL;
params.notification = notify;
params.modal = true;
params.can_close = false;
params.text_color = LLColor4::white;
mWindowShade = LLUICtrlFactory::create<LLWindowShade>(params);
addChild(mWindowShade);
mWindowShade->show();
}

View File

@ -30,6 +30,7 @@
#include "llfloater.h"
#include "llfoldertype.h"
#include "llnotificationptr.h"
class LLButton;
@ -37,8 +38,10 @@ class LLInventoryCategoriesObserver;
class LLInventoryCategoryAddedObserver;
class LLInventoryPanel;
class LLLoadingIndicator;
class LLNotification;
class LLTextBox;
class LLView;
class LLWindowShade;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -55,12 +58,15 @@ public:
// virtuals
BOOL postBuild();
void onClose(bool app_quitting);
void onOpen(const LLSD& key);
BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg);
void showNotification(LLNotificationPtr notify);
protected:
void importReportResults(U32 status, const LLSD& content);
@ -86,6 +92,8 @@ private:
LLTextBox * mInventoryTitle;
LLButton * mImportButton;
LLWindowShade * mWindowShade;
};
#endif // LL_LLFLOATEROUTBOX_H

View File

@ -283,9 +283,17 @@ class LLBrowserNotification : public LLSingleton<LLBrowserNotification>
{
public:
virtual bool processNotification(const LLSD& notify);
};
/**
* Handler for outbox notifications
*/
class LLOutboxNotification : public LLSingleton<LLOutboxNotification>
{
public:
virtual bool processNotification(const LLSD& notify);
};
class LLHandlerUtil
{
public:

View File

@ -62,6 +62,7 @@ void LLNotificationManager::init()
LLNotificationChannel::buildChannel("Offer", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "offer"));
LLNotificationChannel::buildChannel("Hints", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "hint"));
LLNotificationChannel::buildChannel("Browser", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "browser"));
LLNotificationChannel::buildChannel("Outbox", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "outbox"));
LLNotifications::instance().getChannel("Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
LLNotifications::instance().getChannel("NotificationTips")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
@ -72,6 +73,7 @@ void LLNotificationManager::init()
LLNotifications::instance().getChannel("Offer")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1));
LLNotifications::instance().getChannel("Browser")->connectChanged(boost::bind(&LLBrowserNotification::processNotification, LLBrowserNotification::getInstance(), _1));
LLNotifications::instance().getChannel("Outbox")->connectChanged(boost::bind(&LLOutboxNotification::processNotification, LLOutboxNotification::getInstance(), _1));
mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
mNotifyHandlers["notifytip"] = boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD()));

View File

@ -387,22 +387,9 @@ with the same filename but different name
<texture name="OptionsMenu_Off" file_name="icons/OptionsMenu_Off.png" preload="false" />
<texture name="OptionsMenu_Press" file_name="icons/OptionsMenu_Press.png" preload="false" />
<texture name="OutboxPush_Disabled" file_name="icons/OutboxPush_Disabled.png" preload="true" />
<texture name="OutboxPush_Off" file_name="icons/OutboxPush_Off.png" preload="true" />
<texture name="OutboxPush_On" file_name="icons/OutboxPush_On.png" preload="true" />
<texture name="OutboxPush_On_Over" file_name="icons/OutboxPush_On_Over.png" preload="true" />
<texture name="OutboxPush_Over" file_name="icons/OutboxPush_Over.png" preload="true" />
<texture name="OutboxPush_Press" file_name="icons/OutboxPush_Press.png" preload="true" />
<texture name="OutboxPush_Progress_1" file_name="icons/OutboxPush_Progress_1.png" preload="true" />
<texture name="OutboxPush_Progress_2" file_name="icons/OutboxPush_Progress_2.png" preload="true" />
<texture name="OutboxPush_Progress_3" file_name="icons/OutboxPush_Progress_3.png" preload="true" />
<texture name="OutboxPush_Progress_4" file_name="icons/OutboxPush_Progress_4.png" preload="true" />
<texture name="OutboxPush_Progress_5" file_name="icons/OutboxPush_Progress_5.png" preload="true" />
<texture name="OutboxPush_Progress_6" file_name="icons/OutboxPush_Progress_6.png" preload="true" />
<texture name="OutboxPush_Selected" file_name="icons/OutboxPush_Selected.png" preload="true" />
<texture name="OutboxPush_Selected_Disabled" file_name="icons/OutboxPush_Selected_Disabled.png" preload="true" />
<texture name="OutboxPush_Selected_Over" file_name="icons/OutboxPush_Selected_Over.png" preload="true" />
<texture name="OutboxPush_Selected_Press" file_name="icons/OutboxPush_Selected_Press.png" preload="true" />
<texture name="OutboxStatus_Success" file_name="green_checkmark.png" preload="false" />
<texture name="OutboxStatus_Warning" file_name="icons/pop_up_caution.png" preload="false" />
<texture name="OutboxStatus_Error" file_name="red_x.png" preload="false" />
<texture name="PanOrbit_Off" file_name="bottomtray/PanOrbit_Off.png" preload="false" />

View File

@ -212,33 +212,44 @@ Save changes to current clothing/body part?
</notification>
<notification
icon="alertmodal.tga"
icon="OutboxStatus_Success"
name="OutboxImportComplete"
type="alertmodal">
Marketplace import complete.
type="outbox">
Success
All folders were successfully sent to the Marketplace.
<usetemplate
name="okbutton"
yestext="Hooray!"/>
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
icon="OutboxStatus_Warning"
name="OutboxImportHadErrors"
type="alertmodal">
Marketplace import completed with errors! Please correct the problems in your outbox and retry. Thanks.
type="outbox">
Some folders did not transfer
Errors occurred when some folders were sent to the Marketplace. Those folders are still in your Merchant Outbox. See the error log for more information.
<usetemplate
name="okbutton"
yestext="Boo!"/>
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
icon="OutboxStatus_Error"
name="OutboxImportFailed"
type="alertmodal">
Marketplace import failed with error [ERROR_CODE]! Please try again later. Thanks.
type="outbox">
Transfer failed
No folders were sent to the Marketplace because of a system or network error. Try again later.
Error [ERROR_CODE]
<usetemplate
name="okbutton"
yestext="Rats!"/>
yestext="OK"/>
</notification>