From bc3377c1f6ed295afd7636d907702976adfd846d Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Fri, 6 Nov 2009 14:49:35 +0200 Subject: Partial implementation of EXT-1906 All speakers handling functional in old IM Floaters (Communicate) should be present in new IM Floaters/IM control panels, EXCLUDING voice related mute/moderation stuff --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 31 +++++++++++++++++++-- indra/newview/llimfloater.h | 1 + indra/newview/llimview.cpp | 38 ++++++++++++++++---------- indra/newview/llimview.h | 1 + indra/newview/skins/default/xui/en/strings.xml | 2 ++ 5 files changed, 57 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 85863ed85b..720cea8b1a 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -235,7 +235,7 @@ BOOL LLIMFloater::postBuild() std::string session_name(LLIMModel::instance().getName(mSessionID)); - mInputEditor->setLabel(mInputEditor->getLabel() + " " + session_name); + mInputEditor->setLabel(LLTrans::getString("IM_default_text_label")); LLStringUtil::toUpper(session_name); setTitle(session_name); @@ -498,7 +498,8 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* // Allow enabling the LLIMFloater input editor only if session can accept text LLIMModel::LLIMSession* im_session = LLIMModel::instance().findIMSession(self->mSessionID); - if( im_session && im_session->mTextIMPossible ) + //TODO: While disabled lllineeditor can receive focus we need to check if it is enabled (EK) + if( im_session && im_session->mTextIMPossible && !self->mInputEditor->getEnabled()) { //in disconnected state IM input editor should be disabled self->mInputEditor->setEnabled(!gDisconnected); @@ -588,6 +589,32 @@ void LLIMFloater::processIMTyping(const LLIMInfo* im_info, BOOL typing) } } +void LLIMFloater::processAgentListUpdates(const LLSD& body) +{ + if ( !body.isMap() ) return; + + if ( body.has("agent_updates") && body["agent_updates"].isMap() ) + { + LLSD agent_data = body["agent_updates"].get(gAgentID.asString()); + if (agent_data.isMap() && agent_data.has("info")) + { + LLSD agent_info = agent_data["info"]; + + if (agent_info.has("mutes")) + { + BOOL moderator_muted_text = agent_info["mutes"]["text"].asBoolean(); + mInputEditor->setEnabled(!moderator_muted_text); + std::string label; + if (moderator_muted_text) + label = LLTrans::getString("IM_muted_text_label"); + else + label = LLTrans::getString("IM_default_text_label"); + mInputEditor->setLabel(label); + } + } + } +} + void LLIMFloater::processSessionUpdate(const LLSD& session_update) { // *TODO : verify following code when moderated mode will be implemented diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index f5edb3188a..065441b188 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -90,6 +90,7 @@ public: void onVisibilityChange(const LLSD& new_visibility); void processIMTyping(const LLIMInfo* im_info, BOOL typing); + void processAgentListUpdates(const LLSD& body); void processSessionUpdate(const LLSD& session_update); BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 7e8701bf21..095a18f322 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1848,6 +1848,29 @@ void LLIMMgr::clearPendingInvitation(const LLUUID& session_id) } } +void LLIMMgr::processAgentListUpdates(const LLUUID& session_id, const LLSD& body) +{ + LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); + if ( im_floater ) + { + im_floater->processAgentListUpdates(body); + } + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id); + if (speaker_mgr) + { + speaker_mgr->updateSpeakers(body); + } + else + { + //we don't have a speaker manager yet..something went wrong + //we are probably receiving an update here before + //a start or an acceptance of an invitation. Race condition. + gIMMgr->addPendingAgentListUpdates( + session_id, + body); + } +} + LLSD LLIMMgr::getPendingAgentListUpdates(const LLUUID& session_id) { if ( mPendingAgentListUpdates.has(session_id.asString()) ) @@ -2232,20 +2255,7 @@ public: const LLSD& input) const { const LLUUID& session_id = input["body"]["session_id"].asUUID(); - LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id); - if (speaker_mgr) - { - speaker_mgr->updateSpeakers(input["body"]); - } - else - { - //we don't have a speaker manager yet..something went wrong - //we are probably receiving an update here before - //a start or an acceptance of an invitation. Race condition. - gIMMgr->addPendingAgentListUpdates( - input["body"]["session_id"].asUUID(), - input["body"]); - } + gIMMgr->processAgentListUpdates(session_id, input["body"]); } }; diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index f986d9dcdb..769d49f388 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -315,6 +315,7 @@ public: void clearPendingInvitation(const LLUUID& session_id); + void processAgentListUpdates(const LLUUID& session_id, const LLSD& body); LLSD getPendingAgentListUpdates(const LLUUID& session_id); void addPendingAgentListUpdates( const LLUUID& sessioN_id, diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index ec2673644f..101426ee28 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2845,6 +2845,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. (Unnamed) (Moderated: Voices off by default) Text chat is not available for this call. + Your text chat has been disabled by a Group Moderator. + Click here to instant message. -- cgit v1.2.3 From e4fdc0ba558ec8960796c9663c4a7e2ec92d8916 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Fri, 6 Nov 2009 15:41:05 +0200 Subject: no ticket. major crash in Panel Landmark has been fixed. It was founded while investigating EXT-1607. --HG-- branch : product-engine --- indra/newview/llpanellandmarks.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index c516546282..62dc881738 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -829,17 +829,18 @@ bool LLLandmarksPanel::canSelectedBeModified(const std::string& command_name) co // then ask LLFolderView permissions if (can_be_modified) { + LLFolderViewItem* selected = getCurSelectedItem(); if ("cut" == command_name) { can_be_modified = mCurrentSelectedList->getRootFolder()->canCut(); } else if ("rename" == command_name) { - can_be_modified = getCurSelectedItem()->getListener()->isItemRenameable(); + can_be_modified = selected? selected->getListener()->isItemRenameable() : false; } else if ("delete" == command_name) { - can_be_modified = getCurSelectedItem()->getListener()->isItemRemovable(); + can_be_modified = selected? selected->getListener()->isItemRemovable(): false; } else if("paste" == command_name) { -- cgit v1.2.3 From 0c95cc78e56e9249df223dedd93e708d9f7698ab Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Fri, 6 Nov 2009 15:48:27 +0200 Subject: No ticket fixed dropped functionaliti by prev commit --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 4 ++-- indra/newview/skins/default/xui/en/strings.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 720cea8b1a..83e1a333f7 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -235,7 +235,7 @@ BOOL LLIMFloater::postBuild() std::string session_name(LLIMModel::instance().getName(mSessionID)); - mInputEditor->setLabel(LLTrans::getString("IM_default_text_label")); + mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + session_name); LLStringUtil::toUpper(session_name); setTitle(session_name); @@ -608,7 +608,7 @@ void LLIMFloater::processAgentListUpdates(const LLSD& body) if (moderator_muted_text) label = LLTrans::getString("IM_muted_text_label"); else - label = LLTrans::getString("IM_default_text_label"); + label = LLTrans::getString("IM_to_label") + " " + LLIMModel::instance().getName(mSessionID); mInputEditor->setLabel(label); } } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 101426ee28..b44420238f 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2847,6 +2847,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Text chat is not available for this call. Your text chat has been disabled by a Group Moderator. Click here to instant message. + To -- cgit v1.2.3 From ddb42652e3205a96289ad4ac8031a022cce46c4a Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 6 Nov 2009 15:49:56 +0200 Subject: IM: minor refac., moved floater registation of llviewerfloaterreg --HG-- branch : product-engine --- indra/newview/llimview.cpp | 7 ------- indra/newview/llviewerfloaterreg.cpp | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 095a18f322..4f844ed8c8 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1350,13 +1350,6 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) LLIMMgr::LLIMMgr() : mIMReceived(FALSE) { - static bool registered_dialog = false; - if (!registered_dialog) - { - LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - registered_dialog = true; - } - mPendingInvitations = LLSD::emptyMap(); mPendingAgentListUpdates = LLSD::emptyMap(); } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 9ca2d3f61d..edbac69e1b 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -170,6 +170,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("impanel", "floater_im_session.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); LLInspectAvatarUtil::registerFloater(); -- cgit v1.2.3 From 4b804902229f610156920333dfb18f2f3fabf12b Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Fri, 6 Nov 2009 16:01:11 +0200 Subject: Fixed low bug EXT-2109 (Add moderator label if user is a moderator of a group chat(See old communication floater)) --HG-- branch : product-engine --- indra/newview/llparticipantlist.cpp | 98 ++++++++++++++++++++++++-- indra/newview/llparticipantlist.h | 20 +++++- indra/newview/llspeakers.cpp | 23 ++++++ indra/newview/llspeakers.h | 10 +++ indra/newview/skins/default/xui/en/strings.xml | 1 + 5 files changed, 145 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index edff706fee..94e47318de 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -50,13 +50,16 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mSpeakerAddListener = new SpeakerAddListener(*this); mSpeakerRemoveListener = new SpeakerRemoveListener(*this); mSpeakerClearListener = new SpeakerClearListener(*this); + mSpeakerModeratorListener = new SpeakerModeratorUpdateListener(*this); mSpeakerMgr->addListener(mSpeakerAddListener, "add"); mSpeakerMgr->addListener(mSpeakerRemoveListener, "remove"); mSpeakerMgr->addListener(mSpeakerClearListener, "clear"); + mSpeakerMgr->addListener(mSpeakerModeratorListener, "update_moderator"); mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); + mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2)); //Lets fill avatarList with existing speakers LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs(); @@ -65,7 +68,12 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mSpeakerMgr->getSpeakerList(&speaker_list, true); for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) { - group_members.push_back((*it)->mID); + const LLPointer& speakerp = *it; + group_members.push_back(speakerp->mID); + if ( speakerp->mIsModerator ) + { + mModeratorList.insert(speakerp->mID); + } } sort(); } @@ -84,6 +92,56 @@ void LLParticipantList::onAvatarListDoubleClicked(LLAvatarList* list) LLAvatarActions::startIM(clicked_id); } +void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) +{ + LLAvatarList* list = dynamic_cast(ctrl); + if (list) + { + const std::string moderator_indicator(LLTrans::getString("IM_moderator_label")); + const std::size_t moderator_indicator_len = moderator_indicator.length(); + + // Firstly remove moderators indicator + std::set::const_iterator + moderator_list_it = mModeratorToRemoveList.begin(), + moderator_list_end = mModeratorToRemoveList.end(); + for (;moderator_list_it != moderator_list_end; ++moderator_list_it) + { + LLAvatarListItem* item = dynamic_cast (list->getItemByValue(*moderator_list_it)); + if ( item ) + { + std::string name = item->getAvatarName(); + size_t found = name.find(moderator_indicator); + if (found == std::string::npos) + { + name.erase(found, moderator_indicator_len); + item->setName(name); + } + } + } + + mModeratorToRemoveList.clear(); + + // Add moderators indicator + moderator_list_it = mModeratorList.begin(); + moderator_list_end = mModeratorList.end(); + for (;moderator_list_it != moderator_list_end; ++moderator_list_it) + { + LLAvatarListItem* item = dynamic_cast (list->getItemByValue(*moderator_list_it)); + if ( item ) + { + std::string name = item->getAvatarName(); + size_t found = name.find(moderator_indicator); + if (found == std::string::npos) + { + name += " "; + name += moderator_indicator; + item->setName(name); + } + } + } + } +} + void LLParticipantList::setSortOrder(EParticipantSortOrder order) { if ( mSortOrder != order ) @@ -106,6 +164,8 @@ bool LLParticipantList::onAddItemEvent(LLPointer event, co } group_members.push_back(uu_id); + // Mark AvatarList as dirty one + mAvatarList->setDirty(); sort(); return true; } @@ -130,14 +190,36 @@ bool LLParticipantList::onClearListEvent(LLPointer event, return true; } +bool LLParticipantList::onModeratorUpdateEvent(LLPointer event, const LLSD& userdata) +{ + const LLSD& evt_data = event->getValue(); + if ( evt_data.has("id") && evt_data.has("is_moderator") ) + { + LLUUID id = evt_data["id"]; + bool is_moderator = evt_data["is_moderator"]; + if ( id.notNull() ) + { + if ( is_moderator ) + mModeratorList.insert(id); + else + { + std::set::iterator it = mModeratorList.find (id); + if ( it != mModeratorList.end () ) + { + mModeratorToRemoveList.insert(id); + mModeratorList.erase(id); + } + } + } + } + return true; +} + void LLParticipantList::sort() { if ( !mAvatarList ) return; - // Mark AvatarList as dirty one - mAvatarList->setDirty(); - // TODO: Implement more sorting orders after specs updating (EM) switch ( mSortOrder ) { case E_SORT_BY_NAME : @@ -172,3 +254,11 @@ bool LLParticipantList::SpeakerClearListener::handleEvent(LLPointer event, const LLSD& userdata) +{ + return mParent.onModeratorUpdateEvent(event, userdata); +} diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 8c209c0b20..fc34dd308b 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -35,6 +35,7 @@ class LLSpeakerMgr; class LLAvatarList; +class LLUICtrl; class LLParticipantList { @@ -59,6 +60,7 @@ class LLParticipantList bool onAddItemEvent(LLPointer event, const LLSD& userdata); bool onRemoveItemEvent(LLPointer event, const LLSD& userdata); bool onClearListEvent(LLPointer event, const LLSD& userdata); + bool onModeratorUpdateEvent(LLPointer event, const LLSD& userdata); /** * Sorts the Avatarlist by stored order @@ -97,15 +99,27 @@ class LLParticipantList /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; + class SpeakerModeratorUpdateListener : public BaseSpeakerListner + { + public: + SpeakerModeratorUpdateListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; + private: void onAvatarListDoubleClicked(LLAvatarList* list); + void onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param); LLSpeakerMgr* mSpeakerMgr; LLAvatarList* mAvatarList; - LLPointer mSpeakerAddListener; - LLPointer mSpeakerRemoveListener; - LLPointer mSpeakerClearListener; + std::set mModeratorList; + std::set mModeratorToRemoveList; + + LLPointer mSpeakerAddListener; + LLPointer mSpeakerRemoveListener; + LLPointer mSpeakerClearListener; + LLPointer mSpeakerModeratorListener; EParticipantSortOrder mSortOrder; }; diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 2341fcfc6d..2ed82b7d62 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -87,6 +87,21 @@ void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, c mDisplayName = first + " " + last; } +LLSpeakerUpdateModeratorEvent::LLSpeakerUpdateModeratorEvent(LLSpeaker* source) +: LLEvent(source, "Speaker add moderator event"), + mSpeakerID (source->mID), + mIsModerator (source->mIsModerator) +{ +} + +LLSD LLSpeakerUpdateModeratorEvent::getValue() +{ + LLSD ret; + ret["id"] = mSpeakerID; + ret["is_moderator"] = mIsModerator; + return ret; +} + LLSpeakerTextModerationEvent::LLSpeakerTextModerationEvent(LLSpeaker* source) : LLEvent(source, "Speaker text moderation event") { @@ -437,9 +452,13 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers) if ( speaker_it->second.isMap() ) { + BOOL is_moderator = speakerp->mIsModerator; speakerp->mIsModerator = speaker_it->second["is_moderator"]; speakerp->mModeratorMutedText = speaker_it->second["mutes"]["text"]; + // Fire event only if moderator changed + if ( is_moderator != speakerp->mIsModerator ) + fireEvent(new LLSpeakerUpdateModeratorEvent(speakerp), "update_moderator"); } } } @@ -507,7 +526,11 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) if (agent_info.has("is_moderator")) { + BOOL is_moderator = speakerp->mIsModerator; speakerp->mIsModerator = agent_info["is_moderator"]; + // Fire event only if moderator changed + if ( is_moderator != speakerp->mIsModerator ) + fireEvent(new LLSpeakerUpdateModeratorEvent(speakerp), "update_moderator"); } if (agent_info.has("mutes")) diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index e0f22bff4f..04046a8587 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -84,6 +84,16 @@ public: BOOL mModeratorMutedText; }; +class LLSpeakerUpdateModeratorEvent : public LLOldEvents::LLEvent +{ +public: + LLSpeakerUpdateModeratorEvent(LLSpeaker* source); + /*virtual*/ LLSD getValue(); +private: + const LLUUID& mSpeakerID; + BOOL mIsModerator; +}; + class LLSpeakerTextModerationEvent : public LLOldEvents::LLEvent { public: diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b44420238f..c850dce141 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2848,6 +2848,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Your text chat has been disabled by a Group Moderator. Click here to instant message. To + (Moderator) -- cgit v1.2.3 From 30fe1aa19715076be2cef2f3cf78a79b6343c9ba Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Fri, 6 Nov 2009 17:00:26 +0200 Subject: fixed normal bug EXT-2193 Group Profile, Group Chat bttns and Profile chevron are enabled for None Group --HG-- branch : product-engine --- indra/newview/llgrouplist.cpp | 5 +++++ indra/newview/llpanelpeople.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 2e2b2d5101..010ed23918 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -183,6 +183,11 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL item->childSetVisible("info_btn", false); item->setGroupIconVisible(mShowIcons); + if (id.isNull()) + { + item->childSetVisible("profile_btn", false); + } + addItem(item, id, pos); // setCommentVisible(false); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 65a7b5322b..bb6cdd2f78 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -667,8 +667,10 @@ void LLPanelPeople::updateButtons() buttonSetEnabled("im_btn", (selected_uuids.size() >= 1)); // allow starting the friends conference for multiple selection buttonSetEnabled("call_btn", item_selected && false); // not implemented yet buttonSetEnabled("share_btn", item_selected && false); // not implemented yet - buttonSetEnabled("group_info_btn", item_selected); - buttonSetEnabled("chat_btn", item_selected); + + bool none_group_selected = item_selected && selected_id.isNull(); + buttonSetEnabled("group_info_btn", !none_group_selected); + buttonSetEnabled("chat_btn", !none_group_selected); } std::string LLPanelPeople::getActiveTabName() const -- cgit v1.2.3 From a3830dee59e9014605746b3425e5378b64c584fe Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 6 Nov 2009 17:03:48 +0200 Subject: implement normal subtask EXT-2265 IM unread messages counter should not be increased for system messages (comming from 'Second Life', zero uuid) --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 2 +- indra/newview/llimview.cpp | 4 ++-- indra/newview/llimview.h | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 83e1a333f7..a634a1b0fd 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -115,7 +115,7 @@ void LLIMFloater::onClose(bool app_quitting) /* static */ void LLIMFloater::newIMCallback(const LLSD& data){ - if (data["num_unread"].asInteger() > 0) + if (data["num_unread"].asInteger() > 0 || data["from_id"].asUUID().isNull()) { LLUUID session_id = data["session_id"].asUUID(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4f844ed8c8..ac5bd719e2 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -134,7 +134,6 @@ void LLIMModel::setActiveSessionID(const LLUUID& session_id) LLIMModel::LLIMModel() { addNewMsgCallback(LLIMFloater::newIMCallback); - addNoUnreadMsgsCallback(LLIMFloater::newIMCallback); addNewMsgCallback(toast_callback); } @@ -440,7 +439,8 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co addToHistory(session_id, from, from_id, utf8_text); if (log2file) logToFile(session_id, from, from_id, utf8_text); - session->mNumUnread++; + //we do not count system messages + if (from_id.notNull()) session->mNumUnread++; // notify listeners LLSD arg; diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 769d49f388..bd55bd2c30 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -66,7 +66,10 @@ public: EInstantMessage mType; LLUUID mOtherParticipantID; std::vector mInitialTargetIDs; + + //does NOT include system messages S32 mNumUnread; + std::list mMsgs; LLVoiceChannel* mVoiceChannel; -- cgit v1.2.3 From f6aa7f8c80d3e6fd159cd6252df1baa90701c2de Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 6 Nov 2009 17:25:50 +0200 Subject: implemented normal subtask EXT-2263 IM P2P: avatar name under avatar icon should follow avatar icon and should not overlap it when being resized --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/floater_im_session.xml | 2 +- indra/newview/skins/default/xui/en/panel_im_control_panel.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 70af2f63b6..452d28d4ea 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -15,7 +15,7 @@ width="520" can_resize="true" min_width="350" - min_height="350"> + min_height="369"> Date: Fri, 6 Nov 2009 18:39:00 +0200 Subject: partial fix for minor bug EXT-1607 Trash and Gear buttons are enabled when nothing is selected. Now gear button will disabled when nothing is selected. --HG-- branch : product-engine --- indra/newview/llpanellandmarks.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 62dc881738..9840c91158 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -499,6 +499,7 @@ void LLLandmarksPanel::updateListCommands() // keep Options & Add Landmark buttons always enabled mListCommands->childSetEnabled(ADD_FOLDER_BUTTON_NAME, add_folder_enabled); mListCommands->childSetEnabled(TRASH_BUTTON_NAME, trash_enabled); + mListCommands->childSetEnabled(OPTIONS_BUTTON_NAME,getCurSelectedItem() != NULL); } void LLLandmarksPanel::onActionsButtonClick() -- cgit v1.2.3 From 8a4e36a9bdd94ebd183d1f315aa51c6c52d0abbd Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 6 Nov 2009 19:31:27 +0200 Subject: fixed EXT-2295 "'Group Chat' btn makes chicklet appear only" --HG-- branch : product-engine --- indra/newview/llavataractions.cpp | 11 +++++++++-- indra/newview/llavatariconctrl.cpp | 7 ++++++- indra/newview/llgroupactions.cpp | 7 ++++++- indra/newview/llimview.cpp | 16 ++++++++++++++-- indra/newview/llinventorybridge.cpp | 7 ++++++- indra/newview/llinventorypanel.cpp | 7 ++++++- indra/newview/llnotificationofferhandler.cpp | 4 ++++ indra/newview/llviewermenu.cpp | 7 ++++++- 8 files changed, 57 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 67ffe54b7e..3fc37aa3d5 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -178,7 +178,10 @@ void LLAvatarActions::startIM(const LLUUID& id) std::string name; gCacheName->getFullName(id, name); LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id); - LLIMFloater::show(session_id); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } make_ui_sound("UISndStartIM"); } @@ -191,7 +194,11 @@ void LLAvatarActions::startConference(const std::vector& ids) { id_array.push_back(*it); } - gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], id_array); + LLUUID session_id = gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], id_array); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } make_ui_sound("UISndStartIM"); } diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index b56e8d1ec2..0ee3e78409 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -44,6 +44,7 @@ #include "llcachename.h" #include "llagentdata.h" +#include "llimfloater.h" #define MENU_ITEM_VIEW_PROFILE 0 #define MENU_ITEM_SEND_IM 1 @@ -354,7 +355,11 @@ void LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked(const LLSD& userdata) name.append(" "); name.append(getLastName()); - gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id); + LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } } else if (level == "add") { diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index c46eedbef2..e60bde9fd8 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -43,6 +43,7 @@ #include "llimview.h" // for gIMMgr #include "llsidetray.h" #include "llstatusbar.h" // can_afford_transaction() +#include "llimfloater.h" // // Globals @@ -279,10 +280,14 @@ void LLGroupActions::startChat(const LLUUID& group_id) LLGroupData group_data; if (gAgent.getGroupData(group_id, group_data)) { - gIMMgr->addSession( + LLUUID session_id = gIMMgr->addSession( group_data.mName, IM_SESSION_GROUP_START, group_id); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } make_ui_sound("UISndStartIM"); } else diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 7e8701bf21..6055719233 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1192,10 +1192,14 @@ void LLIncomingCallDialog::processCallResponse(S32 response) } else { - gIMMgr->addSession( + LLUUID session_id = gIMMgr->addSession( mPayload["session_name"].asString(), type, session_id); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } std::string url = gAgent.getRegion()->getCapability( "ChatSessionRequest"); @@ -1279,10 +1283,14 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) } else { - gIMMgr->addSession( + LLUUID session_id = gIMMgr->addSession( payload["session_name"].asString(), type, session_id); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } std::string url = gAgent.getRegion()->getCapability( "ChatSessionRequest"); @@ -1555,6 +1563,10 @@ LLUUID LLIMMgr::addP2PSession(const std::string& name, const std::string& caller_uri) { LLUUID session_id = addSession(name, IM_NOTHING_SPECIAL, other_participant_id); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id); if (speaker_mgr) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b9a25d5dc7..ef61c45d4d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -97,6 +97,7 @@ #include "llfloateropenobject.h" #include "lltrans.h" #include "llappearancemgr.h" +#include "llimfloater.h" using namespace LLOldEvents; @@ -3347,7 +3348,11 @@ void LLCallingCardBridge::performAction(LLFolderView* folder, LLInventoryModel* { std::string callingcard_name; gCacheName->getFullName(item->getCreatorUUID(), callingcard_name); - gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID()); + LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID()); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } } } else if ("lure" == action) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 178e7d0823..80710610d4 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -86,6 +86,7 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llwearablelist.h" +#include "llimfloater.h" static LLDefaultChildRegistry::Register r("inventory_panel"); @@ -800,7 +801,11 @@ bool LLInventoryPanel::beginIMSession() name = llformat("Session %d", session_num++); } - gIMMgr->addSession(name, type, members[0], members); + LLUUID session_id = gIMMgr->addSession(name, type, members[0], members); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } return true; } diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 8e3a44682c..75ef5208e7 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -99,6 +99,10 @@ bool LLOfferHandler::processNotification(const LLSD& notify) session_id = LLIMMgr::instance().addSession( notification->getSubstitutions()["NAME"], IM_NOTHING_SPECIAL, notification->getPayload()["from_id"]); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } } LLIMMgr::instance().addMessage(session_id, LLUUID(), notification->getSubstitutions()["NAME"], diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 300ebf4e24..053a8d19e5 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -210,6 +210,7 @@ #include "lltexlayer.h" #include "llappearancemgr.h" +#include "llimfloater.h" using namespace LLVOAvatarDefines; @@ -6265,9 +6266,13 @@ class LLAvatarSendIM : public view_listener_t //EInstantMessage type = have_agent_callingcard(gLastHitObjectID) // ? IM_SESSION_ADD : IM_SESSION_CARDLESS_START; - gIMMgr->addSession(name, + LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, avatar->getID()); + if (session_id != LLUUID::null) + { + LLIMFloater::show(session_id); + } } return true; } -- cgit v1.2.3 From dae2e04f1930404296f39a39ec91c8cdb95eb733 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Fri, 6 Nov 2009 20:03:03 +0200 Subject: partial implementation for the major task (EXT-989) IM chiclets should expand to show active voice indicator --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 194 +++++++++++++++++++++++---------------- indra/newview/llchiclet.h | 76 ++++++++------- indra/newview/llvoicechannel.cpp | 3 + indra/newview/llvoicechannel.h | 7 ++ 4 files changed, 168 insertions(+), 112 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 6fd7e6b07d..041baf06e7 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -200,7 +200,9 @@ void LLChiclet::setValue(const LLSD& value) LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) : LLChiclet(p) +, mShowSpeaker(false) , mNewMessagesIcon(NULL) +, mSpeakerCtrl(NULL) , mCounterCtrl(NULL) { // initialize an overlay icon for new messages @@ -219,6 +221,40 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) setShowCounter(false); } +void LLIMChiclet::setShowSpeaker(bool show) +{ + bool needs_resize = getShowSpeaker() != show; + if(needs_resize) + { + mShowSpeaker = show; + toggleSpeakerControl(); + onChicletSizeChanged(); + } +} +void LLIMChiclet::initSpeakerControl() +{ + mSpeakerCtrl->setSpeakerId(getOtherParticipantId()); +} + +void LLIMChiclet::toggleSpeakerControl() +{ + LLRect speaker_rect = mSpeakerCtrl->getRect(); + S32 required_width = getRect().getWidth(); + + if(getShowSpeaker()) + { + required_width = required_width + speaker_rect.getWidth(); + initSpeakerControl(); + } + else + { + required_width = required_width - speaker_rect.getWidth(); + } + + reshape(required_width, getRect().getHeight()); + mSpeakerCtrl->setVisible(getShowSpeaker()); +} + void LLIMChiclet::setShowNewMessagesIcon(bool show) { if(mNewMessagesIcon) @@ -310,7 +346,7 @@ LLIMP2PChiclet::Params::Params() // Changed icon height from 25 to 24 to fix ticket EXT-794. // In some cases(after changing UI scale) 25 pixel height icon was // drawn incorrectly, i'm not sure why. - avatar_icon.rect(LLRect(0, 24, 25, 0)); + avatar_icon.rect(LLRect(0, 24, 24, 0)); avatar_icon.mouse_opaque(false); unread_notifications.name("unread"); @@ -323,7 +359,9 @@ LLIMP2PChiclet::Params::Params() unread_notifications.visible(false); speaker.name("speaker"); - speaker.rect(LLRect(45, 25, 65, 0)); + speaker.rect(LLRect(25, 25, 45, 0)); + speaker.auto_update(true); + speaker.draw_border(false); show_speaker = false; } @@ -331,7 +369,6 @@ LLIMP2PChiclet::Params::Params() LLIMP2PChiclet::LLIMP2PChiclet(const Params& p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) -, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletAvatarIconCtrl::Params avatar_params = p.avatar_icon; @@ -359,18 +396,9 @@ void LLIMP2PChiclet::setCounter(S32 counter) setShowNewMessagesIcon(counter); } -LLRect LLIMP2PChiclet::getRequiredRect() +void LLIMP2PChiclet::initSpeakerControl() { - LLRect rect(0, 0, mChicletIconCtrl->getRect().getWidth(), 0); - if(getShowCounter()) - { - rect.mRight += mCounterCtrl->getRequiredRect().getWidth(); - } - if(getShowSpeaker()) - { - rect.mRight += mSpeakerCtrl->getRect().getWidth(); - } - return rect; + mSpeakerCtrl->setSpeakerId(getOtherParticipantId()); } void LLIMP2PChiclet::setOtherParticipantId(const LLUUID& other_participant_id) @@ -447,18 +475,6 @@ void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data) } } -void LLIMP2PChiclet::setShowSpeaker(bool show) -{ - LLIMChiclet::setShowSpeaker(show); - - bool needs_resize = getShowSpeaker() != show; - mSpeakerCtrl->setVisible(getShowSpeaker()); - if(needs_resize) - { - onChicletSizeChanged(); - } -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -494,7 +510,9 @@ LLAdHocChiclet::Params::Params() speaker.name("speaker"); - speaker.rect(LLRect(45, 25, 65, 0)); + speaker.rect(LLRect(25, 25, 45, 0)); + speaker.auto_update(true); + speaker.draw_border(false); show_speaker = false; } @@ -502,7 +520,6 @@ LLAdHocChiclet::Params::Params() LLAdHocChiclet::LLAdHocChiclet(const Params& p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) -, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletAvatarIconCtrl::Params avatar_params = p.avatar_icon; @@ -533,24 +550,35 @@ void LLAdHocChiclet::setSessionId(const LLUUID& session_id) mChicletIconCtrl->setValue(im_session->mOtherParticipantID); } -void LLAdHocChiclet::setCounter(S32 counter) +void LLAdHocChiclet::draw() { - mCounterCtrl->setCounter(counter); - setShowNewMessagesIcon(counter); + initSpeakerControl(); + LLIMChiclet::draw(); } -LLRect LLAdHocChiclet::getRequiredRect() +void LLAdHocChiclet::initSpeakerControl() { - LLRect rect(0, 0, mChicletIconCtrl->getRect().getWidth(), 0); - if(getShowCounter()) - { - rect.mRight += mCounterCtrl->getRequiredRect().getWidth(); - } - if(getShowSpeaker()) + LLUUID speaker_id; + LLSpeakerMgr::speaker_list_t speaker_list; + + LLIMModel::getInstance()->findIMSession(getSessionId())->mSpeakers->getSpeakerList(&speaker_list, FALSE); + for (LLSpeakerMgr::speaker_list_t::iterator i = speaker_list.begin(); i != speaker_list.end(); ++i) { - rect.mRight += mSpeakerCtrl->getRect().getWidth(); + LLPointer s = *i; + if (s->mSpeechVolume > 0 || s->mStatus == LLSpeaker::STATUS_SPEAKING) + { + speaker_id = s->mID; + break; + } } - return rect; + + mSpeakerCtrl->setSpeakerId(speaker_id); +} + +void LLAdHocChiclet::setCounter(S32 counter) +{ + mCounterCtrl->setCounter(counter); + setShowNewMessagesIcon(counter); } BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) @@ -584,7 +612,9 @@ LLIMGroupChiclet::Params::Params() unread_notifications.visible(false); speaker.name("speaker"); - speaker.rect(LLRect(45, 25, 65, 0)); + speaker.rect(LLRect(25, 25, 45, 0)); + speaker.auto_update(true); + speaker.draw_border(false); show_speaker = false; } @@ -593,7 +623,6 @@ LLIMGroupChiclet::LLIMGroupChiclet(const Params& p) : LLIMChiclet(p) , LLGroupMgrObserver(LLUUID::null) , mChicletIconCtrl(NULL) -, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletGroupIconCtrl::Params avatar_params = p.group_icon; @@ -626,18 +655,32 @@ void LLIMGroupChiclet::setCounter(S32 counter) setShowNewMessagesIcon(counter); } -LLRect LLIMGroupChiclet::getRequiredRect() +void LLIMGroupChiclet::draw() { - LLRect rect(0, 0, mChicletIconCtrl->getRect().getWidth(), 0); - if(getShowCounter()) - { - rect.mRight += mCounterCtrl->getRequiredRect().getWidth(); - } - if(getShowSpeaker()) + initSpeakerControl(); + LLIMChiclet::draw(); +} + +void LLIMGroupChiclet::initSpeakerControl() +{ + LLUUID speaker_id; + LLSpeakerMgr* speaker_mgr = NULL; + LLSpeakerMgr::speaker_list_t speaker_list; + + speaker_mgr = LLIMModel::getInstance()->findIMSession(getSessionId())->mSpeakers; + speaker_mgr->update(TRUE); + speaker_mgr->getSpeakerList(&speaker_list, FALSE); + for (LLSpeakerMgr::speaker_list_t::iterator i = speaker_list.begin(); i != speaker_list.end(); ++i) { - rect.mRight += mSpeakerCtrl->getRect().getWidth(); + LLPointer s = *i; + if (s->mSpeechVolume > 0 || s->mStatus == LLSpeaker::STATUS_SPEAKING) + { + speaker_id = s->mID; + break; + } } - return rect; + + mSpeakerCtrl->setSpeakerId(speaker_id); } void LLIMGroupChiclet::setSessionId(const LLUUID& session_id) @@ -724,17 +767,6 @@ void LLIMGroupChiclet::onMenuItemClicked(const LLSD& user_data) } } -void LLIMGroupChiclet::setShowSpeaker(bool show) -{ - LLIMChiclet::setShowSpeaker(show); - - bool needs_resize = getShowSpeaker() != show; - mSpeakerCtrl->setVisible(getShowSpeaker()); - if(needs_resize) - { - onChicletSizeChanged(); - } -} ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -850,10 +882,28 @@ BOOL LLChicletPanel::postBuild() LLIMModel::instance().addNewMsgCallback(boost::bind(im_chiclet_callback, this, _1)); LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(im_chiclet_callback, this, _1)); LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLChicletPanel::findChiclet, this, _1)); + LLVoiceChannel::setOnCurrentVoiceChannelChanged(boost::bind(&LLChicletPanel::onCurrentVoiceChannelChanged, this, _1)); return TRUE; } +void LLChicletPanel::onCurrentVoiceChannelChanged(const LLUUID& session_id) +{ + for(chiclet_list_t::iterator it = mChicletList.begin(); it != mChicletList.end(); ++it) + { + LLIMChiclet* chiclet = dynamic_cast(*it); + if(chiclet) + { + if(chiclet->getSessionId() == session_id) + { + chiclet->setShowSpeaker(true); + continue; + } + chiclet->setShowSpeaker(false); + } + } +} + S32 LLChicletPanel::calcChickletPanleWidth() { S32 res = 0; @@ -897,23 +947,7 @@ bool LLChicletPanel::addChiclet(LLChiclet* chiclet, S32 index) void LLChicletPanel::onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param) { - S32 chiclet_width = ctrl->getRect().getWidth(); - S32 chiclet_new_width = ctrl->getRequiredRect().getWidth(); - - if(chiclet_new_width == chiclet_width) - { - return; - } - - LLRect chiclet_rect = ctrl->getRect(); - chiclet_rect.mRight = chiclet_rect.mLeft + chiclet_new_width; - - ctrl->setRect(chiclet_rect); - - S32 offset = chiclet_new_width - chiclet_width; - S32 index = getChicletIndex(ctrl); - - shiftChiclets(offset, index + 1); + arrange(); trimChiclets(); showScrollButtonsIfNeeded(); } @@ -1452,6 +1486,6 @@ void LLChicletGroupIconCtrl::setValue(const LLSD& value ) ////////////////////////////////////////////////////////////////////////// LLChicletSpeakerCtrl::LLChicletSpeakerCtrl(const Params&p) - : LLIconCtrl(p) + : LLOutputMonitorCtrl(p) { } diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index a830240b7d..21909d2577 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -149,11 +149,11 @@ protected: /* * Class for displaying status of Voice Chat */ -class LLChicletSpeakerCtrl : public LLIconCtrl +class LLChicletSpeakerCtrl : public LLOutputMonitorCtrl { public: - struct Params : public LLInitParam::Block + struct Params : public LLInitParam::Block { Params(){}; }; @@ -266,8 +266,6 @@ private: * Base class for Instant Message chiclets. * IMChiclet displays icon, number of unread messages(optional) * and voice chat status(optional). -* Every chiclet should override LLUICtrl::getRequiredRect and return -* desired width. */ class LLIMChiclet : public LLChiclet { @@ -306,15 +304,25 @@ public: virtual LLUUID getOtherParticipantId() { return mOtherParticipantId; } /* - * Shows/hides voice chat status control. + * Init Speaker Control with speaker's ID */ - virtual void setShowSpeaker(bool show) { mShowSpeaker = show; } + virtual void initSpeakerControl(); + + /* + * set status (Shows/Hide) for voice control. + */ + virtual void setShowSpeaker(bool show); /* * Returns voice chat status control visibility. */ virtual bool getShowSpeaker() {return mShowSpeaker;}; + /* + * Shows/Hides for voice control for a chiclet. + */ + virtual void toggleSpeakerControl(); + /* * Shows/hides overlay icon concerning new unread messages. */ @@ -325,10 +333,7 @@ public: */ virtual bool getShowNewMessagesIcon(); - /* - * Draws border around chiclet. - */ - /*virtual*/ void draw(); + virtual void draw(); /** * Determine whether given ID refers to a group or an IM chat session. @@ -363,6 +368,8 @@ protected: LLIconCtrl* mNewMessagesIcon; LLChicletNotificationCounterCtrl* mCounterCtrl; + LLChicletSpeakerCtrl* mSpeakerCtrl; + /** the id of another participant, either an avatar id or a group id*/ LLUUID mOtherParticipantId; @@ -410,8 +417,6 @@ public: /* virtual */ void setOtherParticipantId(const LLUUID& other_participant_id); - /*virtual*/ void setShowSpeaker(bool show); - /* * Sets number of unread messages. Will update chiclet's width if number text * exceeds size of counter and notify it's parent about size change. @@ -419,15 +424,14 @@ public: /*virtual*/ void setCounter(S32); /* - * Returns number of unread messages. + * Init Speaker Control with speaker's ID */ - /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } + /*virtual*/ void initSpeakerControl(); /* - * Returns rect, required to display chiclet. - * Width is the only valid value. + * Returns number of unread messages. */ - /*virtual*/ LLRect getRequiredRect(); + /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } protected: LLIMP2PChiclet(const Params& p); @@ -457,7 +461,6 @@ protected: private: LLChicletAvatarIconCtrl* mChicletIconCtrl; - LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -495,15 +498,19 @@ public: /*virtual*/ void setCounter(S32); /* - * Returns number of unread messages. + * Keep Speaker Control with actual speaker's ID */ - /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } + /*virtual*/ void draw(); /* - * Returns rect, required to display chiclet. - * Width is the only valid value. + * Init Speaker Control with speaker's ID */ - /*virtual*/ LLRect getRequiredRect(); + /*virtual*/ void initSpeakerControl(); + + /* + * Returns number of unread messages. + */ + /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } protected: LLAdHocChiclet(const Params& p); @@ -517,7 +524,6 @@ protected: private: LLChicletAvatarIconCtrl* mChicletIconCtrl; - LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -547,14 +553,17 @@ public: */ /*virtual*/ void setSessionId(const LLUUID& session_id); + /* + * Keep Speaker Control with actual speaker's ID + */ + /*virtual*/ void draw(); + /** * Callback for LLGroupMgrObserver, we get this when group data is available or changed. * Sets group icon. */ /*virtual*/ void changed(LLGroupChange gc); - /*virtual*/ void setShowSpeaker(bool show); - /* * Sets number of unread messages. Will update chiclet's width if number text * exceeds size of counter and notify it's parent about size change. @@ -562,15 +571,14 @@ public: /*virtual*/ void setCounter(S32); /* - * Returns number of unread messages. + * Init Speaker Control with speaker's ID */ - /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } + /*virtual*/ void initSpeakerControl(); /* - * Returns rect, required to display chiclet. - * Width is the only valid value. + * Returns number of unread messages. */ - /*virtual*/ LLRect getRequiredRect(); + /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } ~LLIMGroupChiclet(); @@ -597,7 +605,6 @@ protected: private: LLChicletGroupIconCtrl* mChicletIconCtrl; - LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -735,6 +742,11 @@ public: /*virtual*/ BOOL postBuild(); + /* + * Handler for the Voice Client's signal. Finds a corresponding chiclet and toggles its SpeakerControl + */ + void onCurrentVoiceChannelChanged(const LLUUID& session_id); + /* * Reshapes controls and rearranges chiclets if needed. */ diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index cefc88ebee..5ab3a2aaf3 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -46,6 +46,7 @@ LLVoiceChannel::voice_channel_map_t LLVoiceChannel::sVoiceChannelMap; LLVoiceChannel::voice_channel_map_uri_t LLVoiceChannel::sVoiceChannelURIMap; LLVoiceChannel* LLVoiceChannel::sCurrentVoiceChannel = NULL; LLVoiceChannel* LLVoiceChannel::sSuspendedVoiceChannel = NULL; +LLVoiceChannel::channel_changed_signal_t LLVoiceChannel::sCurrentVoiceChannelChanged; BOOL LLVoiceChannel::sSuspended = FALSE; @@ -320,6 +321,8 @@ void LLVoiceChannel::activate() { setState(STATE_CALL_STARTED); } + + sCurrentVoiceChannelChanged(this->mSessionID); } void LLVoiceChannel::getChannelInfo() diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 8f1e9ff02d..dfa886c99c 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -54,6 +54,13 @@ public: typedef boost::function state_changed_callback_t; + // on current channel changed signal + typedef boost::function channel_changed_callback_t; + typedef boost::signals2::signal channel_changed_signal_t; + static channel_changed_signal_t sCurrentVoiceChannelChanged; + static boost::signals2::connection setOnCurrentVoiceChannelChanged(channel_changed_callback_t cb) { return sCurrentVoiceChannelChanged.connect(cb); } + + LLVoiceChannel(const LLUUID& session_id, const std::string& session_name); virtual ~LLVoiceChannel(); -- cgit v1.2.3 From a9653b37ec29a1bd4c23efdd1d83df15c8bcccdd Mon Sep 17 00:00:00 2001 From: Sergey Borushevsky Date: Fri, 6 Nov 2009 20:46:50 +0200 Subject: No ticket, added comments to split-by-date code. --HG-- branch : product-engine --- indra/newview/llpanelteleporthistory.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra') diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index a34f029095..58ecfb60c2 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -406,6 +406,7 @@ void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, L if (tab_idx <= tabs_cnt - 4) { + // All tabs, except last three, are tabs for one day, so just push tab_date back by one day tab_date.secondsSinceEpoch(tab_date.secondsSinceEpoch() - seconds_in_day); } else if (tab_idx == tabs_cnt - 3) // 6 day and older, low boundary is 1 month @@ -442,6 +443,7 @@ void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, L } } +// Called to add items, no more, than ADD_LIMIT at time void LLTeleportHistoryPanel::refresh() { if (!mHistoryAccordion) @@ -452,12 +454,16 @@ void LLTeleportHistoryPanel::refresh() const LLTeleportHistoryStorage::slurl_list_t& items = mTeleportHistory->getItems(); + // Setting tab_boundary_date to "now", so date from any item would be earlier, than boundary. + // That leads to call to getNextTab to get right tab_idx in first pass LLDate tab_boundary_date = LLDate::now(); + LLFlatListView* curr_flat_view = NULL; U32 added_items = 0; while (mCurrentItem >= 0) { + // Filtering std::string landmark_title = items[mCurrentItem].mTitle; LLStringUtil::toUpper(landmark_title); @@ -470,10 +476,14 @@ void LLTeleportHistoryPanel::refresh() continue; } + // Checking whether date of item is earlier, than tab_boundary_date. + // In that case, item should be added to another tab const LLDate &date = items[mCurrentItem].mDate; if (date < tab_boundary_date) { + // Getting apropriate tab_idx for this and subsequent items, + // tab_boundary_date would be earliest possible date for this tab S32 tab_idx = 0; getNextTab(date, tab_idx, tab_boundary_date); @@ -580,6 +590,9 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index) void LLTeleportHistoryPanel::showTeleportHistory() { mDirty = true; + + // Starting to add items from last one, in reverse order, + // since TeleportHistory keeps most recent item at the end mCurrentItem = mTeleportHistory->getItems().size() - 1; for (S32 n = mItemContainers.size() - 1; n >= 0; --n) -- cgit v1.2.3 From f716bb1e3afd4c950c379dfa702246979de467e6 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 6 Nov 2009 21:04:04 +0200 Subject: Backed out changeset c3b8509f465a (EXT-989) as causing numerous conflicts. Will reapply the changes later. --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 194 ++++++++++++++++----------------------- indra/newview/llchiclet.h | 76 +++++++-------- indra/newview/llvoicechannel.cpp | 3 - indra/newview/llvoicechannel.h | 7 -- 4 files changed, 112 insertions(+), 168 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 041baf06e7..6fd7e6b07d 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -200,9 +200,7 @@ void LLChiclet::setValue(const LLSD& value) LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) : LLChiclet(p) -, mShowSpeaker(false) , mNewMessagesIcon(NULL) -, mSpeakerCtrl(NULL) , mCounterCtrl(NULL) { // initialize an overlay icon for new messages @@ -221,40 +219,6 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) setShowCounter(false); } -void LLIMChiclet::setShowSpeaker(bool show) -{ - bool needs_resize = getShowSpeaker() != show; - if(needs_resize) - { - mShowSpeaker = show; - toggleSpeakerControl(); - onChicletSizeChanged(); - } -} -void LLIMChiclet::initSpeakerControl() -{ - mSpeakerCtrl->setSpeakerId(getOtherParticipantId()); -} - -void LLIMChiclet::toggleSpeakerControl() -{ - LLRect speaker_rect = mSpeakerCtrl->getRect(); - S32 required_width = getRect().getWidth(); - - if(getShowSpeaker()) - { - required_width = required_width + speaker_rect.getWidth(); - initSpeakerControl(); - } - else - { - required_width = required_width - speaker_rect.getWidth(); - } - - reshape(required_width, getRect().getHeight()); - mSpeakerCtrl->setVisible(getShowSpeaker()); -} - void LLIMChiclet::setShowNewMessagesIcon(bool show) { if(mNewMessagesIcon) @@ -346,7 +310,7 @@ LLIMP2PChiclet::Params::Params() // Changed icon height from 25 to 24 to fix ticket EXT-794. // In some cases(after changing UI scale) 25 pixel height icon was // drawn incorrectly, i'm not sure why. - avatar_icon.rect(LLRect(0, 24, 24, 0)); + avatar_icon.rect(LLRect(0, 24, 25, 0)); avatar_icon.mouse_opaque(false); unread_notifications.name("unread"); @@ -359,9 +323,7 @@ LLIMP2PChiclet::Params::Params() unread_notifications.visible(false); speaker.name("speaker"); - speaker.rect(LLRect(25, 25, 45, 0)); - speaker.auto_update(true); - speaker.draw_border(false); + speaker.rect(LLRect(45, 25, 65, 0)); show_speaker = false; } @@ -369,6 +331,7 @@ LLIMP2PChiclet::Params::Params() LLIMP2PChiclet::LLIMP2PChiclet(const Params& p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) +, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletAvatarIconCtrl::Params avatar_params = p.avatar_icon; @@ -396,9 +359,18 @@ void LLIMP2PChiclet::setCounter(S32 counter) setShowNewMessagesIcon(counter); } -void LLIMP2PChiclet::initSpeakerControl() +LLRect LLIMP2PChiclet::getRequiredRect() { - mSpeakerCtrl->setSpeakerId(getOtherParticipantId()); + LLRect rect(0, 0, mChicletIconCtrl->getRect().getWidth(), 0); + if(getShowCounter()) + { + rect.mRight += mCounterCtrl->getRequiredRect().getWidth(); + } + if(getShowSpeaker()) + { + rect.mRight += mSpeakerCtrl->getRect().getWidth(); + } + return rect; } void LLIMP2PChiclet::setOtherParticipantId(const LLUUID& other_participant_id) @@ -475,6 +447,18 @@ void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data) } } +void LLIMP2PChiclet::setShowSpeaker(bool show) +{ + LLIMChiclet::setShowSpeaker(show); + + bool needs_resize = getShowSpeaker() != show; + mSpeakerCtrl->setVisible(getShowSpeaker()); + if(needs_resize) + { + onChicletSizeChanged(); + } +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -510,9 +494,7 @@ LLAdHocChiclet::Params::Params() speaker.name("speaker"); - speaker.rect(LLRect(25, 25, 45, 0)); - speaker.auto_update(true); - speaker.draw_border(false); + speaker.rect(LLRect(45, 25, 65, 0)); show_speaker = false; } @@ -520,6 +502,7 @@ LLAdHocChiclet::Params::Params() LLAdHocChiclet::LLAdHocChiclet(const Params& p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) +, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletAvatarIconCtrl::Params avatar_params = p.avatar_icon; @@ -550,35 +533,24 @@ void LLAdHocChiclet::setSessionId(const LLUUID& session_id) mChicletIconCtrl->setValue(im_session->mOtherParticipantID); } -void LLAdHocChiclet::draw() +void LLAdHocChiclet::setCounter(S32 counter) { - initSpeakerControl(); - LLIMChiclet::draw(); + mCounterCtrl->setCounter(counter); + setShowNewMessagesIcon(counter); } -void LLAdHocChiclet::initSpeakerControl() +LLRect LLAdHocChiclet::getRequiredRect() { - LLUUID speaker_id; - LLSpeakerMgr::speaker_list_t speaker_list; - - LLIMModel::getInstance()->findIMSession(getSessionId())->mSpeakers->getSpeakerList(&speaker_list, FALSE); - for (LLSpeakerMgr::speaker_list_t::iterator i = speaker_list.begin(); i != speaker_list.end(); ++i) + LLRect rect(0, 0, mChicletIconCtrl->getRect().getWidth(), 0); + if(getShowCounter()) { - LLPointer s = *i; - if (s->mSpeechVolume > 0 || s->mStatus == LLSpeaker::STATUS_SPEAKING) - { - speaker_id = s->mID; - break; - } + rect.mRight += mCounterCtrl->getRequiredRect().getWidth(); } - - mSpeakerCtrl->setSpeakerId(speaker_id); -} - -void LLAdHocChiclet::setCounter(S32 counter) -{ - mCounterCtrl->setCounter(counter); - setShowNewMessagesIcon(counter); + if(getShowSpeaker()) + { + rect.mRight += mSpeakerCtrl->getRect().getWidth(); + } + return rect; } BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) @@ -612,9 +584,7 @@ LLIMGroupChiclet::Params::Params() unread_notifications.visible(false); speaker.name("speaker"); - speaker.rect(LLRect(25, 25, 45, 0)); - speaker.auto_update(true); - speaker.draw_border(false); + speaker.rect(LLRect(45, 25, 65, 0)); show_speaker = false; } @@ -623,6 +593,7 @@ LLIMGroupChiclet::LLIMGroupChiclet(const Params& p) : LLIMChiclet(p) , LLGroupMgrObserver(LLUUID::null) , mChicletIconCtrl(NULL) +, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletGroupIconCtrl::Params avatar_params = p.group_icon; @@ -655,32 +626,18 @@ void LLIMGroupChiclet::setCounter(S32 counter) setShowNewMessagesIcon(counter); } -void LLIMGroupChiclet::draw() +LLRect LLIMGroupChiclet::getRequiredRect() { - initSpeakerControl(); - LLIMChiclet::draw(); -} - -void LLIMGroupChiclet::initSpeakerControl() -{ - LLUUID speaker_id; - LLSpeakerMgr* speaker_mgr = NULL; - LLSpeakerMgr::speaker_list_t speaker_list; - - speaker_mgr = LLIMModel::getInstance()->findIMSession(getSessionId())->mSpeakers; - speaker_mgr->update(TRUE); - speaker_mgr->getSpeakerList(&speaker_list, FALSE); - for (LLSpeakerMgr::speaker_list_t::iterator i = speaker_list.begin(); i != speaker_list.end(); ++i) + LLRect rect(0, 0, mChicletIconCtrl->getRect().getWidth(), 0); + if(getShowCounter()) { - LLPointer s = *i; - if (s->mSpeechVolume > 0 || s->mStatus == LLSpeaker::STATUS_SPEAKING) - { - speaker_id = s->mID; - break; - } + rect.mRight += mCounterCtrl->getRequiredRect().getWidth(); } - - mSpeakerCtrl->setSpeakerId(speaker_id); + if(getShowSpeaker()) + { + rect.mRight += mSpeakerCtrl->getRect().getWidth(); + } + return rect; } void LLIMGroupChiclet::setSessionId(const LLUUID& session_id) @@ -767,6 +724,17 @@ void LLIMGroupChiclet::onMenuItemClicked(const LLSD& user_data) } } +void LLIMGroupChiclet::setShowSpeaker(bool show) +{ + LLIMChiclet::setShowSpeaker(show); + + bool needs_resize = getShowSpeaker() != show; + mSpeakerCtrl->setVisible(getShowSpeaker()); + if(needs_resize) + { + onChicletSizeChanged(); + } +} ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -882,28 +850,10 @@ BOOL LLChicletPanel::postBuild() LLIMModel::instance().addNewMsgCallback(boost::bind(im_chiclet_callback, this, _1)); LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(im_chiclet_callback, this, _1)); LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLChicletPanel::findChiclet, this, _1)); - LLVoiceChannel::setOnCurrentVoiceChannelChanged(boost::bind(&LLChicletPanel::onCurrentVoiceChannelChanged, this, _1)); return TRUE; } -void LLChicletPanel::onCurrentVoiceChannelChanged(const LLUUID& session_id) -{ - for(chiclet_list_t::iterator it = mChicletList.begin(); it != mChicletList.end(); ++it) - { - LLIMChiclet* chiclet = dynamic_cast(*it); - if(chiclet) - { - if(chiclet->getSessionId() == session_id) - { - chiclet->setShowSpeaker(true); - continue; - } - chiclet->setShowSpeaker(false); - } - } -} - S32 LLChicletPanel::calcChickletPanleWidth() { S32 res = 0; @@ -947,7 +897,23 @@ bool LLChicletPanel::addChiclet(LLChiclet* chiclet, S32 index) void LLChicletPanel::onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param) { - arrange(); + S32 chiclet_width = ctrl->getRect().getWidth(); + S32 chiclet_new_width = ctrl->getRequiredRect().getWidth(); + + if(chiclet_new_width == chiclet_width) + { + return; + } + + LLRect chiclet_rect = ctrl->getRect(); + chiclet_rect.mRight = chiclet_rect.mLeft + chiclet_new_width; + + ctrl->setRect(chiclet_rect); + + S32 offset = chiclet_new_width - chiclet_width; + S32 index = getChicletIndex(ctrl); + + shiftChiclets(offset, index + 1); trimChiclets(); showScrollButtonsIfNeeded(); } @@ -1486,6 +1452,6 @@ void LLChicletGroupIconCtrl::setValue(const LLSD& value ) ////////////////////////////////////////////////////////////////////////// LLChicletSpeakerCtrl::LLChicletSpeakerCtrl(const Params&p) - : LLOutputMonitorCtrl(p) + : LLIconCtrl(p) { } diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 21909d2577..a830240b7d 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -149,11 +149,11 @@ protected: /* * Class for displaying status of Voice Chat */ -class LLChicletSpeakerCtrl : public LLOutputMonitorCtrl +class LLChicletSpeakerCtrl : public LLIconCtrl { public: - struct Params : public LLInitParam::Block + struct Params : public LLInitParam::Block { Params(){}; }; @@ -266,6 +266,8 @@ private: * Base class for Instant Message chiclets. * IMChiclet displays icon, number of unread messages(optional) * and voice chat status(optional). +* Every chiclet should override LLUICtrl::getRequiredRect and return +* desired width. */ class LLIMChiclet : public LLChiclet { @@ -304,25 +306,15 @@ public: virtual LLUUID getOtherParticipantId() { return mOtherParticipantId; } /* - * Init Speaker Control with speaker's ID + * Shows/hides voice chat status control. */ - virtual void initSpeakerControl(); - - /* - * set status (Shows/Hide) for voice control. - */ - virtual void setShowSpeaker(bool show); + virtual void setShowSpeaker(bool show) { mShowSpeaker = show; } /* * Returns voice chat status control visibility. */ virtual bool getShowSpeaker() {return mShowSpeaker;}; - /* - * Shows/Hides for voice control for a chiclet. - */ - virtual void toggleSpeakerControl(); - /* * Shows/hides overlay icon concerning new unread messages. */ @@ -333,7 +325,10 @@ public: */ virtual bool getShowNewMessagesIcon(); - virtual void draw(); + /* + * Draws border around chiclet. + */ + /*virtual*/ void draw(); /** * Determine whether given ID refers to a group or an IM chat session. @@ -368,8 +363,6 @@ protected: LLIconCtrl* mNewMessagesIcon; LLChicletNotificationCounterCtrl* mCounterCtrl; - LLChicletSpeakerCtrl* mSpeakerCtrl; - /** the id of another participant, either an avatar id or a group id*/ LLUUID mOtherParticipantId; @@ -417,6 +410,8 @@ public: /* virtual */ void setOtherParticipantId(const LLUUID& other_participant_id); + /*virtual*/ void setShowSpeaker(bool show); + /* * Sets number of unread messages. Will update chiclet's width if number text * exceeds size of counter and notify it's parent about size change. @@ -424,14 +419,15 @@ public: /*virtual*/ void setCounter(S32); /* - * Init Speaker Control with speaker's ID + * Returns number of unread messages. */ - /*virtual*/ void initSpeakerControl(); + /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } /* - * Returns number of unread messages. + * Returns rect, required to display chiclet. + * Width is the only valid value. */ - /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } + /*virtual*/ LLRect getRequiredRect(); protected: LLIMP2PChiclet(const Params& p); @@ -461,6 +457,7 @@ protected: private: LLChicletAvatarIconCtrl* mChicletIconCtrl; + LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -498,19 +495,15 @@ public: /*virtual*/ void setCounter(S32); /* - * Keep Speaker Control with actual speaker's ID - */ - /*virtual*/ void draw(); - - /* - * Init Speaker Control with speaker's ID + * Returns number of unread messages. */ - /*virtual*/ void initSpeakerControl(); + /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } /* - * Returns number of unread messages. + * Returns rect, required to display chiclet. + * Width is the only valid value. */ - /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } + /*virtual*/ LLRect getRequiredRect(); protected: LLAdHocChiclet(const Params& p); @@ -524,6 +517,7 @@ protected: private: LLChicletAvatarIconCtrl* mChicletIconCtrl; + LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -553,17 +547,14 @@ public: */ /*virtual*/ void setSessionId(const LLUUID& session_id); - /* - * Keep Speaker Control with actual speaker's ID - */ - /*virtual*/ void draw(); - /** * Callback for LLGroupMgrObserver, we get this when group data is available or changed. * Sets group icon. */ /*virtual*/ void changed(LLGroupChange gc); + /*virtual*/ void setShowSpeaker(bool show); + /* * Sets number of unread messages. Will update chiclet's width if number text * exceeds size of counter and notify it's parent about size change. @@ -571,14 +562,15 @@ public: /*virtual*/ void setCounter(S32); /* - * Init Speaker Control with speaker's ID + * Returns number of unread messages. */ - /*virtual*/ void initSpeakerControl(); + /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } /* - * Returns number of unread messages. + * Returns rect, required to display chiclet. + * Width is the only valid value. */ - /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } + /*virtual*/ LLRect getRequiredRect(); ~LLIMGroupChiclet(); @@ -605,6 +597,7 @@ protected: private: LLChicletGroupIconCtrl* mChicletIconCtrl; + LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -742,11 +735,6 @@ public: /*virtual*/ BOOL postBuild(); - /* - * Handler for the Voice Client's signal. Finds a corresponding chiclet and toggles its SpeakerControl - */ - void onCurrentVoiceChannelChanged(const LLUUID& session_id); - /* * Reshapes controls and rearranges chiclets if needed. */ diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 5ab3a2aaf3..cefc88ebee 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -46,7 +46,6 @@ LLVoiceChannel::voice_channel_map_t LLVoiceChannel::sVoiceChannelMap; LLVoiceChannel::voice_channel_map_uri_t LLVoiceChannel::sVoiceChannelURIMap; LLVoiceChannel* LLVoiceChannel::sCurrentVoiceChannel = NULL; LLVoiceChannel* LLVoiceChannel::sSuspendedVoiceChannel = NULL; -LLVoiceChannel::channel_changed_signal_t LLVoiceChannel::sCurrentVoiceChannelChanged; BOOL LLVoiceChannel::sSuspended = FALSE; @@ -321,8 +320,6 @@ void LLVoiceChannel::activate() { setState(STATE_CALL_STARTED); } - - sCurrentVoiceChannelChanged(this->mSessionID); } void LLVoiceChannel::getChannelInfo() diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index dfa886c99c..8f1e9ff02d 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -54,13 +54,6 @@ public: typedef boost::function state_changed_callback_t; - // on current channel changed signal - typedef boost::function channel_changed_callback_t; - typedef boost::signals2::signal channel_changed_signal_t; - static channel_changed_signal_t sCurrentVoiceChannelChanged; - static boost::signals2::connection setOnCurrentVoiceChannelChanged(channel_changed_callback_t cb) { return sCurrentVoiceChannelChanged.connect(cb); } - - LLVoiceChannel(const LLUUID& session_id, const std::string& session_name); virtual ~LLVoiceChannel(); -- cgit v1.2.3 From cd9c07258dc0e1e0534f175a6c7248e64673f3e1 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Fri, 6 Nov 2009 21:17:08 +0200 Subject: fixed bug EXT-2111 Unable to edit the Notes & Privacy content --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_notes.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_notes.xml b/indra/newview/skins/default/xui/en/panel_notes.xml index 5333dfa2f5..b9c9100ebc 100644 --- a/indra/newview/skins/default/xui/en/panel_notes.xml +++ b/indra/newview/skins/default/xui/en/panel_notes.xml @@ -17,13 +17,16 @@ left="0" top="0" height="517" + width="313" border_size="0"> + left="0" + height="475" + width="313"> + auto_resize="false" + width="313">