From e66585aa4fce98d4e58656cadfdbb65b3d808cfa Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Sep 2010 11:47:13 -0700 Subject: EXP-74 FIX Pop-up warning given for links in Home Side Panel in Viewer Reviewed by Callum --- indra/newview/llmediactrl.cpp | 24 +++++++++++++++------- indra/newview/llmediactrl.h | 4 +++- .../default/xui/en/floater_buy_currency_html.xml | 1 + .../skins/default/xui/en/floater_help_browser.xml | 1 + .../skins/default/xui/en/floater_lsl_guide.xml | 1 + .../skins/default/xui/en/floater_search.xml | 1 + indra/newview/skins/default/xui/en/floater_tos.xml | 1 + indra/newview/skins/default/xui/en/panel_login.xml | 1 + .../default/xui/en/panel_sidetray_home_tab.xml | 1 + 9 files changed, 27 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 621f241227..0fd18303bb 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -69,7 +69,8 @@ LLMediaCtrl::Params::Params() texture_height("texture_height", 1024), caret_color("caret_color"), initial_mime_type("initial_mime_type"), - media_id("media_id") + media_id("media_id"), + always_allow_popups("always_allow_popups", false) { tab_stop(false); } @@ -95,7 +96,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mTextureWidth ( 1024 ), mTextureHeight ( 1024 ), mClearCache(false), - mHomePageMimeType(p.initial_mime_type) + mHomePageMimeType(p.initial_mime_type), + mAlwaysAllowPopups(p.always_allow_popups) { { LLColor4 color = p.caret_color().get(); @@ -1042,11 +1044,19 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) std::string target = self->getClickTarget(); std::string uuid = self->getClickUUID(); - LLNotificationPtr popup_notify = LLNotifications::instance().add("PopupAttempt", - LLSD(), - LLSD().with("target", target).with("url", url).with("uuid", uuid), - boost::bind(&LLMediaCtrl::onPopup, this, _1, _2)); - showNotification(popup_notify); + LLNotification::Params notify_params; + notify_params.name = "PopupAttempt"; + notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid); + notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2); + + if (mAlwaysAllowPopups) + { + LLNotifications::instance().forceResponse(notify_params, 0); + } + else + { + showNotification(LLNotifications::instance().add(notify_params)); + } break; }; diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index b8e10d5591..dc18a1130e 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -51,7 +51,8 @@ public: Optional border_visible, ignore_ui_scale, hide_loading, - decouple_texture_size; + decouple_texture_size, + always_allow_popups; Optional texture_width, texture_height; @@ -193,6 +194,7 @@ public: S32 mTextureWidth; S32 mTextureHeight; bool mClearCache; + bool mAlwaysAllowPopups; boost::shared_ptr mCurNotification; }; diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml index 4b990fa566..0226b75d0a 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml @@ -16,6 +16,7 @@ https://quick-buy.secondlife.com/[LANGUAGE]/display/?sa=[SPECIFIC_AMOUNT]&sum=[SUM]&msg=[MSG]&bal=[BAL]