From cc92db1f353de96f6d27863b92671b2d847536f4 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 9 Dec 2011 16:19:03 -0800 Subject: Moved outbox import confirmations to window shades on the merchant outbox floater, rather than modal dialogs. --- indra/llui/llwindowshade.cpp | 5 ++ indra/llui/llwindowshade.h | 2 + indra/newview/llfloateroutbox.cpp | 61 +++++++++++++++++++++- indra/newview/llfloateroutbox.h | 8 +++ indra/newview/llnotificationhandler.h | 10 +++- indra/newview/llnotificationmanager.cpp | 2 + indra/newview/skins/default/textures/textures.xml | 19 ++----- .../newview/skins/default/xui/en/notifications.xml | 35 ++++++++----- 8 files changed, 112 insertions(+), 30 deletions(-) diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp index cf76202215..b21c088a1f 100644 --- a/indra/llui/llwindowshade.cpp +++ b/indra/llui/llwindowshade.cpp @@ -297,6 +297,11 @@ void LLWindowShade::hide() setMouseOpaque(false); } +bool LLWindowShade::isShown() const +{ + return getChildRef("notification_area").getVisible(); +} + void LLWindowShade::onCloseNotification() { LLNotifications::instance().cancel(mNotification); diff --git a/indra/llui/llwindowshade.h b/indra/llui/llwindowshade.h index 09ffc2cd54..cb8f223a84 100644 --- a/indra/llui/llwindowshade.h +++ b/indra/llui/llwindowshade.h @@ -48,6 +48,8 @@ public: void show(); /*virtual*/ void draw(); void hide(); + + bool isShown() const; private: friend class LLUICtrlFactory; diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 619be87187..8d64214e8c 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -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("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(params); + + addChild(mWindowShade); + mWindowShade->show(); +} + diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h index 3d2ce86144..8023434675 100644 --- a/indra/newview/llfloateroutbox.h +++ b/indra/newview/llfloateroutbox.h @@ -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 diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 28a69f2373..23dbb6b047 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -283,9 +283,17 @@ class LLBrowserNotification : public LLSingleton { public: virtual bool processNotification(const LLSD& notify); +}; +/** + * Handler for outbox notifications + */ +class LLOutboxNotification : public LLSingleton +{ +public: + virtual bool processNotification(const LLSD& notify); }; - + class LLHandlerUtil { public: diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index 6988227128..6105eff8ea 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -62,6 +62,7 @@ void LLNotificationManager::init() LLNotificationChannel::buildChannel("Offer", "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, "offer")); LLNotificationChannel::buildChannel("Hints", "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, "hint")); LLNotificationChannel::buildChannel("Browser", "Visible", LLNotificationFilters::filterBy(&LLNotification::getType, "browser")); + LLNotificationChannel::buildChannel("Outbox", "Visible", LLNotificationFilters::filterBy(&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(new LLScriptHandler(NT_NOTIFY, LLSD())); mNotifyHandlers["notifytip"] = boost::shared_ptr(new LLTipHandler(NT_NOTIFY, LLSD())); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 5da1276881..e4a8622a4b 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -387,22 +387,9 @@ with the same filename but different name - - - - - - - - - - - - - - - - + + + diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 8d0d76b58e..b174d51421 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -212,33 +212,44 @@ Save changes to current clothing/body part? -Marketplace import complete. + type="outbox"> +Success + +All folders were successfully sent to the Marketplace. + + yestext="OK"/> -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. + + yestext="OK"/> -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] + + yestext="OK"/> -- cgit v1.2.3