From c3f2859c9f91d0c26c256b498c29da624afb8fb9 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Sat, 26 Dec 2009 16:35:33 +0200 Subject: Reduced header dependency from the "llimview.h" --HG-- branch : product-engine --- indra/newview/llavatariconctrl.cpp | 1 - indra/newview/llcallingcard.cpp | 1 - indra/newview/llchannelmanager.cpp | 1 - indra/newview/llchathistory.cpp | 4 +++- indra/newview/llfloaterchatterbox.cpp | 1 + indra/newview/llfloaterchatterbox.h | 2 +- indra/newview/llfloaterreporter.cpp | 1 - indra/newview/llimpanel.cpp | 2 -- indra/newview/llimpanel.h | 1 - indra/newview/llparticipantlist.cpp | 1 - indra/newview/llparticipantlist.h | 1 - indra/newview/llstatusbar.cpp | 1 - indra/newview/llviewermenu.cpp | 1 + 13 files changed, 6 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 44cbbbb6b2..42ae122ff9 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -38,7 +38,6 @@ #include "llavatarconstants.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llavataractions.h" -#include "llimview.h" #include "llmenugl.h" #include "lluictrlfactory.h" diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 82413878ad..d988770f90 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -62,7 +62,6 @@ #include "llviewerobjectlist.h" #include "llviewerwindow.h" #include "llvoavatar.h" -#include "llimview.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index cbb566b3a7..769387c26c 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -36,7 +36,6 @@ #include "llappviewer.h" #include "llviewercontrol.h" -#include "llimview.h" #include "llviewerwindow.h" #include "llrootview.h" #include "llsyswellwindow.h" diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index b1ddddc4b1..21cadda6e3 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -31,12 +31,14 @@ */ #include "llviewerprecompiledheaders.h" + +#include "llinstantmessage.h" + #include "llchathistory.h" #include "llpanel.h" #include "lluictrlfactory.h" #include "llscrollcontainer.h" #include "llavatariconctrl.h" -#include "llimview.h" #include "llcallingcard.h" //for LLAvatarTracker #include "llagentdata.h" #include "llavataractions.h" diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index 1b14ca573a..9108cfb72b 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -44,6 +44,7 @@ #include "llviewercontrol.h" #include "llvoicechannel.h" #include "llimpanel.h" +#include "llimview.h" // // LLFloaterMyFriends diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h index 3929e6e36c..ab44281d81 100644 --- a/indra/newview/llfloaterchatterbox.h +++ b/indra/newview/llfloaterchatterbox.h @@ -36,8 +36,8 @@ #define LL_LLFLOATERCHATTERBOX_H #include "llfloater.h" +#include "llmultifloater.h" #include "llstring.h" -#include "llimview.h" #include "llimpanel.h" class LLTabContainer; diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 9f3dcae8ef..c0825dc694 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -57,7 +57,6 @@ #include "llfloaterreg.h" #include "lltexturectrl.h" #include "llscrolllistctrl.h" -#include "llimview.h" #include "lldispatcher.h" #include "llviewerobject.h" #include "llviewerregion.h" diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 8b6762ce38..4b45a9aba9 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -57,13 +57,11 @@ #include "llfloateractivespeakers.h" #include "llfloatercall.h" #include "llavataractions.h" -#include "llimview.h" #include "llinventory.h" #include "llinventorymodel.h" #include "llfloaterinventory.h" #include "llfloaterchat.h" #include "lliconctrl.h" -#include "llimview.h" // for LLIMModel to get other avatar id in chat #include "llkeyboard.h" #include "lllineeditor.h" #include "llpanelimcontrolpanel.h" diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index b8f99d45c9..abbf1e68ab 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -33,7 +33,6 @@ #ifndef LL_IMPANEL_H #define LL_IMPANEL_H -#include "llimview.h" //for LLIMModel #include "lldockablefloater.h" #include "lllogchat.h" #include "lluuid.h" diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 330e220af3..db4f9a2d95 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -36,7 +36,6 @@ #include "lltrans.h" #include "llavataractions.h" #include "llagent.h" -#include "llimview.h" #include "llparticipantlist.h" #include "llspeakers.h" diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index d15ec980db..70badbc40d 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -33,7 +33,6 @@ #include "llviewerprecompiledheaders.h" #include "llevent.h" #include "llpanelpeoplemenus.h" -#include "llimview.h" #include "llavatarlist.h" // for LLAvatarItemRecentSpeakerComparator class LLSpeakerMgr; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 23c4f00ab7..2a6ef82ac0 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -50,7 +50,6 @@ #include "llkeyboard.h" #include "lllineeditor.h" #include "llmenugl.h" -#include "llimview.h" #include "llsd.h" #include "lltextbox.h" #include "llui.h" diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 2a9c738c97..15855f154d 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -70,6 +70,7 @@ #include "lltooltip.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" +#include "llimview.h" #include "llinventorybridge.h" #include "llpanellogin.h" #include "llpanelblockedlist.h" -- cgit v1.2.3 From 70e6b5a7f7027b7f9c005ca1ce43601f953dc951 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Sat, 26 Dec 2009 18:56:19 +0200 Subject: Fixed low bug EXT-3684 ("Default" icon is used always for group calls in the voice notifications instead of group icon) -- implemented LLGroupIconCtrl to show group icon for passed group UUID. -- added LLGroupIconCtrl to incoming and outgoing dialogs --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 2 + indra/newview/llgroupiconctrl.cpp | 145 +++++++++++++++++++++ indra/newview/llgroupiconctrl.h | 92 +++++++++++++ indra/newview/llimview.cpp | 31 ++++- indra/newview/llimview.h | 8 ++ .../skins/default/xui/en/floater_incoming_call.xml | 7 + .../skins/default/xui/en/floater_outgoing_call.xml | 7 + .../skins/default/xui/en/widgets/group_icon.xml | 5 + 8 files changed, 293 insertions(+), 4 deletions(-) create mode 100644 indra/newview/llgroupiconctrl.cpp create mode 100644 indra/newview/llgroupiconctrl.h create mode 100644 indra/newview/skins/default/xui/en/widgets/group_icon.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a26aae3590..648e582e94 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -227,6 +227,7 @@ set(viewer_SOURCE_FILES llgesturemgr.cpp llglsandbox.cpp llgroupactions.cpp + llgroupiconctrl.cpp llgrouplist.cpp llgroupmgr.cpp llhomelocationresponder.cpp @@ -736,6 +737,7 @@ set(viewer_HEADER_FILES llfriendcard.h llgesturemgr.h llgroupactions.h + llgroupiconctrl.h llgrouplist.h llgroupmgr.h llhomelocationresponder.h diff --git a/indra/newview/llgroupiconctrl.cpp b/indra/newview/llgroupiconctrl.cpp new file mode 100644 index 0000000000..0b03d49cbc --- /dev/null +++ b/indra/newview/llgroupiconctrl.cpp @@ -0,0 +1,145 @@ +/** + * @file llgroupiconctrl.cpp + * @brief LLGroupIconCtrl class implementation + * + * $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 "llgroupiconctrl.h" + +#include "llagent.h" +/* +#include "llavatarconstants.h" +#include "llcallingcard.h" // for LLAvatarTracker +#include "llavataractions.h" +#include "llmenugl.h" +#include "lluictrlfactory.h" + +#include "llcachename.h" +#include "llagentdata.h" +#include "llimfloater.h" +*/ + +static LLDefaultChildRegistry::Register g_i("group_icon"); + +LLGroupIconCtrl::Params::Params() +: group_id("group_id") +, draw_tooltip("draw_tooltip", true) +, default_icon_name("default_icon_name") +{ +} + + +LLGroupIconCtrl::LLGroupIconCtrl(const LLGroupIconCtrl::Params& p) +: LLIconCtrl(p) +, mGroupId(LLUUID::null) +, mDrawTooltip(p.draw_tooltip) +, mDefaultIconName(p.default_icon_name) +{ + mPriority = LLViewerFetchedTexture::BOOST_ICON; + + if (p.group_id.isProvided()) + { + LLSD value(p.group_id); + setValue(value); + } + else + { + LLIconCtrl::setValue(mDefaultIconName); + } +} + +LLGroupIconCtrl::~LLGroupIconCtrl() +{ + LLGroupMgr::getInstance()->removeObserver(this); +} + +void LLGroupIconCtrl::setValue(const LLSD& value) +{ + if (value.isUUID()) + { + LLGroupMgr* gm = LLGroupMgr::getInstance(); + if (mGroupId.notNull()) + { + gm->removeObserver(this); + } + + if (mGroupId != value.asUUID()) + { + mGroupId = value.asUUID(); + + // Check if cache already contains image_id for that group + if (!updateFromCache()) + { + LLIconCtrl::setValue(mDefaultIconName); + gm->addObserver(this); + gm->sendGroupPropertiesRequest(mGroupId); + } + } + } + else + { + LLIconCtrl::setValue(value); + } +} + +void LLGroupIconCtrl::changed(LLGroupChange gc) +{ + if (GC_PROPERTIES == gc) + { + updateFromCache(); + } +} + +bool LLGroupIconCtrl::updateFromCache() +{ + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mGroupId); + if (!group_data) return false; + + if (group_data->mInsigniaID.notNull()) + { + LLIconCtrl::setValue(group_data->mInsigniaID); + } + else + { + LLIconCtrl::setValue(mDefaultIconName); + } + + if (mDrawTooltip && !group_data->mName.empty()) + { + setToolTip(group_data->mName); + } + else + { + setToolTip(LLStringUtil::null); + } + return true; +} + diff --git a/indra/newview/llgroupiconctrl.h b/indra/newview/llgroupiconctrl.h new file mode 100644 index 0000000000..7ac2ca0219 --- /dev/null +++ b/indra/newview/llgroupiconctrl.h @@ -0,0 +1,92 @@ +/** + * @file llgroupiconctrl.h + * @brief LLGroupIconCtrl class declaration + * + * $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_LLGROUPICONCTRL_H +#define LL_LLGROUPICONCTRL_H + +#include "lliconctrl.h" + +#include "llgroupmgr.h" + +/** + * Extends IconCtrl to show group icon wherever it is needed. + * + * It gets icon id by group id from the LLGroupMgr. + * If group data is not loaded yet it subscribes as LLGroupMgr observer and requests necessary data. + */ +class LLGroupIconCtrl + : public LLIconCtrl, public LLGroupMgrObserver +{ +public: + struct Params : public LLInitParam::Block + { + Optional group_id; + Optional draw_tooltip; + Optional default_icon_name; + Params(); + }; + +protected: + LLGroupIconCtrl(const Params&); + friend class LLUICtrlFactory; + +public: + virtual ~LLGroupIconCtrl(); + + /** + * Determines group icon id by group id and sets it as icon value. + * + * Icon id is got from the appropriate LLGroupMgrGroupData specified by group UUID. + * If necessary it requests necessary data from the LLGroupMgr. + * + * @params value - if LLUUID - it is processed as group id otherwise base method is called. + */ + virtual void setValue(const LLSD& value); + + // LLGroupMgrObserver observer trigger + virtual void changed(LLGroupChange gc); + + const std::string& getGroupName() const { return mGroupName; } + void setDrawTooltip(bool value) { mDrawTooltip = value;} + + const LLUUID& getGroupId() const { return mGroupId; } + +protected: + LLUUID mGroupId; + std::string mGroupName; + bool mDrawTooltip; + std::string mDefaultIconName; + + bool updateFromCache(); +}; + +#endif // LL_LLGROUPICONCTRL_H diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 37ab144934..d34bab8c4d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -57,6 +57,7 @@ #include "llhttpnode.h" #include "llimfloater.h" #include "llimpanel.h" +#include "llgroupiconctrl.h" #include "llresizebar.h" #include "lltabcontainer.h" #include "llviewercontrol.h" @@ -1495,6 +1496,27 @@ void LLCallDialog::draw() } } +void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) +{ + bool is_group = gAgent.isInGroup(session_id); + + LLAvatarIconCtrl* avatar_icon = getChild("avatar_icon"); + LLGroupIconCtrl* group_icon = getChild("group_icon"); + + avatar_icon->setVisible(!is_group); + group_icon->setVisible(is_group); + + if (is_group) + { + group_icon->setValue(session_id); + } + else + { + avatar_icon->setValue(participant_id); + } + +} + bool LLOutgoingCallDialog::lifetimeHasExpired() { if (mLifetimeTimer.getStarted()) @@ -1556,8 +1578,9 @@ void LLOutgoingCallDialog::show(const LLSD& key) LLSD callee_id = mPayload["other_user_id"]; childSetTextArg("calling", "[CALLEE_NAME]", callee_name); childSetTextArg("connecting", "[CALLEE_NAME]", callee_name); - LLAvatarIconCtrl* icon = getChild("avatar_icon"); - icon->setValue(callee_id); + + // for outgoing group calls callee_id == group id == session id + setIcon(callee_id, callee_id); // stop timer by default mLifetimeTimer.stop(); @@ -1711,13 +1734,13 @@ BOOL LLIncomingCallDialog::postBuild() LLUICtrl* caller_name_widget = getChild("caller name"); caller_name_widget->setValue(caller_name + " " + call_type); - LLAvatarIconCtrl* icon = getChild("avatar_icon"); if (is_avatar) { - icon->setValue(caller_id); + setIcon(session_id, caller_id); } else { + LLAvatarIconCtrl* icon = getChild("avatar_icon"); icon->setValue("Avaline_Icon"); } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index cec9d1642f..b0f5f3d813 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -501,6 +501,14 @@ protected: virtual void onLifetimeExpired() {}; virtual void getAllowedRect(LLRect& rect); + + /** + * Sets icon depend on session. + * + * If passed session_id is a group id group icon will be shown, otherwise avatar icon for participant_id + */ + void setIcon(const LLSD& session_id, const LLSD& participant_id); + LLSD mPayload; }; diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml index b9ce11600f..1d67123726 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -43,6 +43,13 @@ left_delta="19" top="35" width="36" /> + + + -- cgit v1.2.3 From e9f9a19eccec8757edd7965bc6ccf6e145d7dd74 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 28 Dec 2009 12:24:47 +0200 Subject: Work on low task EXT-3682 (Dedicated icon is required for AvaLine callers in the VCP) -- improved changes for bug EXT-3684 ("Default" icon is used always for group calls in the voice notifications instead of group icon) to process avaline calls --HG-- branch : product-engine --- indra/newview/llimview.cpp | 23 +++++++++++------------ indra/newview/llimview.h | 3 +++ 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d34bab8c4d..a7ce027416 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1498,7 +1498,10 @@ void LLCallDialog::draw() void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) { - bool is_group = gAgent.isInGroup(session_id); + // *NOTE: 12/28/2009: check avaline calls: LLVoiceClient::isParticipantAvatar returns false for them + bool participant_is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id); + + bool is_group = participant_is_avatar && gAgent.isInGroup(session_id); LLAvatarIconCtrl* avatar_icon = getChild("avatar_icon"); LLGroupIconCtrl* group_icon = getChild("group_icon"); @@ -1510,11 +1513,15 @@ void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) { group_icon->setValue(session_id); } - else + else if (participant_is_avatar) { avatar_icon->setValue(participant_id); } - + else + { + avatar_icon->setValue("Avaline_Icon"); + avatar_icon->setToolTip(std::string("")); + } } bool LLOutgoingCallDialog::lifetimeHasExpired() @@ -1734,15 +1741,7 @@ BOOL LLIncomingCallDialog::postBuild() LLUICtrl* caller_name_widget = getChild("caller name"); caller_name_widget->setValue(caller_name + " " + call_type); - if (is_avatar) - { - setIcon(session_id, caller_id); - } - else - { - LLAvatarIconCtrl* icon = getChild("avatar_icon"); - icon->setValue("Avaline_Icon"); - } + setIcon(session_id, caller_id); childSetAction("Accept", onAccept, this); childSetAction("Reject", onReject, this); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index b0f5f3d813..11860d0efb 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -506,6 +506,9 @@ protected: * Sets icon depend on session. * * If passed session_id is a group id group icon will be shown, otherwise avatar icon for participant_id + * + * @param session_id - UUID of session + * @param participant_id - UUID of other participant */ void setIcon(const LLSD& session_id, const LLSD& participant_id); -- cgit v1.2.3 From 1d7b1329da4e9abf5c73ebc91a27461759fce126 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Sat, 26 Dec 2009 19:19:06 +0200 Subject: Updated chiclet panel's parent min width, see changeset 556d071f6012. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_bottomtray.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 00eba94f47..1ade66f2dd 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -252,7 +252,7 @@ top="0" name="chiclet_list_panel" width="189" - min_width="100" + min_width="110" user_resize="false" auto_resize="true">