From 387011a1ff519d0e339b446ff5d02f0d009b7e5d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 16 Sep 2010 00:45:27 -0700 Subject: EXP-29 WIP Implement popup blocking added web popup notification overlay --- indra/newview/llbrowsernotification.cpp | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 indra/newview/llbrowsernotification.cpp (limited to 'indra/newview/llbrowsernotification.cpp') diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp new file mode 100644 index 0000000000..e162527e23 --- /dev/null +++ b/indra/newview/llbrowsernotification.cpp @@ -0,0 +1,57 @@ +/** + * @file llbrowsernotification.cpp + * @brief Notification Handler Class for browser popups + * + * $LicenseInfo:firstyear=2000&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" // must be first include + +#include "llnotificationhandler.h" +#include "llnotifications.h" +#include "llfloatermediabrowser.h" +#include "llfloaterreg.h" + +using namespace LLNotificationsUI; + +bool LLBrowserNotification::processNotification(const LLSD& notify) +{ + LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); + + if (notification) + { + LLFloaterMediaBrowser* browserp = dynamic_cast(LLFloaterReg::findInstance("media_browser", notification->getPayload()["source"])); + if (notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "load") + { + if (browserp) + { + browserp->showNotification(notification); + } + } + else if (notify["sigtype"].asString() == "delete") + { + browserp->hideNotification(); + } + } + return false; +} -- cgit v1.2.3 From d2a0327b6e89ca678e50e58dd685ea80e4c51cb5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 16 Sep 2010 16:29:53 -0700 Subject: popup blocking notifications now handled in all web_browser instances, not just llfloatermediabrowser --- indra/newview/llbrowsernotification.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'indra/newview/llbrowsernotification.cpp') diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp index e162527e23..cc54d10944 100644 --- a/indra/newview/llbrowsernotification.cpp +++ b/indra/newview/llbrowsernotification.cpp @@ -36,22 +36,6 @@ using namespace LLNotificationsUI; bool LLBrowserNotification::processNotification(const LLSD& notify) { - LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID()); - - if (notification) - { - LLFloaterMediaBrowser* browserp = dynamic_cast(LLFloaterReg::findInstance("media_browser", notification->getPayload()["source"])); - if (notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "load") - { - if (browserp) - { - browserp->showNotification(notification); - } - } - else if (notify["sigtype"].asString() == "delete") - { - browserp->hideNotification(); - } - } + // browser notifications are currently handled directly by the LLMediaCtrl instance that spawned them return false; } -- cgit v1.2.3 From 83bb4b9518da813a42e49366cea15e5ae9dc7507 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 16 Sep 2010 22:10:30 -0700 Subject: fixed merge --- indra/newview/llbrowsernotification.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llbrowsernotification.cpp') diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp index cc54d10944..8eb0bb1e0b 100644 --- a/indra/newview/llbrowsernotification.cpp +++ b/indra/newview/llbrowsernotification.cpp @@ -28,9 +28,9 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationhandler.h" -#include "llnotifications.h" -#include "llfloatermediabrowser.h" -#include "llfloaterreg.h" +//#include "llnotifications.h" +//#include "llfloatermediabrowser.h" +//#include "llfloaterreg.h" using namespace LLNotificationsUI; -- cgit v1.2.3 From 949b60465593764118c03d0f4e112f69c41bab31 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Sep 2010 15:01:44 -0700 Subject: Backed out changeset: d71309f8bd0e --- indra/newview/llbrowsernotification.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llbrowsernotification.cpp') diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp index 8eb0bb1e0b..cc54d10944 100644 --- a/indra/newview/llbrowsernotification.cpp +++ b/indra/newview/llbrowsernotification.cpp @@ -28,9 +28,9 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llnotificationhandler.h" -//#include "llnotifications.h" -//#include "llfloatermediabrowser.h" -//#include "llfloaterreg.h" +#include "llnotifications.h" +#include "llfloatermediabrowser.h" +#include "llfloaterreg.h" using namespace LLNotificationsUI; -- cgit v1.2.3 From 57c1845e2d7274b5cb28dc31a41a00088c2ecdda Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Sep 2010 16:06:51 -0700 Subject: clear popup notifications on navigate --- indra/newview/llbrowsernotification.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llbrowsernotification.cpp') diff --git a/indra/newview/llbrowsernotification.cpp b/indra/newview/llbrowsernotification.cpp index cc54d10944..ee19701773 100644 --- a/indra/newview/llbrowsernotification.cpp +++ b/indra/newview/llbrowsernotification.cpp @@ -29,13 +29,13 @@ #include "llnotificationhandler.h" #include "llnotifications.h" -#include "llfloatermediabrowser.h" #include "llfloaterreg.h" using namespace LLNotificationsUI; bool LLBrowserNotification::processNotification(const LLSD& notify) { + // browser notifications are currently handled directly by the LLMediaCtrl instance that spawned them return false; } -- 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 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llbrowsernotification.cpp') 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; } -- cgit v1.2.3