From 01c83aa21e616777adf9e1ab0319f95e656e4f7a Mon Sep 17 00:00:00 2001 From: Denis Serdjuk 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(+) 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(-) 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(-) 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(+) 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(-) 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