From 7c0a6df30a1d78611782767763b7710702b96336 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 20 Sep 2010 16:21:00 -0700 Subject: EXP-60 FIX not showing after Re-enabling Hints in same session --- indra/newview/llagent.cpp | 1 - indra/newview/llfirstuse.cpp | 13 ++++++++----- indra/newview/llhints.cpp | 29 +++++++++++++---------------- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index fec29eac17..c9bd7851ed 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1557,7 +1557,6 @@ void LLAgent::updateAgentPosition(const F32 dt, const F32 yaw_radians, const S32 if (mMoveTimer.getStarted() && mMoveTimer.getElapsedTimeF32() > gSavedSettings.getF32("NotMovingHintTimeout")) { LLFirstUse::notMoving(); - mMoveTimer.stop(); } propagate(dt); diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 1764d6b145..dd08706f4f 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -130,12 +130,15 @@ void LLFirstUse::firstUseNotification(const std::string& control_var, bool enabl if (enable) { - LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL; + if (gSavedSettings.getBOOL("EnableUIHints")) + { + LL_DEBUGS("LLFirstUse") << "Trigger first use notification " << notification_name << LL_ENDL; - // if notification doesn't already exist and this notification hasn't been disabled... - if (gWarningSettings.getBOOL(control_var)) - { // create new notification - LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload.with("control_var", control_var))); + // if notification doesn't already exist and this notification hasn't been disabled... + if (gWarningSettings.getBOOL(control_var)) + { // create new notification + LLNotifications::instance().add(LLNotification::Params().name(notification_name).substitutions(args).payload(payload.with("control_var", control_var))); + } } } else diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 393aa188e1..a8274b3887 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -310,26 +310,23 @@ std::map LLHints::sHints; //static void LLHints::show(LLNotificationPtr hint) { - if (gSavedSettings.getBOOL("EnableUIHints")) - { - LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams()); + LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams()); - LLParamSDParser parser; - parser.readSD(hint->getPayload(), p, true); - p.notification = hint; + LLParamSDParser parser; + parser.readSD(hint->getPayload(), p, true); + p.notification = hint; - if (p.validateBlock()) - { - LLHintPopup* popup = new LLHintPopup(p); + if (p.validateBlock()) + { + LLHintPopup* popup = new LLHintPopup(p); - sHints[hint] = popup; + sHints[hint] = popup; - LLView* hint_holder = gViewerWindow->getHintHolder(); - if (hint_holder) - { - hint_holder->addChild(popup); - popup->centerWithin(hint_holder->getLocalRect()); - } + LLView* hint_holder = gViewerWindow->getHintHolder(); + if (hint_holder) + { + hint_holder->addChild(popup); + popup->centerWithin(hint_holder->getLocalRect()); } } } -- cgit v1.2.3 From a748466377982f376d4901e3450e6b927cf96a4d Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 20 Sep 2010 19:16:17 -0700 Subject: EXP-82 FIX MOTD open in external browser notification not given until fully logged in reviewed by Monroe --- indra/llui/llnotifications.cpp | 6 ++++++ indra/llui/llnotifications.h | 1 + indra/newview/llimhandler.cpp | 2 +- indra/newview/llnotificationalerthandler.cpp | 2 +- indra/newview/llnotificationgrouphandler.cpp | 2 +- indra/newview/llnotificationofferhandler.cpp | 2 +- indra/newview/llnotificationscripthandler.cpp | 2 +- indra/newview/llnotificationtiphandler.cpp | 6 +++--- indra/newview/llprogressview.cpp | 18 ++++++++++++++++++ indra/newview/llprogressview.h | 1 + 10 files changed, 34 insertions(+), 8 deletions(-) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 2a7ca4c321..9d14c4149c 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -628,6 +628,12 @@ void LLNotification::respond(const LLSD& response) update(); } +void LLNotification::respondWithDefault() +{ + respond(getResponseTemplate(WITH_DEFAULT_BUTTON)); +} + + const std::string& LLNotification::getName() const { return mTemplatep->mName; diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index dcb7b48f92..4fe1687f0e 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -441,6 +441,7 @@ public: LLSD asLLSD(); void respond(const LLSD& sd); + void respondWithDefault(); void* getResponder() { return mResponderObj; } diff --git a/indra/newview/llimhandler.cpp b/indra/newview/llimhandler.cpp index bc76092a20..cd71da7393 100644 --- a/indra/newview/llimhandler.cpp +++ b/indra/newview/llimhandler.cpp @@ -115,7 +115,7 @@ bool LLIMHandler::processNotification(const LLSD& notify) { mChannel->killToastByNotificationID(notification->getID()); } - return true; + return false; } //-------------------------------------------------------------------------- diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp index dcbf6b64ce..9d824dcd59 100644 --- a/indra/newview/llnotificationalerthandler.cpp +++ b/indra/newview/llnotificationalerthandler.cpp @@ -133,7 +133,7 @@ bool LLAlertHandler::processNotification(const LLSD& notify) if(channel) channel->killToastByNotificationID(notification->getID()); } - return true; + return false; } //-------------------------------------------------------------------------- diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp index 9933a8a49c..9b7fdaef82 100644 --- a/indra/newview/llnotificationgrouphandler.cpp +++ b/indra/newview/llnotificationgrouphandler.cpp @@ -104,7 +104,7 @@ bool LLGroupHandler::processNotification(const LLSD& notify) { mChannel->killToastByNotificationID(notification->getID()); } - return true; + return false; } //-------------------------------------------------------------------------- diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 85f95bd0c7..68fd65be0f 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -179,7 +179,7 @@ bool LLOfferHandler::processNotification(const LLSD& notify) } } - return true; + return false; } //-------------------------------------------------------------------------- diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index b4d28bb346..45590c3cdb 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -130,7 +130,7 @@ bool LLScriptHandler::processNotification(const LLSD& notify) mChannel->killToastByNotificationID(notification->getID()); } } - return true; + return false; } //-------------------------------------------------------------------------- diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 94612975a2..02b217fc94 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -96,7 +96,7 @@ bool LLTipHandler::processNotification(const LLSD& notify) LLNearbyChat>("nearby_chat", LLSD()); if (nearby_chat->getVisible()) { - return true; + return false; } } @@ -121,7 +121,7 @@ bool LLTipHandler::processNotification(const LLSD& notify) // don't spawn toast for inventory accepted/declined offers if respective IM window is open (EXT-5909) if (!LLHandlerUtil::canSpawnToast(notification)) { - return true; + return false; } LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); @@ -144,7 +144,7 @@ bool LLTipHandler::processNotification(const LLSD& notify) { mChannel->killToastByNotificationID(notification->getID()); } - return true; + return false; } //-------------------------------------------------------------------------- diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index aeb0a35ae4..c6bd600403 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -41,6 +41,7 @@ #include "llagent.h" #include "llbutton.h" #include "llfocusmgr.h" +#include "llnotifications.h" #include "llprogressbar.h" #include "llstartup.h" #include "llviewercontrol.h" @@ -90,6 +91,8 @@ BOOL LLProgressView::postBuild() // hidden initially, until we need it LLPanel::setVisible(FALSE); + LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLProgressView::onAlertModal, this, _1)); + sInstance = this; return TRUE; } @@ -289,3 +292,18 @@ bool LLProgressView::handleUpdate(const LLSD& event_data) } return false; } + +bool LLProgressView::onAlertModal(const LLSD& notify) +{ + // if the progress view is visible, it will obscure the notification window + // in this case, we want to auto-accept WebLaunchExternalTarget notifications + if (isInVisibleChain()) + { + LLNotificationPtr notifyp = LLNotifications::instance().find(notify["id"].asUUID()); + if (notifyp && notifyp->getName() == "WebLaunchExternalTarget") + { + notifyp->respondWithDefault(); + } + } + return false; +} diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index 01d5e16534..be1744f08a 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -59,6 +59,7 @@ public: static void onCancelButtonClicked( void* ); static void onClickMessage(void*); + bool onAlertModal(const LLSD& sd); protected: LLProgressBar* mProgressBar; -- cgit v1.2.3 From 71259fcccbfa834eab35eb3e98a7afc93786b32f Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 20 Sep 2010 19:55:16 -0700 Subject: EXP-77 FIX Pop-up warning flashes on and off even whan all popups are enabled in settings --- indra/newview/llbrowsernotification.cpp | 9 ++++++++- indra/newview/llmediactrl.cpp | 5 +++-- indra/newview/llmediactrl.h | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp index ee19701773..d6a813d608 100644 --- a/indra/newview/llbrowsernotification.cpp +++ b/indra/newview/llbrowsernotification.cpp @@ -30,12 +30,19 @@ #include "llnotificationhandler.h" #include "llnotifications.h" #include "llfloaterreg.h" +#include "llmediactrl.h" using namespace LLNotificationsUI; bool LLBrowserNotification::processNotification(const LLSD& notify) { + LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); + if (!notification) return false; - // browser notifications are currently handled directly by the LLMediaCtrl instance that spawned them + LLMediaCtrl* media_instance = LLMediaCtrl::getInstance(notification->getPayload()["media_id"].asUUID()); + if (media_instance) + { + media_instance->showNotification(notification); + } return false; } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 9d172b7301..33e46e70f7 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -77,6 +77,7 @@ LLMediaCtrl::Params::Params() LLMediaCtrl::LLMediaCtrl( const Params& p) : LLPanel( p ), + LLInstanceTracker(LLUUID::generateNewID()), mTextureDepthBytes( 4 ), mBorder(NULL), mFrequentUpdates( true ), @@ -1032,7 +1033,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) LLNotification::Params notify_params; notify_params.name = "PopupAttempt"; - notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid); + notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid).with("media_id", getKey()); notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2); if (mTrusted) @@ -1041,7 +1042,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) } else { - showNotification(LLNotifications::instance().add(notify_params)); + LLNotifications::instance().add(notify_params); } break; }; diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index f010e5f4c8..65dfbbff78 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -40,7 +40,8 @@ class LLUICtrlFactory; class LLMediaCtrl : public LLPanel, public LLViewerMediaObserver, - public LLViewerMediaEventEmitter + public LLViewerMediaEventEmitter, + public LLInstanceTracker { LOG_CLASS(LLMediaCtrl); public: -- cgit v1.2.3