diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llagent.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llbrowsernotification.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llfirstuse.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llhints.cpp | 29 | ||||
-rw-r--r-- | indra/newview/llimhandler.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llmediactrl.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llmediactrl.h | 3 | ||||
-rw-r--r-- | indra/newview/llnotificationalerthandler.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llnotificationgrouphandler.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llnotificationofferhandler.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llnotificationscripthandler.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llnotificationtiphandler.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llprogressview.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llprogressview.h | 1 |
14 files changed, 61 insertions, 34 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/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/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<LLNotificationPtr, class LLHintPopup*> LLHints::sHints; //static void LLHints::show(LLNotificationPtr hint) { - if (gSavedSettings.getBOOL("EnableUIHints")) - { - LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>()); + LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>()); - 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()); } } } 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/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<LLMediaCtrl, LLUUID> { LOG_CLASS(LLMediaCtrl); public: 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; |