From d27833382868b76673f9dbe744c01d92704f21b0 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 13 Jan 2010 19:16:59 -0800 Subject: fix for mac fast timer resetting too often --- indra/llcommon/llfasttimer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 5058a2e772..85c78198dc 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -77,7 +77,7 @@ inline U32 get_cpu_clock_count_64() { U64 x; __asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); - return x >> 8; + return x; } #endif -- cgit v1.2.3 From 7901bfe6a530783449ecfd8966974a9c9c714363 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 14 Jan 2010 09:47:33 +0200 Subject: corrected llinspecttoast file header; --HG-- branch : product-engine --- indra/newview/llinspecttoast.cpp | 4 ++-- indra/newview/llinspecttoast.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index 0139d76f93..074268dacf 100644 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -1,6 +1,6 @@ /** - * @file lltoast.h - * @brief This class implements a placeholder for any notification panel. + * @file llinspecttoast.cpp + * @brief Toast inspector implementation. * * $LicenseInfo:firstyear=2003&license=viewergpl$ * diff --git a/indra/newview/llinspecttoast.h b/indra/newview/llinspecttoast.h index c4403d6196..ff547154b8 100644 --- a/indra/newview/llinspecttoast.h +++ b/indra/newview/llinspecttoast.h @@ -1,6 +1,5 @@ /** - * @file lltoast.h - * @brief This class implements a placeholder for any notification panel. + * @file llinspecttoast.h * * $LicenseInfo:firstyear=2003&license=viewergpl$ * -- cgit v1.2.3 From a42ef84b9f18cfafc3ebeed1b37cd03e1e006dff Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 14 Jan 2010 10:12:07 +0200 Subject: =?UTF-8?q?fixed=20EXT-3732=20=E2=80=9CRemove=20"x=20other=20alert?= =?UTF-8?q?s"=20toast=E2=80=9C,=20removed=20overflow=20toast=20related=20f?= =?UTF-8?q?unctionality;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnearbychathandler.cpp | 1 - indra/newview/llscreenchannel.cpp | 125 +--------------------------------- indra/newview/llscreenchannel.h | 15 +--- 3 files changed, 4 insertions(+), 137 deletions(-) (limited to 'indra') diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 9e13a626b4..de4249a1dc 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -302,7 +302,6 @@ LLNearbyChatHandler::LLNearbyChatHandler(e_notification_type type, const LLSD& i channel->setCreatePanelCallback(callback); mChannel = LLChannelManager::getInstance()->addChannel(channel); - mChannel->setOverflowFormatString("You have %d unread nearby chat messages"); } LLNearbyChatHandler::~LLNearbyChatHandler() diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index d0a0dd877f..027f3daffb 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -59,17 +59,14 @@ bool LLScreenChannel::mWasStartUpToastShown = false; // LLScreenChannelBase ////////////////////// LLScreenChannelBase::LLScreenChannelBase(const LLUUID& id) : - mOverflowToastPanel(NULL) - ,mToastAlignment(NA_BOTTOM) + mToastAlignment(NA_BOTTOM) ,mCanStoreToasts(true) ,mHiddenToastsNum(0) - ,mOverflowToastHidden(false) ,mHoveredToast(NULL) ,mControlHovering(false) ,mShowToasts(true) { mID = id; - mOverflowFormatString = LLTrans::getString("OverflowInfoChannelString"); mWorldViewRectConnection = gViewerWindow->setOnWorldViewRectUpdated(boost::bind(&LLScreenChannelBase::updatePositionAndSize, this, _1, _2)); setMouseOpaque( false ); setVisible(FALSE); @@ -217,11 +214,6 @@ void LLScreenChannel::addToast(const LLToast::Params& p) ToastElem new_toast_elem(p); - // reset HIDDEN flags for the Overflow Toast - mOverflowToastHidden = false; - if(mOverflowToastPanel) - mOverflowToastPanel->setIsHidden(false); - new_toast_elem.toast->setOnFadeCallback(boost::bind(&LLScreenChannel::onToastFade, this, _1)); new_toast_elem.toast->setOnToastDestroyedCallback(boost::bind(&LLScreenChannel::onToastDestroyed, this, _1)); if(mControlHovering) @@ -322,8 +314,6 @@ void LLScreenChannel::loadStoredToastsToChannel() if(mStoredToastList.size() == 0) return; - - mOverflowToastHidden = false; for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it) { @@ -344,8 +334,6 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) if( it == mStoredToastList.end() ) return; - mOverflowToastHidden = false; - LLToast* toast = (*it).toast; if(toast->getVisible()) @@ -490,7 +478,7 @@ void LLScreenChannel::showToastsBottom() if(floater && floater->overlapsScreenChannel()) { LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); - if(toast_rect.mTop + getOverflowToastHeight() + toast_margin > world_rect.mTop) + if(toast_rect.mTop > world_rect.mTop) { break; } @@ -526,7 +514,7 @@ void LLScreenChannel::showToastsBottom() } } - if(it != mToastList.rend() && !mOverflowToastHidden) + if(it != mToastList.rend()) { mHiddenToastsNum = 0; for(; it != mToastList.rend(); it++) @@ -535,7 +523,6 @@ void LLScreenChannel::showToastsBottom() (*it).toast->setVisible(FALSE); mHiddenToastsNum++; } - createOverflowToast(bottom, gSavedSettings.getS32("NotificationTipToastLifeTime")); } else { @@ -565,94 +552,6 @@ void LLScreenChannel::showToastsTop() { } -//-------------------------------------------------------------------------- -void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer) -{ - LLRect toast_rect; - LLToast::Params p; - p.lifetime_secs = timer; - - if(!mOverflowToastPanel) - mOverflowToastPanel = new LLToast(p); - - if(!mOverflowToastPanel) - return; - - mOverflowToastPanel->startFading(); - mOverflowToastPanel->setOnFadeCallback(boost::bind(&LLScreenChannel::onOverflowToastHide, this)); - - LLTextBox* text_box = mOverflowToastPanel->getChild("toast_text"); - std::string text = llformat(mOverflowFormatString.c_str(),mHiddenToastsNum); - if(mHiddenToastsNum == 1) - { - text += "."; - } - else - { - text += "s."; - } - - toast_rect = mOverflowToastPanel->getRect(); - mOverflowToastPanel->reshape(getRect().getWidth(), toast_rect.getHeight(), true); - toast_rect.setLeftTopAndSize(getRect().mLeft, bottom + toast_rect.getHeight()+gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight()); - mOverflowToastPanel->setRect(toast_rect); - - // don't show overflow toast if there is not enough space for it. - LLDockableFloater* floater = dynamic_cast(LLDockableFloater::getInstanceHandle().get()); - if(floater && floater->overlapsScreenChannel()) - { - LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); - if(toast_rect.mTop > world_rect.mTop) - { - closeOverflowToastPanel(); - return; - } - } - - text_box->setValue(text); - text_box->setVisible(TRUE); - - mOverflowToastPanel->setVisible(TRUE); -} - -//-------------------------------------------------------------------------- -void LLScreenChannel::onOverflowToastHide() -{ - mOverflowToastHidden = true; - - // remove all hidden toasts from channel and save interactive notifications - for(std::vector::iterator it = mToastList.begin(); it != mToastList.end();) - { - if(!(*it).toast->getVisible()) - { - if((*it).toast->getCanBeStored()) - { - storeToast((*it)); - } - else - { - deleteToast((*it).toast); - } - - it = mToastList.erase(it); - } - else - { - ++it; - } - } -} - -//-------------------------------------------------------------------------- -void LLScreenChannel::closeOverflowToastPanel() -{ - if(mOverflowToastPanel != NULL) - { - mOverflowToastPanel->setVisible(FALSE); - mOverflowToastPanel->stopFading(); - } -} - //-------------------------------------------------------------------------- void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer) { @@ -698,24 +597,6 @@ F32 LLScreenChannel::getHeightRatio() return ratio; } -S32 LLScreenChannel::getOverflowToastHeight() -{ - if(mOverflowToastPanel) - { - return mOverflowToastPanel->getRect().getHeight(); - } - - static S32 height = 0; - if(0 == height) - { - LLToast::Params p; - LLToast* toast = new LLToast(p); - height = toast->getRect().getHeight(); - delete toast; - } - return height; -} - //-------------------------------------------------------------------------- void LLScreenChannel::updateStartUpString(S32 num) { diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 054f92096c..88053d87d9 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -72,8 +72,7 @@ public: virtual void setToastAlignment(EToastAlignment align) {mToastAlignment = align;} virtual void setChannelAlignment(EChannelAlignment align) {mChannelAlignment = align;} - virtual void setOverflowFormatString ( const std::string& str) { mOverflowFormatString = str; } - + // kill or modify a toast by its ID virtual void killToastByNotificationID(LLUUID id) {}; virtual void modifyToastNotificationByID(LLUUID id, LLSD data) {}; @@ -121,17 +120,13 @@ protected: LLToast* mHoveredToast; bool mCanStoreToasts; bool mDisplayToastsAlways; - bool mOverflowToastHidden; // controls whether a channel shows toasts or not bool mShowToasts; // EToastAlignment mToastAlignment; EChannelAlignment mChannelAlignment; - // attributes for the Overflow Toast S32 mHiddenToastsNum; - LLToast* mOverflowToastPanel; - std::string mOverflowFormatString; // channel's ID LLUUID mID; @@ -192,8 +187,6 @@ public: void removeToastsBySessionID(LLUUID id); // remove all storable toasts from screen and store them void removeAndStoreAllStorableToasts(); - // close the Overflow Toast - void closeOverflowToastPanel(); // close the StartUp Toast void closeStartUpToast(); @@ -261,7 +254,6 @@ private: void onToastHover(LLToast* toast, bool mouse_enter); void onToastFade(LLToast* toast); void onToastDestroyed(LLToast* toast); - void onOverflowToastHide(); void onStartUpToastHide(); // @@ -274,9 +266,6 @@ private: void showToastsCentre(); void showToastsTop(); - // create the Overflow Toast - void createOverflowToast(S32 bottom, F32 timer); - // create the StartUp Toast void createStartUpToast(S32 notif_num, F32 timer); @@ -285,8 +274,6 @@ private: */ static F32 getHeightRatio(); - S32 getOverflowToastHeight(); - // Channel's flags static bool mWasStartUpToastShown; -- cgit v1.2.3 From e727800829be2ecf236b726b1ec7693a3adad908 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 14 Jan 2010 11:16:33 +0200 Subject: =?UTF-8?q?fixed=20EXT-3748=20=E2=80=9CClicking=20notification=20t?= =?UTF-8?q?oast=20related=20to=20an=20alert=20in=20Notification=20well=20s?= =?UTF-8?q?hould=20not=20close=20Notification=20well=E2=80=9D,=20included?= =?UTF-8?q?=20toast=20inspector=20to=20transient=20manager=20exclude=20lis?= =?UTF-8?q?t;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llinspecttoast.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index 074268dacf..3ca8fa2f56 100644 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -37,6 +37,7 @@ #include "llfloaterreg.h" #include "llscreenchannel.h" #include "llchannelmanager.h" +#include "lltransientfloatermgr.h" using namespace LLNotificationsUI; @@ -70,10 +71,12 @@ LLInspectToast::LLInspectToast(const LLSD& notification_id) : llwarns << "Could not get requested screen channel." << llendl; return; } + + LLTransientFloaterMgr::getInstance()->addControlView(this); } LLInspectToast::~LLInspectToast() { - + LLTransientFloaterMgr::getInstance()->removeControlView(this); } void LLInspectToast::onOpen(const LLSD& notification_id) -- cgit v1.2.3 From 0556c2c047e38d9b5e18cd31b219764c3dc89aa4 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 14 Jan 2010 10:22:22 +0000 Subject: EXT-3752: Change color of "Sign up" link on login screen. --- indra/newview/skins/default/xui/en/panel_login.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index e5df37e366..df942b1a26 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -186,6 +186,7 @@ height="80"> Date: Thu, 14 Jan 2010 11:57:03 +0000 Subject: EXT-3624: Support "_blank" href target types. Support href links in web views that have a target attribute set to "_blank". This will open the link in the user's preferred browser (internal or external, as defined in Prefs). This change relies on the new llqtwebkit package that has just been pushed. Also updated the hardcoded Qt version number in the About floater. --- indra/llplugin/llpluginclassmedia.cpp | 28 ++++++++++++++ indra/llplugin/llpluginclassmedia.h | 12 ++++++ indra/media_plugins/webkit/media_plugin_webkit.cpp | 1 + indra/newview/llfloaterabout.cpp | 2 +- indra/newview/llmediactrl.cpp | 45 ++++++++++++++-------- indra/newview/llmediactrl.h | 1 - 6 files changed, 72 insertions(+), 17 deletions(-) (limited to 'indra') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index ed8d10a88c..2c9fb35588 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -37,6 +37,8 @@ #include "llpluginclassmedia.h" #include "llpluginmessageclasses.h" +#include "llqtwebkit.h" + static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256; static int nextPowerOf2( int value ) @@ -134,6 +136,9 @@ void LLPluginClassMedia::reset() mHistoryForwardAvailable = false; mStatusText.clear(); mProgressPercent = 0; + mClickURL.clear(); + mClickTarget.clear(); + mClickTargetType = TARGET_NONE; // media_time class mCurrentTime = 0.0f; @@ -669,6 +674,26 @@ void LLPluginClassMedia::paste() sendMessage(message); } +LLPluginClassMedia::ETargetType getTargetTypeFromLLQtWebkit(int target_type) +{ + // convert a LinkTargetType value from llqtwebkit to an ETargetType + // so that we don't expose the llqtwebkit header in viewer code + switch (target_type) + { + case LinkTargetType::LTT_TARGET_NONE: + return LLPluginClassMedia::TARGET_NONE; + + case LinkTargetType::LTT_TARGET_BLANK: + return LLPluginClassMedia::TARGET_BLANK; + + case LinkTargetType::LTT_TARGET_EXTERNAL: + return LLPluginClassMedia::TARGET_EXTERNAL; + + default: + return LLPluginClassMedia::TARGET_OTHER; + } +} + /* virtual */ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { @@ -921,12 +946,15 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { mClickURL = message.getValue("uri"); mClickTarget = message.getValue("target"); + U32 target_type = message.getValueU32("target_type"); + mClickTargetType = ::getTargetTypeFromLLQtWebkit(target_type); mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF); } else if(message_name == "click_nofollow") { mClickURL = message.getValue("uri"); mClickTarget.clear(); + mClickTargetType = TARGET_NONE; mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW); } else diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 5a1928ab1d..ebb9099576 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -214,6 +214,17 @@ public: // This is valid after MEDIA_EVENT_CLICK_LINK_HREF std::string getClickTarget() const { return mClickTarget; }; + typedef enum + { + TARGET_NONE, // empty href target string + TARGET_BLANK, // target to open link in user's preferred browser + TARGET_EXTERNAL, // target to open link in external browser + TARGET_OTHER // nonempty and unsupported target type + }ETargetType; + + // This is valid after MEDIA_EVENT_CLICK_LINK_HREF + ETargetType getClickTargetType() const { return mClickTargetType; }; + std::string getMediaName() const { return mMediaName; }; std::string getMediaDescription() const { return mMediaDescription; }; @@ -344,6 +355,7 @@ protected: std::string mLocation; std::string mClickURL; std::string mClickTarget; + ETargetType mClickTargetType; ///////////////////////////////////////// // media_time class diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index a0336f6156..084cdd9561 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -429,6 +429,7 @@ private: LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href"); message.setValue("uri", event.getStringValue()); message.setValue("target", event.getStringValue2()); + message.setValueU32("target_type", event.getLinkType()); sendMessage(message); } diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index aa343b2f69..ef69f39ad2 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -269,7 +269,7 @@ LLSD LLFloaterAbout::getInfo() info["VIVOX_VERSION"] = gVoiceClient ? gVoiceClient->getAPIVersion() : LLTrans::getString("NotConnected"); // TODO: Implement media plugin version query - info["QT_WEBKIT_VERSION"] = "4.5.2 (version number hard-coded)"; + info["QT_WEBKIT_VERSION"] = "4.6 (version number hard-coded)"; if (gPacketsIn > 0) { diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 6b0f9b709d..87ebce1d34 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -84,7 +84,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mHomePageUrl( "" ), mIgnoreUIScale( true ), mAlwaysRefresh( false ), - mExternalUrl( "" ), mMediaSource( 0 ), mTakeFocusOnClick( true ), mCurrentNavUrl( "" ), @@ -877,9 +876,27 @@ bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( 0 == option ) { - // open in external browser because we don't support - // creation of our own secondary browser windows - LLWeb::loadURLExternal( notification["payload"]["external_url"].asString() ); + LLSD payload = notification["payload"]; + std::string url = payload["url"].asString(); + S32 target_type = payload["target_type"].asInteger(); + + switch (target_type) + { + case LLPluginClassMedia::TARGET_EXTERNAL: + // load target in an external browser + LLWeb::loadURLExternal(url); + break; + + case LLPluginClassMedia::TARGET_BLANK: + // load target in the user's preferred browser + LLWeb::loadURL(url); + break; + + default: + // unsupported link target - shouldn't happen + LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL; + break; + } } return false; } @@ -993,20 +1010,18 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self ) { // retrieve the event parameters - std::string target = self->getClickTarget(); std::string url = self->getClickURL(); + U32 target_type = self->getClickTargetType(); - // if there is a value for the target - if ( !target.empty() ) + // is there is a target specified for the link? + if (target_type == LLPluginClassMedia::TARGET_EXTERNAL || + target_type == LLPluginClassMedia::TARGET_BLANK) { - if ( target == "_external" ) - { - mExternalUrl = url; - LLSD payload; - payload["external_url"] = mExternalUrl; - LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); - return; - } + LLSD payload; + payload["url"] = url; + payload["target_type"] = LLSD::Integer(target_type); + LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget); + return; } const std::string protocol1( "http://" ); diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 8f9e6e7179..b0aca3cfa4 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -182,7 +182,6 @@ public: bool mOpenLinksInInternalBrowser; bool mTrusted; std::string mHomePageUrl; - std::string mExternalUrl; std::string mCurrentNavUrl; bool mIgnoreUIScale; bool mAlwaysRefresh; -- cgit v1.2.3 From a9f532b2ea07b31e01f258615c0c57c58449626a Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 14 Jan 2010 13:57:16 +0200 Subject: fixed major bug EXT-4194 Escape key does not reset the camera FOV --HG-- branch : product-engine --- indra/newview/llagent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 35b28d8ec0..5ea253709c 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -514,6 +514,8 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera) } setFocusOnAvatar(TRUE, ANIMATE); + + mCameraFOVZoomFactor = 0.f; } mHUDTargetZoom = 1.f; @@ -3584,7 +3586,7 @@ F32 LLAgent::calcCameraFOVZoomFactor() { return 0.f; } - else if (mFocusObject.notNull() && !mFocusObject->isAvatar()) + else if (mFocusObject.notNull() && !mFocusObject->isAvatar() && !mFocusOnAvatar) { // don't FOV zoom on mostly transparent objects LLVector3 focus_offset = mFocusObjectOffset; -- cgit v1.2.3 From e1105245371e7c34c1be7a772906d3c2f6ca258d Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 14 Jan 2010 14:30:40 +0000 Subject: EXT-4233: Don't show help button on tear-off floaters. The script error floater may be the only floater left that uses the old-style tearoff functionality, but at least it should behave a little better now in terms of help "?" buttons. --- indra/llui/llfloater.cpp | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a35d279500..a17e306325 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1067,10 +1067,6 @@ void LLFloater::setMinimized(BOOL minimize) reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE ); } - // don't show the help button while minimized - it's - // not very useful when minimized and uses up space - mButtonsEnabled[BUTTON_HELP] = !minimize; - applyTitle (); make_ui_sound("UISndWindowClose"); @@ -1743,14 +1739,32 @@ void LLFloater::updateButtons() S32 button_count = 0; for (S32 i = 0; i < BUTTON_COUNT; i++) { - if(!mButtons[i]) continue; - mButtons[i]->setEnabled(mButtonsEnabled[i]); + if (!mButtons[i]) + { + continue; + } - if (mButtonsEnabled[i] - //*HACK: always render close button for hosted floaters - // so that users don't accidentally hit the button when closing multiple windows - // in the chatterbox - || (i == BUTTON_CLOSE && mButtonScale != 1.f)) + bool enabled = mButtonsEnabled[i]; + if (i == BUTTON_HELP) + { + // don't show the help button if the floater is minimized + // or if it is a tear-off hosted floater + if (isMinimized() || mButtonsEnabled[BUTTON_TEAR_OFF]) + { + enabled = false; + } + } + if (i == BUTTON_CLOSE && mButtonScale != 1.f) + { + //*HACK: always render close button for hosted floaters so + //that users don't accidentally hit the button when + //closing multiple windows in the chatterbox + enabled = true; + } + + mButtons[i]->setEnabled(enabled); + + if (enabled) { button_count++; @@ -1777,7 +1791,7 @@ void LLFloater::updateButtons() // the restore button should have a tab stop so that it takes action when you Ctrl-Tab to a minimized floater mButtons[i]->setTabStop(i == BUTTON_RESTORE); } - else if (mButtons[i]) + else { mButtons[i]->setVisible(FALSE); } -- cgit v1.2.3 From a656e7bbfd8c3ca2244b54188e34028d4036ca4e Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 14 Jan 2010 16:38:44 +0200 Subject: fixed EXT-3886 Group Profile button does not always show group info --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index b547997e7a..0cfe501fab 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -302,7 +302,7 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) { LLPanelChatControlPanel::setSessionId(session_id); - mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); + mGroupID = session_id; // for group and Ad-hoc chat we need to include agent into list if(!mParticipantList) -- cgit v1.2.3 From 86769b40aac266701b56daa6c78b924aad4d3ca9 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 14 Jan 2010 16:48:06 +0200 Subject: Work on major bug EXT-3976 (Voice chat speaking indicators should only display when users are in the same voice channel) -- implemented functionality to have voice indicator visible only for avatars in the same voice channel with agent All speacking indicators should be registered in LLSpeakingIndicatorManager to be provcessed for the voice channel. They should implement switchIndicator(bool) as reaction on voice state changing --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 2 + indra/newview/llavatarlistitem.cpp | 15 +- indra/newview/llavatarlistitem.h | 5 + indra/newview/lloutputmonitorctrl.cpp | 74 ++++++- indra/newview/lloutputmonitorctrl.h | 29 ++- indra/newview/llspeakingindicatormanager.cpp | 289 +++++++++++++++++++++++++++ indra/newview/llspeakingindicatormanager.h | 67 +++++++ 7 files changed, 477 insertions(+), 4 deletions(-) create mode 100644 indra/newview/llspeakingindicatormanager.cpp create mode 100644 indra/newview/llspeakingindicatormanager.h (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f56be4004a..69927e5e0e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -386,6 +386,7 @@ set(viewer_SOURCE_FILES llspatialpartition.cpp llspeakbutton.cpp llspeakers.cpp + llspeakingindicatormanager.cpp llsplitbutton.cpp llsprite.cpp llstartup.cpp @@ -890,6 +891,7 @@ set(viewer_HEADER_FILES llspatialpartition.h llspeakbutton.h llspeakers.h + llspeakingindicatormanager.h llsplitbutton.h llsprite.h llstartup.h diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index a2e17db3d8..0a0ad81165 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -127,6 +127,15 @@ BOOL LLAvatarListItem::postBuild() return TRUE; } +S32 LLAvatarListItem::notifyParent(const LLSD& info) +{ + if (info.has("visibility_changed")) + { + updateChildren(); + } + return 0; +} + void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) { childSetVisible("hovered_icon", true); @@ -246,8 +255,10 @@ void LLAvatarListItem::showSpeakingIndicator(bool visible) // Already done? Then do nothing. if (mSpeakingIndicator->getVisible() == (BOOL)visible) return; - mSpeakingIndicator->setVisible(visible); - updateChildren(); +// Disabled to not contradict with SpeakingIndicatorManager functionality. EXT-3976 +// probably this method should be totally removed. +// mSpeakingIndicator->setVisible(visible); +// updateChildren(); } void LLAvatarListItem::setAvatarIconVisible(bool visible) diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 868ee546d4..f76ffb391d 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -74,6 +74,11 @@ public: virtual ~LLAvatarListItem(); virtual BOOL postBuild(); + + /** + * Processes notification from speaker indicator to update children when indicator's visibility is changed. + */ + virtual S32 notifyParent(const LLSD& info); virtual void onMouseLeave(S32 x, S32 y, MASK mask); virtual void onMouseEnter(S32 x, S32 y, MASK mask); virtual void setValue(const LLSD& value); diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 63803469dd..89b0105ae9 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -77,7 +77,9 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mImageLevel3(p.image_level_3), mAutoUpdate(p.auto_update), mSpeakerId(p.speaker_id), - mIsAgentControl(false) + mIsAgentControl(false), + mIsSwitchDirty(false), + mShouldSwitchOn(false) { //static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); //static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red); @@ -108,6 +110,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) LLOutputMonitorCtrl::~LLOutputMonitorCtrl() { LLMuteList::getInstance()->removeObserver(this); + LLSpeakingIndicatorManager::unregisterSpeakingIndicator(mSpeakerId, this); } void LLOutputMonitorCtrl::setPower(F32 val) @@ -117,6 +120,26 @@ void LLOutputMonitorCtrl::setPower(F32 val) void LLOutputMonitorCtrl::draw() { + // see also switchIndicator() + if (mIsSwitchDirty) + { + mIsSwitchDirty = false; + if (mShouldSwitchOn) + { + // just notify parent visibility may have changed + notifyParentVisibilityChanged(); + } + else + { + // make itself invisible and notify parent about this + setVisible(FALSE); + notifyParentVisibilityChanged(); + + // no needs to render for invisible element + return; + } + } + // Copied from llmediaremotectrl.cpp // *TODO: Give the LLOutputMonitorCtrl an agent-id to monitor, then // call directly into gVoiceClient to ask if that agent-id is muted, is @@ -229,6 +252,7 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id) if (speaker_id.isNull() || speaker_id == mSpeakerId) return; mSpeakerId = speaker_id; + LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this); //mute management if (mAutoUpdate) @@ -251,3 +275,51 @@ void LLOutputMonitorCtrl::onChange() // check only blocking on voice. EXT-3542 setIsMuted(LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat)); } + +// virtual +void LLOutputMonitorCtrl::switchIndicator(bool switch_on) +{ + if (switch_on) + { + setVisible((BOOL)switch_on); + if (isInVisibleChain()) + { + notifyParentVisibilityChanged(); + } + else + { + LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL; + mIsSwitchDirty = true; + mShouldSwitchOn = true; + } + } + else + { + if (isInVisibleChain()) + { + LL_DEBUGS("SpeakingIndicator") << "Indicator is in visible chain, notifying parent: " << mSpeakerId << LL_ENDL; + setVisible((BOOL)switch_on); + notifyParentVisibilityChanged(); + } + else + { + LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL; + mIsSwitchDirty = true; + mShouldSwitchOn = false; + } + } +} + +////////////////////////////////////////////////////////////////////////// +// PRIVATE SECTION +////////////////////////////////////////////////////////////////////////// +void LLOutputMonitorCtrl::notifyParentVisibilityChanged() +{ + LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << " ,new_visibility: " << getVisible() << LL_ENDL; + + LLSD params = LLSD().with("visibility_changed", getVisible()); + + notifyParent(params); +} + +// EOF diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h index 85ea552a57..2bbfa251e9 100644 --- a/indra/newview/lloutputmonitorctrl.h +++ b/indra/newview/lloutputmonitorctrl.h @@ -36,6 +36,7 @@ #include "v4color.h" #include "llview.h" #include "llmutelist.h" +#include "llspeakingindicatormanager.h" class LLTextBox; class LLUICtrlFactory; @@ -45,7 +46,7 @@ class LLUICtrlFactory; // class LLOutputMonitorCtrl -: public LLView, LLMuteListObserver +: public LLView, public LLSpeakingIndicator, LLMuteListObserver { public: struct Params : public LLInitParam::Block @@ -90,7 +91,29 @@ public: //called by mute list virtual void onChange(); + /** + * Implementation of LLSpeakingIndicator interface. + * Behavior is implemented via changing visibility. + * + * If instance is in visible chain now (all parents are visible) it changes visibility + * and notify parent about this. + * + * Otherwise it marks an instance as dirty and stores necessary visibility. + * It will be applied in next draw and parent will be notified. + */ + virtual void switchIndicator(bool switch_on); + private: + + /** + * Notifies parent about changed visibility. + * + * Passes LLSD with "visibility_changed" => value. + * For now it is processed by LLAvatarListItem to update (reshape) its children. + * Implemented fo complete EXT-3976 + */ + void notifyParentVisibilityChanged(); + //static LLColor4 sColorMuted; //static LLColor4 sColorNormal; //static LLColor4 sColorOverdriven; @@ -117,6 +140,10 @@ private: /** uuid of a speaker being monitored */ LLUUID mSpeakerId; + + /** indicates if the instance is dirty and should notify parent */ + bool mIsSwitchDirty; + bool mShouldSwitchOn; }; #endif diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp new file mode 100644 index 0000000000..1c8fc6ac9d --- /dev/null +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -0,0 +1,289 @@ +/** + * @file llspeakingindicatormanager.cpp + * @author Mike Antipov + * @brief Implementation of SpeackerIndicatorManager class to process registered LLSpeackerIndicator + * depend on avatars are in the same voice channel. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llspeakingindicatormanager.h" + + +#include "llagentdata.h" +#include "llvoicechannel.h" +#include "llvoiceclient.h" + +/** + * This class intended to control visibility of avatar speaking indicators depend on whether avatars + * are in the same voice channel. + * + * Speaking indicator should be visible for avatars in the same voice channel. See EXT-3976. + * + * It stores passed instances of LLOutputMonitorCtrl in a multimap by avatar LLUUID. + * It observes changing of voice channel and changing of participant list in voice channel. + * When voice channel or voice participant list is changed it updates visibility of an appropriate + * speaking indicator. + * + * Several indicators can be registered for the same avatar. + */ +class SpeakingIndicatorManager : public LLSingleton, LLVoiceClientParticipantObserver +{ + LOG_CLASS(SpeakingIndicatorManager); +public: + + /** + * Stores passed speaking indicator to control its visibility. + * + * Registered indicator is set visible if an appropriate avatar is in the same voice channel with Agent. + * It ignores instances of Agent's indicator. + * + * @param speaker_id LLUUID of an avatar whose speaking indicator is registered. + * @param speaking_indicator instance of the speaking indicator to be registered. + */ + void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator); + + /** + * Removes passed speaking indicator from observing. + * + * @param speaker_id LLUUID of an avatar whose speaking indicator should be unregistered. + * @param speaking_indicator instance of the speaking indicator to be unregistered. + */ + void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator); + +private: + typedef std::vector speaker_ids_t; + typedef std::multimap speaking_indicators_mmap_t; + typedef speaking_indicators_mmap_t::value_type speaking_indicator_value_t; + typedef speaking_indicators_mmap_t::const_iterator indicator_const_iterator; + typedef std::pair indicator_range_t; + + friend class LLSingleton; + SpeakingIndicatorManager(); + ~SpeakingIndicatorManager(); + + /** + * Callback to determine when voice channel is changed. + * + * It switches all registered speaking indicators off. + * To reduce overheads only switched on indicators are processed. + */ + void sOnCurrentChannelChanged(const LLUUID& session_id); + + /** + * Callback of changing voice participant list (from LLVoiceClientParticipantObserver). + * + * Switches off indicators had been switched on and switches on indicators of current participants list. + * There is only a few indicators in lists should be switched off/on. + * So, method does not calculate difference between these list it only switches off already + * switched on indicators and switches on indicators of voice channel participants + */ + void onChange(); + + /** + * Changes state of indicators specified by LLUUIDs + * + * @param speakers_uuids - avatars' LLUUIDs whose speaking indicators should be switched + * @param switch_on - if TRUE specified indicator will be switched on, off otherwise. + */ + void switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on); + + /** + * Multimap with all registered speaking indicators + */ + speaking_indicators_mmap_t mSpeakingIndicators; + + /** + * LUUIDs of avatar for which we have speaking indicators switched on. + * + * Is used to switch off all previously ON indicators when voice participant list is changed. + * + * @see onChange() + */ + speaker_ids_t mSwitchedIndicatorsOn; +}; + +////////////////////////////////////////////////////////////////////////// +// PUBLIC SECTION +////////////////////////////////////////////////////////////////////////// +void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator) +{ + if (speaker_id == gAgentID) return; + + LL_DEBUGS("SpeakingIndicator") << "Registering indicator: " << speaker_id << LL_ENDL; + speaking_indicator_value_t value_type(speaker_id, speaking_indicator); + mSpeakingIndicators.insert(value_type); + + BOOL is_in_same_voice = FALSE; + + // search passed speaker id among a list of voice participants + LLVoiceClient::participantMap *voice_map = LLVoiceClient::getInstance()->getParticipantList(); + if (voice_map) + { + for (LLVoiceClient::participantMap::const_iterator iter = voice_map->begin(); + iter != voice_map->end(); ++iter) + { + const LLUUID id = (*iter).second->mAvatarID; + + if (speaker_id == id) + { + is_in_same_voice = TRUE; + break; + } + + } + } + + speaker_ids_t speakers_uuids; + speakers_uuids.push_back(speaker_id); + switchSpeakerIndicators(speakers_uuids, is_in_same_voice); +} + +void SpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator) +{ + speaking_indicators_mmap_t::iterator it; + it = mSpeakingIndicators.find(speaker_id); + for (;it != mSpeakingIndicators.end(); ++it) + { + if (it->second == speaking_indicator) + { + mSpeakingIndicators.erase(it); + break; + } + } +} + +////////////////////////////////////////////////////////////////////////// +// PRIVATE SECTION +////////////////////////////////////////////////////////////////////////// +SpeakingIndicatorManager::SpeakingIndicatorManager() +{ + LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&SpeakingIndicatorManager::sOnCurrentChannelChanged, this, _1)); + LLVoiceClient::getInstance()->addObserver(this); +} + +SpeakingIndicatorManager::~SpeakingIndicatorManager() +{ + // Don't use LLVoiceClient::getInstance() here without check + // singleton MAY have already been destroyed. + if(LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->removeObserver(this); + } +} + +void SpeakingIndicatorManager::sOnCurrentChannelChanged(const LLUUID& /*session_id*/) +{ + switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE); + mSwitchedIndicatorsOn.clear(); +} + +void SpeakingIndicatorManager::onChange() +{ + LL_DEBUGS("SpeakingIndicator") << "Voice participant list was changed, updating indicators" << LL_ENDL; + + speaker_ids_t speakers_uuids; + // Get a list of participants from VoiceClient + LLVoiceClient::participantMap *voice_map = gVoiceClient->getParticipantList(); + if (voice_map) + { + for (LLVoiceClient::participantMap::const_iterator iter = voice_map->begin(); + iter != voice_map->end(); ++iter) + { + LLUUID id = (*iter).second->mAvatarID; + + if (id == gAgentID) continue; + + speakers_uuids.push_back(id); + } + } + + LL_DEBUGS("SpeakingIndicator") << "Switching all OFF, count: " << mSwitchedIndicatorsOn.size() << LL_ENDL; + + // switch all indicators off + switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE); + mSwitchedIndicatorsOn.clear(); + + LL_DEBUGS("SpeakingIndicator") << "Switching all ON, count: " << speakers_uuids.size() << LL_ENDL; + // then switch current voice participants indicators on + switchSpeakerIndicators(speakers_uuids, TRUE); +} + +void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on) +{ + speaker_ids_t::const_iterator it_uuid = speakers_uuids.begin(); + for (; it_uuid != speakers_uuids.end(); ++it_uuid) + { + LL_DEBUGS("SpeakingIndicator") << "Looking for indicator: " << *it_uuid << LL_ENDL; + indicator_range_t it_range = mSpeakingIndicators.equal_range(*it_uuid); + indicator_const_iterator it_indicator = it_range.first; + bool was_found = false; + for (; it_indicator != it_range.second; ++it_indicator) + { + was_found = true; + LLSpeakingIndicator* indicator = (*it_indicator).second; + indicator->switchIndicator(switch_on); + } + + if (was_found) + { + LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators where found" << LL_ENDL; + + if (switch_on) + { + // TODO: probably std::set will be better + // if (mSwitchedIndicatorsOn.find(*it_uuid) == mSwitchedIndicatorsOn.end()) + { + mSwitchedIndicatorsOn.push_back(*it_uuid); + } + } + } + else + { + LL_WARNS("SpeakingIndicator") << "indicator was not found among registered: " << *it_uuid << LL_ENDL; + } + } +} + +/************************************************************************/ +/* LLSpeakingIndicatorManager namespace implementation */ +/************************************************************************/ + +void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator) +{ + SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator); +} + +void LLSpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator) +{ + SpeakingIndicatorManager::instance().unregisterSpeakingIndicator(speaker_id, speaking_indicator); +} + +// EOF + diff --git a/indra/newview/llspeakingindicatormanager.h b/indra/newview/llspeakingindicatormanager.h new file mode 100644 index 0000000000..f32c70bd73 --- /dev/null +++ b/indra/newview/llspeakingindicatormanager.h @@ -0,0 +1,67 @@ +/** + * @file llspeakingindicatormanager.h + * @author Mike Antipov + * @brief Interfeace of LLSpeackerIndicator class to be processed depend on avatars are in the same voice channel. + * Also register/unregister methods for this class are declared + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSPEAKINGINDICATORMANAGER_H +#define LL_LLSPEAKINGINDICATORMANAGER_H + +class LLSpeakingIndicator +{ +public: + virtual void switchIndicator(bool switch_on) = 0; +}; + +// See EXT-3976. +namespace LLSpeakingIndicatorManager +{ + /** + * Stores passed speaking indicator to control its visibility. + * + * Registered indicator is set visible if an appropriate avatar is in the same voice channel with Agent. + * It ignores instances of Agent's indicator. + * + * @param speaker_id LLUUID of an avatar whose speaker indicator is registered. + * @param speaking_indicator instance of the speaker indicator to be registered. + */ + void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator); + + /** + * Removes passed speaking indicator from observing. + * + * @param speaker_id LLUUID of an avatar whose speaker indicator should be unregistered. + * @param speaking_indicator instance of the speaker indicator to be unregistered. + */ + void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator); +} + +#endif // LL_LLSPEAKINGINDICATORMANAGER_H -- cgit v1.2.3 From f606a5b300a5f4a84523761df4ba6f5198c06c10 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 14 Jan 2010 17:14:43 +0200 Subject: Work on major bug EXT-3976 (Voice chat speaking indicators should only display when users are in the same voice channel) -- fixed bug: "Indicator does not appear if two indicators are visible for the same avatar on second switching to the same voice channel" --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 1 + indra/newview/lloutputmonitorctrl.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 69927e5e0e..b452ad7421 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1760,6 +1760,7 @@ if (INSTALL) endif (INSTALL) if (LL_TESTS) +else (LL_TESTS) # To add a viewer unit test, just add the test .cpp file below # This creates a separate test project per file listed. include(LLAddBuildTest) diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 89b0105ae9..80477c1041 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -282,7 +282,7 @@ void LLOutputMonitorCtrl::switchIndicator(bool switch_on) if (switch_on) { setVisible((BOOL)switch_on); - if (isInVisibleChain()) + if (getParent() && getParent()->isInVisibleChain()) { notifyParentVisibilityChanged(); } @@ -295,7 +295,7 @@ void LLOutputMonitorCtrl::switchIndicator(bool switch_on) } else { - if (isInVisibleChain()) + if (getParent() && getParent()->isInVisibleChain()) { LL_DEBUGS("SpeakingIndicator") << "Indicator is in visible chain, notifying parent: " << mSpeakerId << LL_ENDL; setVisible((BOOL)switch_on); -- cgit v1.2.3 From b91a3967a44cbae619775922a57e100db7235385 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 14 Jan 2010 17:19:29 +0200 Subject: Fixed major bug EXT-4177: [BSI] Notification about inventory offer lacks article (a/an). Changed the text to " has given you this ". --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/notifications.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index e01536f256..e20e5a85c0 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4985,7 +4985,7 @@ No valid parcel could be found. icon="notify.tga" name="ObjectGiveItem" type="offer"> -An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you [OBJECTTYPE]: +An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you this [OBJECTTYPE]: [ITEM_SLURL]