From 11a9fe3e7c10fddee6bcf4294e852f6ae389e3d6 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 24 Nov 2009 22:38:32 +0200 Subject: Fixed critical EXT-2469 "Viewer crashes in the Floater Call". - Replaced a boost::function in VoiceChannel by a boost::signal connection for calling VoiceChannel state change callback. --HG-- branch : product-engine --- indra/newview/llvoicechannel.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 639585de55..a3495b9588 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -52,7 +52,7 @@ public: STATE_CONNECTED } EState; - typedef boost::function state_changed_callback_t; + typedef boost::signals2::signal state_changed_signal_t; // on current channel changed signal typedef boost::function channel_changed_callback_t; @@ -78,7 +78,8 @@ public: virtual BOOL callStarted(); const std::string& getSessionName() const { return mSessionName; } - void setStateChangedCallback(state_changed_callback_t callback) { mStateChangedCallback = callback; } + boost::signals2::connection setStateChangedCallback(const state_changed_signal_t::slot_type& callback) + { return mStateChangedCallback.connect(callback); } const LLUUID getSessionID() { return mSessionID; } EState getState() { return mState; } @@ -124,7 +125,7 @@ protected: static BOOL sSuspended; private: - state_changed_callback_t mStateChangedCallback; + state_changed_signal_t mStateChangedCallback; }; class LLVoiceChannelGroup : public LLVoiceChannel -- cgit v1.2.3 From a7d2130464fa5e73ba7faf8b697b98443e80257a Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 24 Nov 2009 22:59:00 +0200 Subject: Fixed major bug EXT-2701 (Recent People > last_interaction value is not internationalized). Made the avatar last interaction time localizeable. This also fixes task EXT-1096 (Implement Recent time in Recent People list for Avatar items). --HG-- branch : product-engine --- indra/newview/llavatarlist.cpp | 33 +------------- indra/newview/llavatarlistitem.cpp | 52 +++++++++++++++++++++- indra/newview/llavatarlistitem.h | 4 +- .../default/xui/en/panel_avatar_list_item.xml | 12 +++++ 4 files changed, 66 insertions(+), 35 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index bb03f47f46..7f3f869e5d 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -363,37 +363,6 @@ void LLAvatarList::computeDifference( vadded.erase(it, vadded.end()); } -static std::string format_secs(S32 secs) -{ - // *TODO: reinventing the wheel? - // *TODO: i18n - static const int LL_AL_MIN = 60; - static const int LL_AL_HOUR = LL_AL_MIN * 60; - static const int LL_AL_DAY = LL_AL_HOUR * 24; - static const int LL_AL_WEEK = LL_AL_DAY * 7; - static const int LL_AL_MONTH = LL_AL_DAY * 31; - static const int LL_AL_YEAR = LL_AL_DAY * 365; - - std::string s; - - if (secs >= LL_AL_YEAR) - s = llformat("%dy", secs / LL_AL_YEAR); - else if (secs >= LL_AL_MONTH) - s = llformat("%dmon", secs / LL_AL_MONTH); - else if (secs >= LL_AL_WEEK) - s = llformat("%dw", secs / LL_AL_WEEK); - else if (secs >= LL_AL_DAY) - s = llformat("%dd", secs / LL_AL_DAY); - else if (secs >= LL_AL_HOUR) - s = llformat("%dh", secs / LL_AL_HOUR); - else if (secs >= LL_AL_MIN) - s = llformat("%dm", secs / LL_AL_MIN); - else - s = llformat("%ds", secs); - - return s; -} - // Refresh shown time of our last interaction with all listed avatars. void LLAvatarList::updateLastInteractionTimes() { @@ -407,7 +376,7 @@ void LLAvatarList::updateLastInteractionTimes() LLAvatarListItem* item = static_cast(*it); S32 secs_since = now - (S32) LLRecentPeople::instance().getDate(item->getAvatarId()).secondsSinceEpoch(); if (secs_since >= 0) - item->setLastInteractionTime(format_secs(secs_since)); + item->setLastInteractionTime(secs_since); } } diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index c670a65bcc..efc9538fa6 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -198,9 +198,9 @@ void LLAvatarListItem::showLastInteractionTime(bool show) mAvatarName->setRect(name_rect); } -void LLAvatarListItem::setLastInteractionTime(const std::string& val) +void LLAvatarListItem::setLastInteractionTime(U32 secs_since) { - mLastInteractionTime->setValue(val); + mLastInteractionTime->setValue(formatSeconds(secs_since)); } void LLAvatarListItem::setShowInfoBtn(bool show) @@ -326,3 +326,51 @@ void LLAvatarListItem::reshapeAvatarName() mAvatarName->reshape(width, height); } + +// Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years", +// taking i18n into account. The format string to use is taken from the panel XML. +std::string LLAvatarListItem::formatSeconds(U32 secs) +{ + static const U32 LL_ALI_MIN = 60; + static const U32 LL_ALI_HOUR = LL_ALI_MIN * 60; + static const U32 LL_ALI_DAY = LL_ALI_HOUR * 24; + static const U32 LL_ALI_WEEK = LL_ALI_DAY * 7; + static const U32 LL_ALI_MONTH = LL_ALI_DAY * 30; + static const U32 LL_ALI_YEAR = LL_ALI_DAY * 365; + + std::string fmt; + U32 count = 0; + + if (secs >= LL_ALI_YEAR) + { + fmt = "FormatYears"; count = secs / LL_ALI_YEAR; + } + else if (secs >= LL_ALI_MONTH) + { + fmt = "FormatMonths"; count = secs / LL_ALI_MONTH; + } + else if (secs >= LL_ALI_WEEK) + { + fmt = "FormatWeeks"; count = secs / LL_ALI_WEEK; + } + else if (secs >= LL_ALI_DAY) + { + fmt = "FormatDays"; count = secs / LL_ALI_DAY; + } + else if (secs >= LL_ALI_HOUR) + { + fmt = "FormatHours"; count = secs / LL_ALI_HOUR; + } + else if (secs >= LL_ALI_MIN) + { + fmt = "FormatMinutes"; count = secs / LL_ALI_MIN; + } + else + { + fmt = "FormatSeconds"; count = secs; + } + + LLStringUtil::format_map_t args; + args["[COUNT]"] = llformat("%u", count); + return getString(fmt, args); +} diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 9d48101a44..341f5a6bcf 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -63,7 +63,7 @@ public: void setOnline(bool online); void setName(const std::string& name); void setAvatarId(const LLUUID& id, bool ignore_status_changes = false); - void setLastInteractionTime(const std::string& val); + void setLastInteractionTime(U32 secs_since); //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly void setShowProfileBtn(bool show); void setShowInfoBtn(bool show); @@ -94,6 +94,8 @@ private: void onNameCache(const std::string& first_name, const std::string& last_name); + std::string formatSeconds(U32 secs); + LLAvatarIconCtrl* mAvatarIcon; LLTextBox* mAvatarName; LLTextBox* mLastInteractionTime; diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index 2eaa3a94ee..45f9d9c7b6 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -7,6 +7,18 @@ name="avatar_list_item" top="0" width="320"> + + [COUNT]s + [COUNT]m + [COUNT]h + [COUNT]d + [COUNT]w + [COUNT]mon + [COUNT]y + Date: Wed, 25 Nov 2009 12:19:24 +0200 Subject: Fix for normal bug EXT-2564 - collapsed All friends list reopens if online friends list changes. --HG-- branch : product-engine --- indra/newview/llpanelpeople.cpp | 62 +++++++++++++++++++++++++++++++++++++---- indra/newview/llpanelpeople.h | 7 ++++- 2 files changed, 63 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 29f7cc1851..c0a4dabc28 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -71,6 +71,8 @@ static const std::string FRIENDS_TAB_NAME = "friends_panel"; static const std::string GROUP_TAB_NAME = "groups_panel"; static const std::string RECENT_TAB_NAME = "recent_panel"; +static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; + /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator { @@ -465,7 +467,7 @@ LLPanelPeople::~LLPanelPeople() } -void LLPanelPeople::onFriendsAccordionExpandedCollapsed(const LLSD& param, LLAvatarList* avatar_list) +void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list) { if(!avatar_list) { @@ -478,6 +480,12 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(const LLSD& param, LLAva if(!expanded) { avatar_list->resetSelection(); + + setAccordionCollapsedByUser(ctrl, true); + } + else + { + setAccordionCollapsedByUser(ctrl, false); } } @@ -548,11 +556,11 @@ BOOL LLPanelPeople::postBuild() LLAccordionCtrlTab* accordion_tab = getChild("tab_all"); accordion_tab->setDropDownStateChangedCallback( - boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _2, mAllFriendList)); + boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _1, _2, mAllFriendList)); accordion_tab = getChild("tab_online"); accordion_tab->setDropDownStateChangedCallback( - boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _2, mOnlineFriendList)); + boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _1, _2, mOnlineFriendList)); buttonSetAction("view_profile_btn", boost::bind(&LLPanelPeople::onViewProfileButtonClicked, this)); buttonSetAction("group_info_btn", boost::bind(&LLPanelPeople::onGroupInfoButtonClicked, this)); @@ -929,6 +937,9 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) mRecentList->setNameFilter(mFilterSubString); mGroupList->setNameFilter(mFilterSubString); + setAccordionCollapsedByUser("tab_online", false); + setAccordionCollapsedByUser("tab_all", false); + showFriendsAccordionsIfNeeded(); } @@ -1282,8 +1293,12 @@ void LLPanelPeople::showAccordion(const std::string name, bool show) tab->setVisible(show); if(show) { - // expand accordion - tab->changeOpenClose(false); + // don't expand accordion if it was collapsed by user + if(!isAccordionCollapsedByUser(tab)) + { + // expand accordion + tab->changeOpenClose(false); + } } } @@ -1315,3 +1330,40 @@ void LLPanelPeople::onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param LLAccordionCtrl* accordion = getChild("friends_accordion"); accordion->arrange(); } + +void LLPanelPeople::setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed) +{ + if(!acc_tab) + { + llwarns << "Invalid parameter" << llendl; + return; + } + + LLSD param = acc_tab->getValue(); + param[COLLAPSED_BY_USER] = collapsed; + acc_tab->setValue(param); +} + +void LLPanelPeople::setAccordionCollapsedByUser(const std::string& name, bool collapsed) +{ + setAccordionCollapsedByUser(getChild(name), collapsed); +} + +bool LLPanelPeople::isAccordionCollapsedByUser(LLUICtrl* acc_tab) +{ + if(!acc_tab) + { + llwarns << "Invalid parameter" << llendl; + return false; + } + + LLSD param = acc_tab->getValue(); + return param[COLLAPSED_BY_USER].asBoolean(); +} + +bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) +{ + return isAccordionCollapsedByUser(getChild(name)); +} + +// EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index a369bcd3e2..9d9c75486c 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -127,7 +127,7 @@ private: const std::vector& ids, void*); - void onFriendsAccordionExpandedCollapsed(const LLSD& param, LLAvatarList* avatar_list); + void onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list); void showAccordion(const std::string name, bool show); @@ -135,6 +135,11 @@ private: void onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param); + void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed); + void setAccordionCollapsedByUser(const std::string& name, bool collapsed); + bool isAccordionCollapsedByUser(LLUICtrl* acc_tab); + bool isAccordionCollapsedByUser(const std::string& name); + LLFilterEditor* mFilterEditor; LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; -- cgit v1.2.3 From 7f7191c1735a2a823943119eec5c1ca160a7bf8d Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 25 Nov 2009 13:04:27 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- Initial implementation of the xml for Voice Control Floater -- Added cpp files for an appropriate class (LLCallFloater) --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 38 +++++++++ indra/newview/llcallfloater.h | 57 +++++++++++++ .../default/xui/en/floater_voice_controls.xml | 95 ++++++++++++++++++++++ 3 files changed, 190 insertions(+) create mode 100644 indra/newview/llcallfloater.cpp create mode 100644 indra/newview/llcallfloater.h create mode 100644 indra/newview/skins/default/xui/en/floater_voice_controls.xml (limited to 'indra/newview') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp new file mode 100644 index 0000000000..82f86bbaed --- /dev/null +++ b/indra/newview/llcallfloater.cpp @@ -0,0 +1,38 @@ +/** + * @file llcallfloater.cpp + * @author Mike Antipov + * @brief Voice Control Panel in a Voice Chats (P2P, Group, Nearby...). + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, 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 "llcallfloater.h" + +//EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h new file mode 100644 index 0000000000..3732379da2 --- /dev/null +++ b/indra/newview/llcallfloater.h @@ -0,0 +1,57 @@ +/** + * @file llcallfloater.h + * @author Mike Antipov + * @brief Voice Control Panel in a Voice Chats (P2P, Group, Nearby...). + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, 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_LLCALLFLOATER_H +#define LL_LLCALLFLOATER_H + +#include "llfloater.h" + +/** + * The Voice Control Panel is an ambient window summoned by clicking the flyout chevron on the Speak button. + * It can be torn-off and freely positioned onscreen. + * + * When the Resident is engaged in Nearby Voice Chat, the Voice Control Panel provides control over + * the Resident's own microphone input volume, the audible volume of each of the other participants, + * the Resident's own Voice Morphing settings (if she has subscribed to enable the feature), and Voice Recording. + * + * When the Resident is engaged in Group Voice Chat, the Voice Control Panel also provides an + * 'End Call' button to allow the Resident to leave that voice channel. + */ +class LLCallFloater : public LLFloater +{ + +}; + + +#endif //LL_LLCALLFLOATER_H + diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml new file mode 100644 index 0000000000..705b4276e3 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From cdd9c57b2c9f02167e78322e5631822b0cd0521b Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 25 Nov 2009 13:44:53 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- Replaced LLVoiceControlPanel with LLCallFloater in Speak button implementation --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 11 ++++++++++ indra/newview/llcallfloater.h | 4 ++++ indra/newview/llspeakbutton.cpp | 48 ++++++++++++++++------------------------- indra/newview/llspeakbutton.h | 4 ++-- 4 files changed, 36 insertions(+), 31 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 82f86bbaed..c6d54995bf 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -35,4 +35,15 @@ #include "llcallfloater.h" + +LLCallFloater::LLCallFloater() +: LLFloater(LLSD()) +{ + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_voice_controls.xml", NULL); +} + +LLCallFloater::~LLCallFloater() +{ + +} //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 3732379da2..dde4085d00 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -49,6 +49,10 @@ */ class LLCallFloater : public LLFloater { +public: + LLCallFloater(); + ~LLCallFloater(); + }; diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index 54f776ca6a..9562d7828c 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -32,19 +32,13 @@ #include "llviewerprecompiledheaders.h" // must be first include +#include "llbutton.h" + #include "llagent.h" #include "llbottomtray.h" -#include "llfloaterreg.h" -#include "llvoiceclient.h" -#include "llvoicecontrolpanel.h" -#include "lltransientfloatermgr.h" - -#include "llavatariconctrl.h" -#include "llbutton.h" -#include "llpanel.h" -#include "lltextbox.h" +#include "llcallfloater.h" #include "lloutputmonitorctrl.h" -#include "llgroupmgr.h" +#include "lltransientfloatermgr.h" #include "llspeakbutton.h" @@ -72,7 +66,6 @@ void LLSpeakButton::draw() LLSpeakButton::LLSpeakButton(const Params& p) : LLUICtrl(p) -, mPrivateCallPanel(NULL) , mOutputMonitor(NULL) , mSpeakBtn(NULL) , mShowBtn(NULL) @@ -179,9 +172,11 @@ void LLSpeakButton::onClick_ShowBtn() { if(!mShowBtn->getToggleState()) { - mPrivateCallPanel->onClickClose(mPrivateCallPanel); - delete mPrivateCallPanel; - mPrivateCallPanel = NULL; + if (!mPrivateCallPanel.isDead()) + { + LLFloater* instance = mPrivateCallPanel.get(); + instance->onClickClose(instance); + } mShowBtn->setToggleState(FALSE); return; } @@ -191,25 +186,20 @@ void LLSpeakButton::onClick_ShowBtn() localPointToScreen(x, y, &x, &y); - mPrivateCallPanel = new LLVoiceControlPanel; - getRootView()->addChild(mPrivateCallPanel); - - y = LLBottomTray::getInstance()->getRect().getHeight() + mPrivateCallPanel->getRect().getHeight(); + LLCallFloater* instance = new LLCallFloater; + mPrivateCallPanel = instance->getHandle(); - LLRect rect; - rect.setLeftTopAndSize(x, y, mPrivateCallPanel->getRect().getWidth(), mPrivateCallPanel->getRect().getHeight()); - mPrivateCallPanel->setRect(rect); + // *TODO: mantipov: why we are adding this floater to Root View? It is in FloaterView by default + getRootView()->addChild(instance); + y = LLBottomTray::getInstance()->getRect().getHeight() + instance->getRect().getHeight(); - LLAvatarListItem* item = new LLAvatarListItem(); - item->showLastInteractionTime(false); - item->showInfoBtn(true); - item->showSpeakingIndicator(true); - item->reshape(mPrivateCallPanel->getRect().getWidth(), item->getRect().getHeight(), FALSE); + LLRect rect; + rect.setLeftTopAndSize(x, y, instance->getRect().getWidth(), instance->getRect().getHeight()); + instance->setRect(rect); - mPrivateCallPanel->addItem(item); - mPrivateCallPanel->setVisible(TRUE); - mPrivateCallPanel->setFrontmost(TRUE); + instance->setVisible(TRUE); + instance->setFrontmost(TRUE); mShowBtn->setToggleState(TRUE); } diff --git a/indra/newview/llspeakbutton.h b/indra/newview/llspeakbutton.h index 424ee5357a..33f7c9fa28 100644 --- a/indra/newview/llspeakbutton.h +++ b/indra/newview/llspeakbutton.h @@ -36,7 +36,7 @@ #include "llinitparam.h" #include "lluictrl.h" -class LLVoiceControlPanel; +class LLCallFloater; class LLButton; class LLOutputMonitorCtrl; @@ -91,7 +91,7 @@ protected: private: LLButton* mSpeakBtn; LLButton* mShowBtn; - LLVoiceControlPanel* mPrivateCallPanel; + LLHandle mPrivateCallPanel; LLOutputMonitorCtrl* mOutputMonitor; }; -- cgit v1.2.3 From c2c83f3535c5a0bc099528580375afc99ad3b020 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Wed, 25 Nov 2009 13:48:13 +0200 Subject: EXT-2555 Change look and feel of nearby chat toasts --HG-- branch : product-engine --- indra/newview/llchatitemscontainerctrl.cpp | 319 +++++++++------------ indra/newview/llchatitemscontainerctrl.h | 17 +- indra/newview/llnearbychathandler.cpp | 25 +- indra/newview/skins/default/colors.xml | 3 + .../skins/default/xui/en/panel_chat_item.xml | 70 +---- 5 files changed, 172 insertions(+), 262 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 8a6935b71b..90956d4aa0 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -44,27 +44,12 @@ #include "llviewercontrol.h" #include "llagentdata.h" -/* -static const S32 BORDER_MARGIN = 2; -static const S32 PARENT_BORDER_MARGIN = 0; - -static const S32 HORIZONTAL_MULTIPLE = 8; -static const S32 VERTICAL_MULTIPLE = 16; -static const F32 MIN_AUTO_SCROLL_RATE = 120.f; -static const F32 MAX_AUTO_SCROLL_RATE = 500.f; -static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f; - -#define MAX_CHAT_HISTORY 100 -*/ - -static const S32 msg_left_offset = 30; +static const S32 msg_left_offset = 10; static const S32 msg_right_offset = 10; -static const S32 msg_height_pad = 2; - -//static LLDefaultChildRegistry::Register t2("chat_items_container"); +static const S32 msg_height_pad = 5; //******************************************************************************************************************* -//LLChatItemCtrl +//LLNearbyChatToastPanel //******************************************************************************************************************* LLNearbyChatToastPanel* LLNearbyChatToastPanel::createInstance() @@ -79,22 +64,22 @@ void LLNearbyChatToastPanel::reshape (S32 width, S32 height, BOOL called_from_p { LLPanel::reshape(width, height,called_from_parent); - // *NOTE: we must check if child items exist because reshape is called from the - // LLView::initFromParams BEFORE postBuild is called and child controls are not exist yet - LLPanel* caption = findChild("msg_caption", false); - LLChatMsgBox* msg_text = findChild("msg_text" ,false); - if(caption && msg_text) - { - LLRect caption_rect = caption->getRect(); - caption_rect.setLeftTopAndSize( 2, height, width - 4, caption_rect.getHeight()); - caption->reshape( width - 4, caption_rect.getHeight(), 1); - caption->setRect(caption_rect); - - LLRect msg_text_rect = msg_text->getRect(); - msg_text_rect.setLeftTopAndSize( msg_left_offset, height - caption_rect.getHeight() , width - msg_left_offset - msg_right_offset, height - caption_rect.getHeight()); - msg_text->reshape( width - msg_left_offset - msg_right_offset, height - caption_rect.getHeight(), 1); - msg_text->setRect(msg_text_rect); - } + LLUICtrl* msg_text = getChild("msg_text", false); + LLUICtrl* icon = getChild("avatar_icon", false); + + LLRect msg_text_rect = msg_text->getRect(); + LLRect avatar_rect = icon->getRect(); + + avatar_rect.setLeftTopAndSize(2,height-2,avatar_rect.getWidth(),avatar_rect.getHeight()); + icon->setRect(avatar_rect); + + + msg_text_rect.setLeftTopAndSize( avatar_rect.mRight + msg_left_offset, + height - msg_height_pad, + width - avatar_rect.mRight - msg_left_offset - msg_right_offset, + height - 2*msg_height_pad); + msg_text->reshape( msg_text_rect.getWidth(), msg_text_rect.getHeight(), 1); + msg_text->setRect(msg_text_rect); } BOOL LLNearbyChatToastPanel::postBuild() @@ -102,37 +87,63 @@ BOOL LLNearbyChatToastPanel::postBuild() return LLPanel::postBuild(); } - -std::string LLNearbyChatToastPanel::appendTime() +void LLNearbyChatToastPanel::addMessage(LLSD& notification) { - time_t utc_time; - utc_time = time_corrected(); - std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"] "; + std::string messageText = notification["message"].asString(); // UTF-8 line of text - LLSD substitution; + LLChatMsgBox* msg_text = getChild("msg_text", false); - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format (timeStr, substitution); + std::string color_name = notification["text_color"].asString(); + + LLColor4 textColor = LLUIColorTable::instance().getColor(color_name); + textColor.mV[VALPHA] =notification["color_alpha"].asReal(); + + S32 font_size = notification["font_size"].asInteger(); - return timeStr; -} + LLFontGL* messageFont; + switch(font_size) + { + case 0: messageFont = LLFontGL::getFontSansSerifSmall(); break; + default: + case 1: messageFont = LLFontGL::getFontSansSerif(); break; + case 2: messageFont = LLFontGL::getFontSansSerifBig(); break; + } + //append text + { + LLStyle::Params style_params; + style_params.color(textColor); + std::string font_name = LLFontGL::nameFromFont(messageFont); + std::string font_style_size = LLFontGL::sizeFromFont(messageFont); + style_params.font.name(font_name); + style_params.font.size(font_style_size); + int chat_type = notification["chat_type"].asInteger(); + + if(notification["chat_style"].asInteger()== CHAT_STYLE_IRC) + { + messageText = messageText.substr(3); + style_params.font.style = "ITALIC"; + } + else if( chat_type == CHAT_TYPE_SHOUT) + { + style_params.font.style = "BOLD"; + } + else if( chat_type == CHAT_TYPE_WHISPER) + { + style_params.font.style = "ITALIC"; + } + msg_text->appendText(messageText, TRUE, style_params); + } + + snapToMessageHeight(); -void LLNearbyChatToastPanel::addText (const std::string& message , const LLStyle::Params& input_params) -{ - LLChatMsgBox* msg_text = getChild("msg_text", false); - msg_text->addText(message , input_params); - mMessages.push_back(message); } void LLNearbyChatToastPanel::init(LLSD& notification) { - LLPanel* caption = getChild("msg_caption", false); - - mText = notification["message"].asString(); // UTF-8 line of text - mFromName = notification["from"].asString(); // agent or object name + std::string messageText = notification["message"].asString(); // UTF-8 line of text + std::string fromName = notification["from"].asString(); // agent or object name mFromID = notification["from_id"].asUUID(); // agent id or object id int sType = notification["source"].asInteger(); @@ -140,192 +151,121 @@ void LLNearbyChatToastPanel::init(LLSD& notification) std::string color_name = notification["text_color"].asString(); - mTextColor = LLUIColorTable::instance().getColor(color_name); - mTextColor.mV[VALPHA] =notification["color_alpha"].asReal(); + LLColor4 textColor = LLUIColorTable::instance().getColor(color_name); + textColor.mV[VALPHA] =notification["color_alpha"].asReal(); S32 font_size = notification["font_size"].asInteger(); + + LLFontGL* messageFont; switch(font_size) { - case 0: - mFont = LLFontGL::getFontSansSerifSmall(); - break; + case 0: messageFont = LLFontGL::getFontSansSerifSmall(); break; default: - case 1: - mFont = LLFontGL::getFontSansSerif(); - break; - case 2: - mFont = LLFontGL::getFontSansSerifBig(); - break; + case 1: messageFont = LLFontGL::getFontSansSerif(); break; + case 2: messageFont = LLFontGL::getFontSansSerifBig(); break; } - LLStyle::Params style_params; - style_params.color(mTextColor); -// style_params.font(mFont); - std::string font_name = LLFontGL::nameFromFont(mFont); - std::string font_style_size = LLFontGL::sizeFromFont(mFont); - style_params.font.name(font_name); - style_params.font.size(font_style_size); + LLChatMsgBox* msg_text = getChild("msg_text", false); + + msg_text->setText(std::string("")); std::string str_sender; if(gAgentID != mFromID) - str_sender = mFromName; + str_sender = fromName; else - str_sender = LLTrans::getString("You");; + str_sender = LLTrans::getString("You"); - caption->getChild("sender_name", false)->setText(str_sender , style_params); - - LLChatMsgBox* msg_text = getChild("msg_text", false); + str_sender+=" "; + //append user name + { + LLStyle::Params style_params_name; + + LLColor4 userNameColor = LLUIColorTable::instance().getColor("ChatToastUserNameColor"); + + style_params_name.color(userNameColor); + + std::string font_name = LLFontGL::nameFromFont(messageFont); + std::string font_style_size = LLFontGL::sizeFromFont(messageFont); + style_params_name.font.name(font_name); + style_params_name.font.size(font_style_size); + + msg_text->appendText(str_sender, FALSE, style_params_name); + + } - if(notification["chat_style"].asInteger()== CHAT_STYLE_IRC) + //append text { - if (mFromName.size() > 0) + LLStyle::Params style_params; + style_params.color(textColor); + std::string font_name = LLFontGL::nameFromFont(messageFont); + std::string font_style_size = LLFontGL::sizeFromFont(messageFont); + style_params.font.name(font_name); + style_params.font.size(font_style_size); + + int chat_type = notification["chat_type"].asInteger(); + + if(notification["chat_style"].asInteger()== CHAT_STYLE_IRC) { + messageText = messageText.substr(3); style_params.font.style = "ITALIC"; - - msg_text->setText(mFromName, style_params); } - mText = mText.substr(3); - style_params.font.style = "ITALIC"; -#define INFINITE_REFLOW_BUG 0 -#if INFINITE_REFLOW_BUG - // This causes LLTextBase::reflow() to infinite loop until the viewer - // runs out of memory, throws a bad_alloc exception from std::vector - // in mLineInfoList, and the main loop catches it and continues. - // It appears to be caused by addText() adding a line separator in the - // middle of a line. See EXT-2579, EXT-1949 - msg_text->addText(mText,style_params); -#else - msg_text->appendText(mText, FALSE, style_params); -#endif - } - else - { - msg_text->setText(mText, style_params); + else if( chat_type == CHAT_TYPE_SHOUT) + { + style_params.font.style = "BOLD"; + } + else if( chat_type == CHAT_TYPE_WHISPER) + { + style_params.font.style = "ITALIC"; + } + msg_text->appendText(messageText, FALSE, style_params); } - - LLUICtrl* msg_inspector = caption->getChild("msg_inspector"); - if(mSourceType != CHAT_SOURCE_AGENT) - msg_inspector->setVisible(false); - - mMessages.clear(); - - snapToMessageHeight (); + snapToMessageHeight(); mIsDirty = true;//will set Avatar Icon in draw } -void LLNearbyChatToastPanel::setMessage (const LLChat& chat_msg) -{ - LLSD notification; - notification["message"] = chat_msg.mText; - notification["from"] = chat_msg.mFromName; - notification["from_id"] = chat_msg.mFromID; - notification["time"] = chat_msg.mTime; - notification["source"] = (S32)chat_msg.mSourceType; - notification["chat_type"] = (S32)chat_msg.mChatType; - notification["chat_style"] = (S32)chat_msg.mChatStyle; - - std::string r_color_name="White"; - F32 r_color_alpha = 1.0f; - LLViewerChat::getChatColor( chat_msg, r_color_name, r_color_alpha); - - notification["text_color"] = r_color_name; - notification["color_alpha"] = r_color_alpha; - - notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ; - init(notification); - -} - void LLNearbyChatToastPanel::snapToMessageHeight () { LLChatMsgBox* text_box = getChild("msg_text", false); - S32 new_height = text_box->getTextPixelHeight() + msg_height_pad; + S32 new_height = llmax (text_box->getTextPixelHeight() + 2*text_box->getVPad() + 2*msg_height_pad, 25); + LLRect panel_rect = getRect(); - S32 caption_height = 0; - LLPanel* caption = getChild("msg_caption", false); - caption_height = caption->getRect().getHeight(); - - panel_rect.setLeftTopAndSize( panel_rect.mLeft, panel_rect.mTop, panel_rect.getWidth(), caption_height + new_height); + panel_rect.setLeftTopAndSize( panel_rect.mLeft, panel_rect.mTop, panel_rect.getWidth(), new_height); - reshape( getRect().getWidth(), caption_height + new_height, 1); + reshape( getRect().getWidth(), getRect().getHeight(), 1); setRect(panel_rect); } - -void LLNearbyChatToastPanel::setWidth(S32 width) -{ - LLChatMsgBox* text_box = getChild("msg_text", false); - text_box->reshape(width - msg_left_offset - msg_right_offset,100/*its not magic number, we just need any number*/); - - LLChatMsgBox* msg_text = getChild("msg_text", false); - - LLStyle::Params style_params; - style_params.color(mTextColor); - style_params.font(mFont); - - - if(mText.length()) - msg_text->setText(mText, style_params); - - for(size_t i=0;iaddText(mMessages[i] , style_params); - - setRect(LLRect(getRect().mLeft, getRect().mTop, getRect().mLeft + width , getRect().mBottom)); - snapToMessageHeight (); -} - void LLNearbyChatToastPanel::onMouseLeave (S32 x, S32 y, MASK mask) { - LLPanel* caption = getChild("msg_caption", false); - LLUICtrl* msg_inspector = caption->getChild("msg_inspector"); - msg_inspector->setVisible(false); } void LLNearbyChatToastPanel::onMouseEnter (S32 x, S32 y, MASK mask) { if(mSourceType != CHAT_SOURCE_AGENT) return; - LLPanel* caption = getChild("msg_caption", false); - LLUICtrl* msg_inspector = caption->getChild("msg_inspector"); - msg_inspector->setVisible(true); } BOOL LLNearbyChatToastPanel::handleMouseDown (S32 x, S32 y, MASK mask) { if(mSourceType != CHAT_SOURCE_AGENT) return LLPanel::handleMouseDown(x,y,mask); - LLPanel* caption = getChild("msg_caption", false); - LLUICtrl* msg_inspector = caption->getChild("msg_inspector"); - S32 local_x = x - msg_inspector->getRect().mLeft - caption->getRect().mLeft; - S32 local_y = y - msg_inspector->getRect().mBottom - caption->getRect().mBottom; - if(msg_inspector->pointInView(local_x, local_y)) - { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mFromID)); - } - else - { - LLFloaterReg::showInstance("nearby_chat",LLSD()); - } + LLFloaterReg::showInstance("nearby_chat",LLSD()); return LLPanel::handleMouseDown(x,y,mask); } void LLNearbyChatToastPanel::setHeaderVisibility(EShowItemHeader e) { - LLPanel* caption = getChild("msg_caption", false); - - LLUICtrl* icon = caption->getChild("avatar_icon", false); - LLUICtrl* name = caption->getChild("sender_name", false); - - icon->setVisible(e == CHATITEMHEADER_SHOW_ONLY_ICON || e==CHATITEMHEADER_SHOW_BOTH); - name->setVisible(e == CHATITEMHEADER_SHOW_ONLY_NAME || e==CHATITEMHEADER_SHOW_BOTH); + LLUICtrl* icon = getChild("avatar_icon", false); + if(icon) + icon->setVisible(e == CHATITEMHEADER_SHOW_ONLY_ICON || e==CHATITEMHEADER_SHOW_BOTH); } @@ -339,11 +279,10 @@ bool LLNearbyChatToastPanel::canAddText () BOOL LLNearbyChatToastPanel::handleRightMouseDown(S32 x, S32 y, MASK mask) { - LLPanel* caption = getChild("msg_caption", false); - LLUICtrl* avatar_icon = caption->getChild("avatar_icon", false); + LLUICtrl* avatar_icon = getChild("avatar_icon", false); - S32 local_x = x - avatar_icon->getRect().mLeft - caption->getRect().mLeft; - S32 local_y = y - avatar_icon->getRect().mBottom - caption->getRect().mBottom; + S32 local_x = x - avatar_icon->getRect().mLeft; + S32 local_y = y - avatar_icon->getRect().mBottom; //eat message for avatar icon if msg was from object if(avatar_icon->pointInView(local_x, local_y) && mSourceType != CHAT_SOURCE_AGENT) @@ -354,9 +293,7 @@ void LLNearbyChatToastPanel::draw() { if(mIsDirty) { - LLPanel* caption = findChild("msg_caption", false); - if(caption) - caption->getChild("avatar_icon", false)->setValue(mFromID); + getChild("avatar_icon", false)->setValue(mFromID); mIsDirty = false; } LLToastPanelBase::draw(); diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h index a65bfedd09..0a85c52401 100644 --- a/indra/newview/llchatitemscontainerctrl.h +++ b/indra/newview/llchatitemscontainerctrl.h @@ -59,9 +59,8 @@ public: const LLUUID& getFromID() const { return mFromID;} - void addText (const std::string& message , const LLStyle::Params& input_params = LLStyle::Params()); - void setMessage (const LLChat& msg); - void setWidth (S32 width); + //void addText (const std::string& message , const LLStyle::Params& input_params = LLStyle::Params()); + //void setMessage (const LLChat& msg); void snapToMessageHeight (); bool canAddText (); @@ -78,22 +77,16 @@ public: BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual void init(LLSD& data); + virtual void addMessage(LLSD& data); virtual void draw(); -private: - - std::string appendTime (); + const LLUUID& messageID() const { return mFromID;} private: - std::string mText; // UTF-8 line of text - std::string mFromName; // agent or object name LLUUID mFromID; // agent id or object id EChatSourceType mSourceType; - LLColor4 mTextColor; - LLFontGL* mFont; - + - std::vector mMessages; bool mIsDirty; }; diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 74a75d0369..b0b6db682c 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -52,8 +52,6 @@ using namespace LLNotificationsUI; LLToastPanelBase* createToastPanel() { LLNearbyChatToastPanel* item = LLNearbyChatToastPanel::createInstance(); - static S32 chat_item_width = 304; - item->setWidth(chat_item_width); return item; } @@ -169,6 +167,29 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) //look in pool. if there is any message if(mStopProcessing) return; + + /* + find last toast and check ID + */ + + if(m_active_toasts.size()) + { + LLUUID fromID = notification["from_id"].asUUID(); // agent id or object id + LLToast* toast = m_active_toasts[0]; + LLNearbyChatToastPanel* panel = dynamic_cast(toast->getPanel()); + + if(panel && panel->messageID() == fromID && panel->canAddText()) + { + panel->addMessage(notification); + toast->reshapeToPanel(); + toast->resetTimer(); + + arrangeToasts(); + return; + } + } + + if(m_toast_pool.empty()) { diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index eb8ec00bb9..9be8b4c73f 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -684,5 +684,8 @@ + diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml index 2b29796f0a..34c6e02684 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_item.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml @@ -2,70 +2,26 @@ - - - - Jerry Knight - - - - - + - To be or not to be, that is the question. Tis a far far better thing I do than I have ever done. Tis a far far better place I go, than I have ever been. -- cgit v1.2.3 From 9d941cf1193eaaf333dd1c9427256786b1bc60c8 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 25 Nov 2009 14:52:39 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- Implemented speakers list for local chat. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 20 ++++++++++++++++++++ indra/newview/llcallfloater.h | 10 ++++++++++ .../skins/default/xui/en/floater_voice_controls.xml | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index c6d54995bf..eaa048f5aa 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -35,15 +35,35 @@ #include "llcallfloater.h" +#include "llavatarlist.h" +#include "llparticipantlist.h" +#include "llspeakers.h" + LLCallFloater::LLCallFloater() : LLFloater(LLSD()) +, mSpeakerManager(NULL) +, mPaticipants(NULL) +, mAvatarList(NULL) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_voice_controls.xml", NULL); } LLCallFloater::~LLCallFloater() { + delete mPaticipants; + mPaticipants = NULL; +} + +// virtual +BOOL LLCallFloater::postBuild() +{ + LLFloater::postBuild(); + mAvatarList = getChild("speakers_list"); + + mSpeakerManager = LLLocalSpeakerMgr::getInstance(); + mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList); + return TRUE; } //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index dde4085d00..3e672eec79 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -36,6 +36,10 @@ #include "llfloater.h" +class LLAvatarList; +class LLParticipantList; +class LLSpeakerMgr; + /** * The Voice Control Panel is an ambient window summoned by clicking the flyout chevron on the Speak button. * It can be torn-off and freely positioned onscreen. @@ -53,7 +57,13 @@ public: LLCallFloater(); ~LLCallFloater(); + /*virtual*/ BOOL postBuild(); + +private: + LLSpeakerMgr* mSpeakerManager; + LLParticipantList* mPaticipants; + LLAvatarList* mAvatarList; }; diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 705b4276e3..82b4372a4b 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -87,9 +87,10 @@ -- cgit v1.2.3 From 964f4a8fef54f66a9d6ccfea321fa84f51be8bf6 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 25 Nov 2009 15:16:17 +0200 Subject: No ticket. Fixed lines endings to Unix format --HG-- branch : product-engine --- indra/newview/llcallfloater.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 3e672eec79..f1afddb1cc 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -41,13 +41,13 @@ class LLParticipantList; class LLSpeakerMgr; /** - * The Voice Control Panel is an ambient window summoned by clicking the flyout chevron on the Speak button. - * It can be torn-off and freely positioned onscreen. - * - * When the Resident is engaged in Nearby Voice Chat, the Voice Control Panel provides control over - * the Resident's own microphone input volume, the audible volume of each of the other participants, - * the Resident's own Voice Morphing settings (if she has subscribed to enable the feature), and Voice Recording. - * + * The Voice Control Panel is an ambient window summoned by clicking the flyout chevron on the Speak button. + * It can be torn-off and freely positioned onscreen. + * + * When the Resident is engaged in Nearby Voice Chat, the Voice Control Panel provides control over + * the Resident's own microphone input volume, the audible volume of each of the other participants, + * the Resident's own Voice Morphing settings (if she has subscribed to enable the feature), and Voice Recording. + * * When the Resident is engaged in Group Voice Chat, the Voice Control Panel also provides an * 'End Call' button to allow the Resident to leave that voice channel. */ -- cgit v1.2.3 From 1533f3d2a6fcbfd1550b3840c2d2327283f131c0 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Wed, 25 Nov 2009 15:42:36 +0200 Subject: more on EXT-2555 - fix naming and change chat color wo white to match spec () --HG-- branch : product-engine --- indra/newview/llchatitemscontainerctrl.cpp | 2 +- indra/newview/skins/default/colors.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 90956d4aa0..4acb9fd480 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -182,7 +182,7 @@ void LLNearbyChatToastPanel::init(LLSD& notification) { LLStyle::Params style_params_name; - LLColor4 userNameColor = LLUIColorTable::instance().getColor("ChatToastUserNameColor"); + LLColor4 userNameColor = LLUIColorTable::instance().getColor("ChatToastAgentNameColor"); style_params_name.color(userNameColor); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 9be8b4c73f..295f4259fd 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -81,7 +81,7 @@ + reference="White" /> @@ -669,7 +669,7 @@ reference="LtGray" /> + reference="White" /> @@ -685,7 +685,7 @@ name="SysWellItemSelected" value="0.3 0.3 0.3 1.0" /> -- cgit v1.2.3 From 66f76f1aabc4e4fdf4d9c9ef826d8015ca2d4a21 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 25 Nov 2009 16:13:54 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- added new files to CMakeLists --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index e632cbaaf2..e7e89d9701 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -90,6 +90,7 @@ set(viewer_SOURCE_FILES llbox.cpp llbreadcrumbview.cpp llcallbacklist.cpp + llcallfloater.cpp llcallingcard.cpp llcapabilitylistener.cpp llcaphttpsender.cpp @@ -588,6 +589,7 @@ set(viewer_HEADER_FILES llbox.h llbreadcrumbview.h llcallbacklist.h + llcallfloater.h llcallingcard.h llcapabilitylistener.h llcapabilityprovider.h -- cgit v1.2.3 From 5e44bb810ce1385da632d751b58c99446b998d24 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 25 Nov 2009 16:52:45 +0200 Subject: Fix for normal bug EXT-2321 - Collapsed accordion panels in teleport history should expand while filtering if they contain matched items. --HG-- branch : product-engine --- indra/newview/llpanelteleporthistory.cpp | 53 ++++++++++++++++++++++++++++++-- indra/newview/llpanelteleporthistory.h | 4 +++ 2 files changed, 55 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 67d0e13786..debb133573 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -51,6 +51,8 @@ // Used to limit time spent for items list update per frame. static const U32 ADD_LIMIT = 50; +static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; + class LLTeleportHistoryFlatItem : public LLPanel { public: @@ -253,6 +255,10 @@ BOOL LLTeleportHistoryPanel::postBuild() LLAccordionCtrlTab* tab = (LLAccordionCtrlTab*)*iter; tab->setRightMouseDownCallback(boost::bind(&LLTeleportHistoryPanel::onAccordionTabRightClick, this, _1, _2, _3, _4)); tab->setDisplayChildren(false); + tab->setDropDownStateChangedCallback(boost::bind(&LLTeleportHistoryPanel::onAccordionExpand, this, _1, _2)); + + // All accordion tabs are collapsed initially + setAccordionCollapsedByUser(tab, true); mItemContainers.put(tab); @@ -269,10 +275,18 @@ BOOL LLTeleportHistoryPanel::postBuild() // Open first 2 accordion tabs if (mItemContainers.size() > 1) - mItemContainers.get(mItemContainers.size() - 1)->setDisplayChildren(true); + { + LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 1); + tab->setDisplayChildren(true); + setAccordionCollapsedByUser(tab, false); + } if (mItemContainers.size() > 2) - mItemContainers.get(mItemContainers.size() - 2)->setDisplayChildren(true); + { + LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 2); + tab->setDisplayChildren(true); + setAccordionCollapsedByUser(tab, false); + } } getChild("bottom_panel")->childSetAction("gear_btn",boost::bind(&LLTeleportHistoryPanel::onGearButtonClicked, this)); @@ -490,6 +504,18 @@ void LLTeleportHistoryPanel::refresh() LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 1 - tab_idx); tab->setVisible(true); + // Expand all accordion tabs when filtering + if(!mFilterSubString.empty()) + { + tab->setDisplayChildren(true); + } + // Restore each tab's expand state when not filtering + else + { + bool collapsed = isAccordionCollapsedByUser(tab); + tab->setDisplayChildren(!collapsed); + } + curr_flat_view = getFlatListViewFromTab(tab); } @@ -774,3 +800,26 @@ void LLTeleportHistoryPanel::onGearButtonClicked() LLMenuGL::showPopup(this, menu, menu_x, menu_y); } +void LLTeleportHistoryPanel::setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed) +{ + LLSD param = acc_tab->getValue(); + param[COLLAPSED_BY_USER] = collapsed; + acc_tab->setValue(param); +} + +bool LLTeleportHistoryPanel::isAccordionCollapsedByUser(LLUICtrl* acc_tab) +{ + LLSD param = acc_tab->getValue(); + if(!param.has("acc_collapsed")) + { + return false; + } + return param[COLLAPSED_BY_USER].asBoolean(); +} + +void LLTeleportHistoryPanel::onAccordionExpand(LLUICtrl* ctrl, const LLSD& param) +{ + bool expanded = param.asBoolean(); + // Save accordion tab state to restore it in refresh() + setAccordionCollapsedByUser(ctrl, !expanded); +} diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index a31ff34cb6..f646fea355 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -98,6 +98,10 @@ private: LLFlatListView* getFlatListViewFromTab(LLAccordionCtrlTab *); void onGearButtonClicked(); + void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed); + bool isAccordionCollapsedByUser(LLUICtrl* acc_tab); + void onAccordionExpand(LLUICtrl* ctrl, const LLSD& param); + LLTeleportHistoryStorage* mTeleportHistory; LLAccordionCtrl* mHistoryAccordion; -- cgit v1.2.3 From 99f61e92eb0f7f35cbd606fa24583542c80f697a Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 25 Nov 2009 16:54:40 +0200 Subject: Update for normal bug EXT-2564 - collapsed All friends list reopens if online friends list changes. Minor code improvements. --HG-- branch : product-engine --- indra/newview/llpanelpeople.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b74d566f3e..371c598e84 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -479,15 +479,10 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LL bool expanded = param.asBoolean(); + setAccordionCollapsedByUser(ctrl, !expanded); if(!expanded) { avatar_list->resetSelection(); - - setAccordionCollapsedByUser(ctrl, true); - } - else - { - setAccordionCollapsedByUser(ctrl, false); } } @@ -1385,6 +1380,10 @@ bool LLPanelPeople::isAccordionCollapsedByUser(LLUICtrl* acc_tab) } LLSD param = acc_tab->getValue(); + if(!param.has(COLLAPSED_BY_USER)) + { + return false; + } return param[COLLAPSED_BY_USER].asBoolean(); } -- cgit v1.2.3 From cf77bc11772c41546d1f5f1a0bda1bf36506e37b Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Wed, 25 Nov 2009 18:25:26 +0200 Subject: fixed normal bug EXT-2822 [BSI] IM chiclet floater always jumps to most recent chat --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index ee93a9349a..310eaaec27 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -529,7 +529,6 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* //in disconnected state IM input editor should be disabled self->mInputEditor->setEnabled(!gDisconnected); } - self->mChatHistory->setCursorAndScrollToEnd(); } // static -- cgit v1.2.3 From b19b63ad8cba7b1c3e44c4084313103765af1917 Mon Sep 17 00:00:00 2001 From: Sergey Borushevsky Date: Wed, 25 Nov 2009 20:46:53 +0200 Subject: Fixed minor bug EXT-2744 (IM window: Add Friend is disabled after removing friendship with a friends) --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 9 +++++++++ indra/newview/llpanelimcontrolpanel.h | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 40319d949d..ed651790f0 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -120,6 +120,7 @@ LLPanelIMControlPanel::LLPanelIMControlPanel() LLPanelIMControlPanel::~LLPanelIMControlPanel() { + LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); } BOOL LLPanelIMControlPanel::postBuild() @@ -175,7 +176,9 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) LLIMModel& im_model = LLIMModel::instance(); + LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); mAvatarID = im_model.getOtherParticipantID(session_id); + LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this); // Disable "Add friend" button for friends. childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); @@ -204,6 +207,12 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) } } +//virtual +void LLPanelIMControlPanel::changed(U32 mask) +{ + childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); +} + void LLPanelIMControlPanel::nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { if ( id == mAvatarID ) diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 7bfc432ef2..a590232a0b 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -35,6 +35,7 @@ #include "llpanel.h" #include "llvoicechannel.h" +#include "llcallingcard.h" class LLSpeakerMgr; class LLAvatarList; @@ -66,7 +67,7 @@ private: }; -class LLPanelIMControlPanel : public LLPanelChatControlPanel +class LLPanelIMControlPanel : public LLPanelChatControlPanel, LLFriendObserver { public: LLPanelIMControlPanel(); @@ -76,6 +77,9 @@ public: void setSessionId(const LLUUID& session_id); + // LLFriendObserver trigger + virtual void changed(U32 mask); + protected: void nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); -- cgit v1.2.3 From e0717c6aac140c840e6ca614afd39b6d95d46329 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 26 Nov 2009 11:39:59 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- made Voice Control Panel dockable to speak panel -- move button toggle state processing from the code to xml --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 15 +++++--- indra/newview/llcallfloater.h | 6 ++-- indra/newview/llspeakbutton.cpp | 41 ++-------------------- indra/newview/llspeakbutton.h | 2 -- indra/newview/llviewerfloaterreg.cpp | 2 ++ .../default/xui/en/floater_voice_controls.xml | 2 ++ .../skins/default/xui/en/panel_bottomtray.xml | 8 ++++- 7 files changed, 28 insertions(+), 48 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index eaa048f5aa..2c77933b68 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -36,17 +36,18 @@ #include "llcallfloater.h" #include "llavatarlist.h" +#include "llbottomtray.h" #include "llparticipantlist.h" #include "llspeakers.h" -LLCallFloater::LLCallFloater() -: LLFloater(LLSD()) +LLCallFloater::LLCallFloater(const LLSD& key) +: LLDockableFloater(NULL, key) , mSpeakerManager(NULL) , mPaticipants(NULL) , mAvatarList(NULL) { - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_voice_controls.xml", NULL); + } LLCallFloater::~LLCallFloater() @@ -58,12 +59,18 @@ LLCallFloater::~LLCallFloater() // virtual BOOL LLCallFloater::postBuild() { - LLFloater::postBuild(); + LLDockableFloater::postBuild(); mAvatarList = getChild("speakers_list"); mSpeakerManager = LLLocalSpeakerMgr::getInstance(); mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList); + LLView *anchor_panel = LLBottomTray::getInstance()->getChild("speak_panel"); + + setDockControl(new LLDockControl( + anchor_panel, this, + getDockTongue(), LLDockControl::TOP)); + return TRUE; } //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index f1afddb1cc..8c4a204943 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -34,7 +34,7 @@ #ifndef LL_LLCALLFLOATER_H #define LL_LLCALLFLOATER_H -#include "llfloater.h" +#include "lldockablefloater.h" class LLAvatarList; class LLParticipantList; @@ -51,10 +51,10 @@ class LLSpeakerMgr; * When the Resident is engaged in Group Voice Chat, the Voice Control Panel also provides an * 'End Call' button to allow the Resident to leave that voice channel. */ -class LLCallFloater : public LLFloater +class LLCallFloater : public LLDockableFloater { public: - LLCallFloater(); + LLCallFloater(const LLSD& key); ~LLCallFloater(); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index 9562d7828c..5edc4804ca 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "llbutton.h" +#include "llfloaterreg.h" #include "llagent.h" #include "llbottomtray.h" @@ -95,8 +96,8 @@ LLSpeakButton::LLSpeakButton(const Params& p) addChild(mShowBtn); LLTransientFloaterMgr::getInstance()->addControlView(mShowBtn); - mShowBtn->setClickedCallback(boost::bind(&LLSpeakButton::onClick_ShowBtn, this)); - mShowBtn->setToggleState(FALSE); +// mShowBtn->setClickedCallback(boost::bind(&LLSpeakButton::onClick_ShowBtn, this)); +// mShowBtn->setToggleState(FALSE); static const S32 MONITOR_RIGHT_PAD = 2; @@ -168,39 +169,3 @@ void LLSpeakButton::onMouseUp_SpeakBtn() gVoiceClient->inputUserControlState(down); } -void LLSpeakButton::onClick_ShowBtn() -{ - if(!mShowBtn->getToggleState()) - { - if (!mPrivateCallPanel.isDead()) - { - LLFloater* instance = mPrivateCallPanel.get(); - instance->onClickClose(instance); - } - mShowBtn->setToggleState(FALSE); - return; - } - - S32 x = mSpeakBtn->getRect().mLeft; - S32 y = 0; - - localPointToScreen(x, y, &x, &y); - - LLCallFloater* instance = new LLCallFloater; - mPrivateCallPanel = instance->getHandle(); - - // *TODO: mantipov: why we are adding this floater to Root View? It is in FloaterView by default - getRootView()->addChild(instance); - - y = LLBottomTray::getInstance()->getRect().getHeight() + instance->getRect().getHeight(); - - LLRect rect; - rect.setLeftTopAndSize(x, y, instance->getRect().getWidth(), instance->getRect().getHeight()); - instance->setRect(rect); - - instance->setVisible(TRUE); - instance->setFrontmost(TRUE); - - mShowBtn->setToggleState(TRUE); -} - diff --git a/indra/newview/llspeakbutton.h b/indra/newview/llspeakbutton.h index 33f7c9fa28..6660b50240 100644 --- a/indra/newview/llspeakbutton.h +++ b/indra/newview/llspeakbutton.h @@ -86,8 +86,6 @@ protected: void onMouseDown_SpeakBtn(); void onMouseUp_SpeakBtn(); - void onClick_ShowBtn(); - private: LLButton* mSpeakBtn; LLButton* mShowBtn; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 642df92379..29151f2038 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -38,6 +38,7 @@ #include "llviewerfloaterreg.h" #include "llcompilequeue.h" +#include "llcallfloater.h" #include "llfloaterabout.h" #include "llfloateractivespeakers.h" #include "llfloateranimpreview.h" @@ -248,6 +249,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("upload_sound", "floater_sound_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); LLFloaterReg::add("voice_call", "floater_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("voice_controls", "floater_voice_controls.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("whitelist_entry", "floater_whitelist_entry.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("world_map", "floater_world_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 82b4372a4b..b718cc40fe 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -5,6 +5,8 @@ layout="topleft" name="floater_voice_controls" title="Voice Controls" + save_visibility="true" + single_instance="true" width="282"> + width="100"> + + + + Date: Thu, 26 Nov 2009 11:41:04 +0200 Subject: No ticket. Place "script_floater" in alphabetical order. --HG-- branch : product-engine --- indra/newview/llviewerfloaterreg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 29151f2038..227f6c4971 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -175,7 +175,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("im_container", "floater_im_container.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("script_floater", "floater_script.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("inventory", "floater_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); @@ -235,6 +234,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("script_debug", "floater_script_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("script_debug_output", "floater_script_debug_panel.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("script_floater", "floater_script.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater); LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); -- cgit v1.2.3 From b884eede5126309bcb1742555ea14308efaa9f20 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Thu, 26 Nov 2009 12:58:14 +0200 Subject: EXT-2831 Timestamps are missing in nearby chat toasts --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 29 ++++++++++++++++++++++++++--- indra/newview/llchathistory.h | 1 + 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2c9b38b82a..caf9c08057 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -199,7 +199,7 @@ public: userName->setValue(SL); } - setTimeField(chat.mTimeStr); + setTimeField(chat); LLAvatarIconCtrl* icon = getChild("avatar_icon"); @@ -267,11 +267,29 @@ protected: } private: - void setTimeField(const std::string& time_value) + std::string appendTime(const LLChat& chat) + { + time_t utc_time; + utc_time = time_corrected(); + std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" + +LLTrans::getString("TimeMin")+"] "; + + LLSD substitution; + + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format (timeStr, substitution); + + return timeStr; + } + + void setTimeField(const LLChat& chat) { LLTextBox* time_box = getChild("time_box"); LLRect rect_before = time_box->getRect(); + + std::string time_value = appendTime(chat); + time_box->setValue(time_value); // set necessary textbox width to fit all text @@ -386,7 +404,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ p.left_pad = mLeftWidgetPad; p.right_pad = mRightWidgetPad; - if (mLastFromName == chat.mFromName) + LLDate new_message_time = LLDate::now(); + + if (mLastFromName == chat.mFromName && + mLastMessageTime.notNull() && + (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 ) { view = getSeparator(); p.top_pad = mTopSeparatorPad; @@ -414,6 +436,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ appendWidget(p, header_text, false); mLastFromName = chat.mFromName; + mLastMessageTime = new_message_time; } //Handle IRC styled /me messages. std::string prefix = chat.mText.substr(0, 4); diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index ef5839ff2f..d2cfa53d8b 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -114,6 +114,7 @@ class LLChatHistory : public LLTextEditor private: std::string mLastFromName; + LLDate mLastMessageTime; std::string mMessageHeaderFilename; std::string mMessageSeparatorFilename; -- cgit v1.2.3 From f8add4c7fd53df8249d6f66f690e963321654986 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 26 Nov 2009 13:06:35 +0200 Subject: Update for major task EXT-2095 - Consolidate Picks and Classifieds into a single tab in the user profile panel. Implemented feature "all accordion headers should be visible in the panel at all times". --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_picks.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml index ca84c9147b..4f0d155876 100644 --- a/indra/newview/skins/default/xui/en/panel_picks.xml +++ b/indra/newview/skins/default/xui/en/panel_picks.xml @@ -27,6 +27,7 @@ There are no picks/classifieds here Date: Thu, 26 Nov 2009 13:08:51 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- disable context menu for Active Speakers in Voice Control Panel --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 2 +- indra/newview/llparticipantlist.cpp | 9 ++++++--- indra/newview/llparticipantlist.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 2c77933b68..f566806b29 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -63,7 +63,7 @@ BOOL LLCallFloater::postBuild() mAvatarList = getChild("speakers_list"); mSpeakerManager = LLLocalSpeakerMgr::getInstance(); - mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList); + mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, false); LLView *anchor_panel = LLBottomTray::getInstance()->getChild("speak_panel"); diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 4ee9cba69c..bbcfb6b576 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -47,7 +47,7 @@ #if LL_MSVC #pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally #endif -LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list): +LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu/* = true*/): mSpeakerMgr(data_source), mAvatarList(avatar_list), mSortOrder(E_SORT_BY_NAME) @@ -68,8 +68,11 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av // Set onAvatarListDoubleClicked as default on_return action. mAvatarList->setReturnCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); - mParticipantListMenu = new LLParticipantListMenu(*this); - mAvatarList->setContextMenu(mParticipantListMenu); + if (use_context_menu) + { + mParticipantListMenu = new LLParticipantListMenu(*this); + mAvatarList->setContextMenu(mParticipantListMenu); + } //Lets fill avatarList with existing speakers LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs(); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 5e26c39fc8..ce61dd9b96 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -43,7 +43,7 @@ class LLParticipantList { LOG_CLASS(LLParticipantList); public: - LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list); + LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu = true); ~LLParticipantList(); void setSpeakingIndicatorsVisible(BOOL visible); -- cgit v1.2.3 From 8fae31be64bbba9a5dc7803dbe64b40e9142a94b Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Thu, 26 Nov 2009 13:24:51 +0200 Subject: EXT-2691 Resident's icon appears for objects in the nearby chat --HG-- branch : product-engine --- indra/newview/llavatariconctrl.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 327d80ba34..8f3eba98a6 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -234,6 +234,7 @@ void LLAvatarIconCtrl::setValue(const LLSD& value) // Check if cache already contains image_id for that avatar if (!updateFromCache()) { + LLIconCtrl::setValue(mDefaultIconName); app->addObserver(mAvatarId, this); app->sendAvatarPropertiesRequest(mAvatarId); } -- cgit v1.2.3 From 93920daf63e73720be4a6e815cfdfae4cfbe212e Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Thu, 26 Nov 2009 13:54:30 +0200 Subject: fix for major EXT-2449 [BSI] Memberlist in "Members & Roles" tab of a group is incomplete --HG-- branch : product-engine --- indra/newview/llpanelgrouproles.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 7b5b232ad2..fa95046a1f 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1543,9 +1543,6 @@ void LLPanelGroupMembersSubTab::updateMembers() mPendingMemberUpdate = FALSE; // Rebuild the members list. - mMembersList->deleteAllItems(); - - lldebugs << "LLPanelGroupMembersSubTab::updateMembers()" << llendl; LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) @@ -1562,7 +1559,12 @@ void LLPanelGroupMembersSubTab::updateMembers() { return; } - + + //cleanup list only for first iretation + if(mMemberProgress == gdatap->mMembers.begin()) + mMembersList->deleteAllItems(); + + LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end(); S32 i = 0; -- cgit v1.2.3 From 28f17cb8f6840aef0b7c2f8b3b7168466550aa64 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 26 Nov 2009 14:01:10 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- init member for context menu in Participant List to avoid deleting of uninitialized pointer --HG-- branch : product-engine --- indra/newview/llparticipantlist.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index bbcfb6b576..a5440c3687 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -51,6 +51,7 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mSpeakerMgr(data_source), mAvatarList(avatar_list), mSortOrder(E_SORT_BY_NAME) +, mParticipantListMenu(NULL) { mSpeakerAddListener = new SpeakerAddListener(*this); mSpeakerRemoveListener = new SpeakerRemoveListener(*this); -- cgit v1.2.3 From 8a812495daa52aa9ae092222c23c5f8815929544 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 26 Nov 2009 14:03:45 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- implemented reaction of microphone slider in Microphone Input Level Settings --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/floater_voice_controls.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index b718cc40fe..2f13b51a9f 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -73,11 +73,13 @@ user_resize="false" width="258"> Date: Thu, 26 Nov 2009 19:30:41 +0200 Subject: Partial fix for normal bug EXT-2619 \"Invalid IM session is opened when resident ejects a member from group\": a toast was implemented, but adding a record to the Group Chat history was not because of known issue EXT-2884 \"Initiation of a voice call should not bring text chat (p2p, ad-hoc, group)\". --HG-- branch : product-engine --- indra/newview/llpanelgrouproles.cpp | 23 ++++++++++++++++++++++ indra/newview/llpanelgrouproles.h | 1 + .../newview/skins/default/xui/en/notifications.xml | 7 +++++++ 3 files changed, 31 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 020c25c8ac..70b4858a4b 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1101,10 +1101,33 @@ void LLPanelGroupMembersSubTab::handleEjectMembers() mMembersList->deleteSelectedItems(); + sendEjectNotifications(mGroupID, selected_members); + LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, selected_members); } +void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, const std::vector& selected_members) +{ + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id); + + if (group_data) + { + for (std::vector::const_iterator i = selected_members.begin(); i != selected_members.end(); ++i) + { + LLSD args; + std::string name; + + gCacheName->getFullName(*i, name); + + args["AVATAR_NAME"] = name; + args["GROUP_NAME"] = group_data->mName; + + LLNotifications::instance().add(LLNotification::Params("EjectAvatarFromGroup").substitutions(args)); + } + } +} + void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, LLRoleMemberChangeType type) { diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index b6e2245e70..bb3c9096cf 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -170,6 +170,7 @@ public: static void onEjectMembers(void*); void handleEjectMembers(); + void sendEjectNotifications(const LLUUID& group_id, const std::vector& selected_members); static void onRoleCheck(LLUICtrl* check, void* user_data); void handleRoleCheck(const LLUUID& role_id, diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 6e178ad570..79ef1d104b 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1170,6 +1170,13 @@ Eject [AVATAR_NAME] from your land? yestext="Eject"/> + +You ejected [AVATAR_NAME] from group [GROUP_NAME] + + Date: Thu, 26 Nov 2009 20:17:07 +0200 Subject: implemented overridden LLAvatarList::clear to follow class behavior --HG-- branch : product-engine --- indra/newview/llavatarlist.cpp | 7 +++++++ indra/newview/llavatarlist.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 7f3f869e5d..202fbdebd4 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -153,6 +153,13 @@ void LLAvatarList::draw() } } +//virtual +void LLAvatarList::clear() +{ + getIDs().clear(); + setDirty(true); +} + void LLAvatarList::setNameFilter(const std::string& filter) { if (mNameFilter != filter) diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 490f93e501..9058fec540 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -70,6 +70,8 @@ public: virtual void draw(); // from LLView + virtual void clear(); + void setNameFilter(const std::string& filter); void setDirty(bool val = true) { mDirty = val; } uuid_vector_t& getIDs() { return mIDs; } -- cgit v1.2.3 From bf6d5e9755b6c6e93fdf22a6cd4e20ffb2d2b441 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 26 Nov 2009 20:41:07 +0200 Subject: Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel)) -- implemented opening of the Voice Control Panel from the Group Chat --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 25 ++++++++++++++++++++-- indra/newview/llcallfloater.h | 1 + indra/newview/llpanelimcontrolpanel.cpp | 4 +++- indra/newview/llparticipantlist.cpp | 1 + .../default/xui/en/panel_group_control_panel.xml | 1 - 5 files changed, 28 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index f566806b29..4a24b558c9 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -62,8 +62,6 @@ BOOL LLCallFloater::postBuild() LLDockableFloater::postBuild(); mAvatarList = getChild("speakers_list"); - mSpeakerManager = LLLocalSpeakerMgr::getInstance(); - mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, false); LLView *anchor_panel = LLBottomTray::getInstance()->getChild("speak_panel"); @@ -73,4 +71,27 @@ BOOL LLCallFloater::postBuild() return TRUE; } + +// virtual +void LLCallFloater::onOpen(const LLSD& key) +{ + // by default let show nearby chat participants + mSpeakerManager = LLLocalSpeakerMgr::getInstance(); + + const LLUUID& session_id = key.asUUID(); + LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id); + if (im_session) + { + mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id); + } + + delete mPaticipants; + mAvatarList->clear(); + mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, false); +} + +////////////////////////////////////////////////////////////////////////// +/// PRIVATE SECTION +////////////////////////////////////////////////////////////////////////// + //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 8c4a204943..0b86a6ee92 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -58,6 +58,7 @@ public: ~LLCallFloater(); /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); private: diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 78b4d29b16..741f42f9d5 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -32,6 +32,8 @@ #include "llviewerprecompiledheaders.h" +#include "llfloaterreg.h" + #include "llpanelimcontrolpanel.h" #include "llagent.h" @@ -58,7 +60,7 @@ void LLPanelChatControlPanel::onEndCallButtonClicked() void LLPanelChatControlPanel::onOpenVoiceControlsClicked() { - // TODO: implement Voice Control Panel opening + LLFloaterReg::showInstance("voice_controls", getSessionId()); } void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index a5440c3687..7cf5302e40 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -89,6 +89,7 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mModeratorList.insert(speakerp->mID); } } + mAvatarList->setDirty(true); sort(); } diff --git a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml index 41b210557e..889f29fc53 100644 --- a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml @@ -61,7 +61,6 @@ width="125"/>