From 8ea12297e2e757ad6efbeaebd3ee86c0605ce385 Mon Sep 17 00:00:00 2001 From: angela Date: Mon, 9 Nov 2009 13:34:32 +0800 Subject: escape from infinitive loop of fetching inventory folder with NULL uuid --- indra/newview/llinventorybridge.cpp | 1 + indra/newview/llinventorymodel.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 90e48d22ec..c5903eb5ca 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2127,6 +2127,7 @@ void LLFolderBridge::openItem() lldebugs << "LLFolderBridge::openItem()" << llendl; LLInventoryModel* model = getInventoryModel(); if(!model) return; + if(mUUID.isNull()) return; bool fetching_inventory = model->fetchDescendentsOf(mUUID); // Only change folder type if we have the folder contents. if (!fetching_inventory) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index baf34b42ff..c8b9841e5d 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1267,6 +1267,8 @@ void LLInventoryModel::fetchInventoryResponder::error(U32 status, const std::str bool LLInventoryModel::fetchDescendentsOf(const LLUUID& folder_id) { + if(folder_id.isNull()) return false; + LLViewerInventoryCategory* cat = getCategory(folder_id); if(!cat) { -- cgit v1.2.3 From b72c3f3d08326870e1a3d6444d2dcccb57ec4e3d Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 9 Nov 2009 15:43:50 +0200 Subject: Fixed normal bug EXT-2252 ([BSI] "Set to current location" button on Edit Pick panel has no effect) --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_edit_pick.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml index f4a212ba0a..d6de5af32d 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -53,7 +53,7 @@ layout="topleft" top="0" background_visible="false" - height="470" + height="510" left="0" width="295"> Date: Mon, 9 Nov 2009 15:56:49 +0200 Subject: Fixed windows build for M_PI constant. Macro definitions for common math constants (e.g. M_PI) are declared under the _USE_MATH_DEFINES in math.h Added "#define _USE_MATH_DEFINES" before including math.h (for Windows build only) --HG-- branch : product-engine --- indra/llmath/llinterp.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/llmath/llinterp.h b/indra/llmath/llinterp.h index 8beeef480b..36ca2e9865 100644 --- a/indra/llmath/llinterp.h +++ b/indra/llmath/llinterp.h @@ -32,6 +32,13 @@ #ifndef LL_LLINTERP_H #define LL_LLINTERP_H +#if defined(LL_WINDOWS) +// macro definitions for common math constants (e.g. M_PI) are declared under the _USE_MATH_DEFINES +// on Windows system. +// So, let's define _USE_MATH_DEFINES before including math.h + #define _USE_MATH_DEFINES +#endif + #include "math.h" // Class from which different types of interpolators can be derived -- cgit v1.2.3 From 5561001c926cb0f005d54cb5e9cf4f57d5e0ba15 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 14:24:40 +0000 Subject: randgauss.h isn't *really* used by the viewer - remove #include and move it to llmath with ll-header naming convention. --- indra/llmath/CMakeLists.txt | 1 + indra/newview/CMakeLists.txt | 1 - indra/newview/llvowater.cpp | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 7957c32be2..8ae643099f 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -55,6 +55,7 @@ set(llmath_HEADER_FILES llplane.h llquantize.h llquaternion.h + llrandgauss.h llrect.h llsphere.h lltreenode.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 08e43da9e4..649d86aaa6 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1031,7 +1031,6 @@ set(viewer_HEADER_FILES macmain.h noise.h pipeline.h - randgauss.h VertexCache.h VorbisFramework.h ) diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index e5ff62746e..a8c4625f6e 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -55,8 +55,6 @@ const BOOL gUseRoam = FALSE; /////////////////////////////////// -#include "randgauss.h" - template inline T LERP(T a, T b, F32 factor) { return a + (b - a) * factor; -- cgit v1.2.3 From fbf57b442b7291b354f63f46c3bdfb1b85439866 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 14:26:10 +0000 Subject: ... remove unused llrandgauss.h - because on second thoughts, there's not much wisdom in carrying probably-not-tested-for-years code around 'just in case'. --- indra/llmath/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 8ae643099f..7957c32be2 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -55,7 +55,6 @@ set(llmath_HEADER_FILES llplane.h llquantize.h llquaternion.h - llrandgauss.h llrect.h llsphere.h lltreenode.h -- cgit v1.2.3 From a492b2815a66f41bde0138444d410209b6b615f8 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 9 Nov 2009 14:41:31 +0000 Subject: trivial comment fix while I was there. --- indra/newview/llvoiceclient.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 9df96d9a52..2b61086680 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -196,7 +196,7 @@ static void updatePosition(void); void setEarLocation(S32 loc); void setVoiceVolume(F32 volume); void setMicGain(F32 volume); - void setUserVolume(const LLUUID& id, F32 volume); // set's volume for specified agent, from 0-1 (where .5 is nominal) + void setUserVolume(const LLUUID& id, F32 volume); // sets volume for specified agent, from 0-1 (where .5 is nominal) void setLipSyncEnabled(BOOL enabled); BOOL lipSyncEnabled(); -- cgit v1.2.3 From 60389a85e545575d6ca0abbaa4b5fcadd449793f Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Mon, 9 Nov 2009 16:48:00 +0200 Subject: fixed normal bug EXT-2148 [BSI] Teleport button clickable although friend is offline --HG-- branch : product-engine --- indra/newview/llpanelpeople.cpp | 8 +++++++- indra/newview/llpanelpeople.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b08eb27b9f..f20ffa7559 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -696,6 +696,12 @@ void LLPanelPeople::buttonSetAction(const std::string& btn_name, const commit_si button->setClickedCallback(cb); } +bool LLPanelPeople::isFriendOnline(const LLUUID& id) +{ + LLAvatarList::uuid_vector_t ids = mOnlineFriendList->getIDs(); + return std::find(ids.begin(), ids.end(), id) != ids.end(); +} + void LLPanelPeople::updateButtons() { std::string cur_tab = getActiveTabName(); @@ -746,7 +752,7 @@ void LLPanelPeople::updateButtons() childSetEnabled("add_friend_btn", !is_friend); } - buttonSetEnabled("teleport_btn", friends_tab_active && item_selected); + buttonSetEnabled("teleport_btn", friends_tab_active && item_selected && isFriendOnline(selected_uuids.front())); buttonSetEnabled("view_profile_btn", item_selected); buttonSetEnabled("im_btn", (selected_uuids.size() >= 1)); // allow starting the friends conference for multiple selection buttonSetEnabled("call_btn", item_selected && false); // not implemented yet diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index faed573eca..a369bcd3e2 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -71,6 +71,8 @@ private: void updateNearbyList(); void updateRecentList(); + bool isFriendOnline(const LLUUID& id); + void updateButtons(); std::string getActiveTabName() const; LLUUID getCurrentItemID() const; -- cgit v1.2.3 From 92d3e335dcdf9cff143cf507c79925733254c896 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Mon, 9 Nov 2009 17:44:55 +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 | 225 +++++++++++++++++++++++---------------- indra/newview/llchiclet.h | 88 +++++++++------ indra/newview/llvoicechannel.cpp | 3 + indra/newview/llvoicechannel.h | 7 ++ 4 files changed, 198 insertions(+), 125 deletions(-) diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 53c4bb32ca..9b27ea4728 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -55,6 +55,11 @@ static LLDefaultChildRegistry::Register t2("chiclet_notif static LLDefaultChildRegistry::Register t3("chiclet_im_p2p"); static LLDefaultChildRegistry::Register t4("chiclet_im_group"); +static const LLRect CHICLET_RECT(0, 25, 25, 0); +static const LLRect CHICLET_ICON_RECT(0, 24, 24, 0); +static const LLRect VOICE_INDICATOR_RECT(25, 25, 45, 0); +static const LLRect PANEL_SCROLL_BUTTON_RECT(0, 25, 19, 5); + S32 LLNotificationChiclet::mUreadSystemNotifications = 0; boost::signals2::signalgetRect(); + 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) @@ -300,7 +341,7 @@ LLIMP2PChiclet::Params::Params() , show_speaker("show_speaker") { // *TODO Vadim: Get rid of hardcoded values. - rect(LLRect(0, 25, 25, 0)); + rect(CHICLET_RECT); avatar_icon.name("avatar_icon"); avatar_icon.follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_BOTTOM); @@ -309,11 +350,10 @@ 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(CHICLET_ICON_RECT); avatar_icon.mouse_opaque(false); unread_notifications.name("unread"); - unread_notifications.rect(LLRect(25, 25, 45, 0)); unread_notifications.font(LLFontGL::getFontSansSerif()); unread_notifications.font_halign(LLFontGL::HCENTER); unread_notifications.v_pad(5); @@ -322,7 +362,9 @@ LLIMP2PChiclet::Params::Params() unread_notifications.visible(false); speaker.name("speaker"); - speaker.rect(LLRect(45, 25, 65, 0)); + speaker.rect(VOICE_INDICATOR_RECT); + speaker.auto_update(true); + speaker.draw_border(false); show_speaker = false; } @@ -330,7 +372,6 @@ LLIMP2PChiclet::Params::Params() LLIMP2PChiclet::LLIMP2PChiclet(const Params& p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) -, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletAvatarIconCtrl::Params avatar_params = p.avatar_icon; @@ -358,18 +399,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) @@ -446,18 +478,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(); - } -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -470,7 +490,7 @@ LLAdHocChiclet::Params::Params() , avatar_icon_color("avatar_icon_color", LLColor4::green) { // *TODO Vadim: Get rid of hardcoded values. - rect(LLRect(0, 25, 25, 0)); + rect(CHICLET_RECT); avatar_icon.name("avatar_icon"); avatar_icon.follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_BOTTOM); @@ -479,11 +499,10 @@ LLAdHocChiclet::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(CHICLET_ICON_RECT); avatar_icon.mouse_opaque(false); unread_notifications.name("unread"); - unread_notifications.rect(LLRect(25, 25, 45, 0)); unread_notifications.font(LLFontGL::getFontSansSerif()); unread_notifications.font_halign(LLFontGL::HCENTER); unread_notifications.v_pad(5); @@ -493,7 +512,9 @@ LLAdHocChiclet::Params::Params() speaker.name("speaker"); - speaker.rect(LLRect(45, 25, 65, 0)); + speaker.rect(VOICE_INDICATOR_RECT); + speaker.auto_update(true); + speaker.draw_border(false); show_speaker = false; } @@ -501,7 +522,6 @@ LLAdHocChiclet::Params::Params() LLAdHocChiclet::LLAdHocChiclet(const Params& p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) -, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletAvatarIconCtrl::Params avatar_params = p.avatar_icon; @@ -532,24 +552,40 @@ 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); + switchToCurrentSpeaker(); + 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()) + switchToCurrentSpeaker(); +} + +void LLAdHocChiclet::switchToCurrentSpeaker() +{ + 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) @@ -564,7 +600,7 @@ BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) LLIMGroupChiclet::Params::Params() : group_icon("group_icon") { - rect(LLRect(0, 25, 25, 0)); + rect(CHICLET_RECT); group_icon.name("group_icon"); @@ -572,10 +608,9 @@ LLIMGroupChiclet::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. - group_icon.rect(LLRect(0, 24, 25, 0)); + group_icon.rect(CHICLET_ICON_RECT); unread_notifications.name("unread"); - unread_notifications.rect(LLRect(25, 25, 45, 0)); unread_notifications.font(LLFontGL::getFontSansSerif()); unread_notifications.font_halign(LLFontGL::HCENTER); unread_notifications.v_pad(5); @@ -583,7 +618,9 @@ LLIMGroupChiclet::Params::Params() unread_notifications.visible(false); speaker.name("speaker"); - speaker.rect(LLRect(45, 25, 65, 0)); + speaker.rect(VOICE_INDICATOR_RECT); + speaker.auto_update(true); + speaker.draw_border(false); show_speaker = false; } @@ -592,7 +629,6 @@ LLIMGroupChiclet::LLIMGroupChiclet(const Params& p) : LLIMChiclet(p) , LLGroupMgrObserver(LLUUID::null) , mChicletIconCtrl(NULL) -, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletGroupIconCtrl::Params avatar_params = p.group_icon; @@ -625,18 +661,34 @@ 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()) + switchToCurrentSpeaker(); + LLIMChiclet::draw(); +} + +void LLIMGroupChiclet::initSpeakerControl() +{ + switchToCurrentSpeaker(); +} + +void LLIMGroupChiclet::switchToCurrentSpeaker() +{ + 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 LLIMGroupChiclet::setSessionId(const LLUUID& session_id) @@ -723,17 +775,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(); - } -} ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -755,11 +796,9 @@ LLChicletPanel::Params::Params() min_width = 179 + 3*chiclet_padding; } - LLRect scroll_button_rect(0, 25, 19, 5); - left_scroll_button.name("left_scroll"); left_scroll_button.label(LLStringUtil::null); - left_scroll_button.rect(scroll_button_rect); + left_scroll_button.rect(PANEL_SCROLL_BUTTON_RECT); left_scroll_button.tab_stop(false); left_scroll_button.image_selected(LLUI::getUIImage("bottom_tray_scroll_left.tga")); left_scroll_button.image_unselected(LLUI::getUIImage("bottom_tray_scroll_left.tga")); @@ -767,7 +806,7 @@ LLChicletPanel::Params::Params() right_scroll_button.name("right_scroll"); right_scroll_button.label(LLStringUtil::null); - right_scroll_button.rect(scroll_button_rect); + right_scroll_button.rect(PANEL_SCROLL_BUTTON_RECT); right_scroll_button.tab_stop(false); right_scroll_button.image_selected(LLUI::getUIImage("bottom_tray_scroll_right.tga")); right_scroll_button.image_unselected(LLUI::getUIImage("bottom_tray_scroll_right.tga")); @@ -849,10 +888,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::setCurrentVoiceChannelChangedCallback(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; @@ -896,23 +953,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(); } @@ -1327,6 +1368,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 b50702205c..15c9a0bad8 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -147,13 +147,13 @@ protected: }; /* - * Class for displaying status of Voice Chat + * Class for displaying of speaker's voice indicator */ -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); @@ -514,10 +521,14 @@ protected: */ virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + /* + * Finds a current speaker and resets the SpeakerControl with speaker's ID + */ + /*virtual*/ void switchToCurrentSpeaker(); + private: LLChicletAvatarIconCtrl* mChicletIconCtrl; - LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -547,14 +558,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 +576,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(); @@ -578,6 +591,11 @@ protected: LLIMGroupChiclet(const Params& p); friend class LLUICtrlFactory; + /* + * Finds a current speaker and resets the SpeakerControl with speaker's ID + */ + /*virtual*/ void switchToCurrentSpeaker(); + /* * Creates chiclet popup menu. Will create P2P or Group IM Chat menu * based on other participant's id. @@ -597,7 +615,6 @@ protected: private: LLChicletGroupIconCtrl* mChicletIconCtrl; - LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -735,6 +752,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..89649407ff 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::sCurrentVoiceChannelChangedSignal; BOOL LLVoiceChannel::sSuspended = FALSE; @@ -320,6 +321,8 @@ void LLVoiceChannel::activate() { setState(STATE_CALL_STARTED); } + + sCurrentVoiceChannelChangedSignal(this->mSessionID); } void LLVoiceChannel::getChannelInfo() diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 8f1e9ff02d..20b6157b48 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 sCurrentVoiceChannelChangedSignal; + static boost::signals2::connection setCurrentVoiceChannelChangedCallback(channel_changed_callback_t cb) { return sCurrentVoiceChannelChangedSignal.connect(cb); } + + LLVoiceChannel(const LLUUID& session_id, const std::string& session_name); virtual ~LLVoiceChannel(); -- cgit v1.2.3 From f8a010e4dd136aba5443b68a367fe39bd1b1ba33 Mon Sep 17 00:00:00 2001 From: angela Date: Mon, 9 Nov 2009 23:46:41 +0800 Subject: check for NULL UUID for friendListFolderID --- indra/newview/llfriendcard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index c956657825..1ff2566dca 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -519,7 +519,7 @@ bool LLFriendCardsManager::addFriendCardToInventory(const LLUUID& avatarID) } LLUUID friendListFolderID = findFriendAllSubfolderUUIDImpl(); - if (shouldBeAdded && !invModel->isCategoryComplete(friendListFolderID)) + if (friendListFolderID.notNull() && shouldBeAdded && !invModel->isCategoryComplete(friendListFolderID)) { mFriendsAllFolderCompleted = false; shouldBeAdded = false; -- cgit v1.2.3 From 3c8270c4dd60938c16c6f25110a10f71352156c5 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Mon, 9 Nov 2009 18:32:17 +0200 Subject: Implemented Sub-task 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/llparticipantlist.cpp | 146 +++++++++++++++++++++ indra/newview/llparticipantlist.h | 23 ++++ .../skins/default/xui/en/menu_participant_list.xml | 31 +++++ 3 files changed, 200 insertions(+) create mode 100644 indra/newview/skins/default/xui/en/menu_participant_list.xml diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 2be0781487..21b40e25a0 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -32,14 +32,19 @@ #include "llviewerprecompiledheaders.h" +#include "llmenugl.h" +#include "lluictrlfactory.h" + // common includes #include "lltrans.h" #include "llavataractions.h" #include "llagent.h" +#include "llimview.h" #include "llparticipantlist.h" #include "llavatarlist.h" #include "llspeakers.h" +#include "llviewermenu.h" //LLParticipantList retrieves add, clear and remove events and updates view accordingly #if LL_MSVC @@ -64,6 +69,9 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2)); + mParticipantListMenu = new LLParticipantListMenu(*this); + mAvatarList->setContextMenu(mParticipantListMenu); + //Lets fill avatarList with existing speakers LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs(); @@ -83,6 +91,8 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av LLParticipantList::~LLParticipantList() { + delete mParticipantListMenu; + mParticipantListMenu = NULL; } void LLParticipantList::onAvatarListDoubleClicked(LLAvatarList* list) @@ -265,3 +275,139 @@ bool LLParticipantList::SpeakerModeratorUpdateListener::handleEvent(LLPointercreateFromFile( + "menu_participant_list.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); +} + +void LLParticipantList::LLParticipantListMenu::toggleAllowTextChat(const LLSD& userdata) +{ + const LLUUID speaker_id = mUUIDs.front(); + + std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); + LLSD data; + data["method"] = "mute update"; + data["session-id"] = mParent.mSpeakerMgr->getSessionID(); + data["params"] = LLSD::emptyMap(); + data["params"]["agent_id"] = speaker_id; + data["params"]["mute_info"] = LLSD::emptyMap(); + //current value represents ability to type, so invert + data["params"]["mute_info"]["text"] = !mParent.mSpeakerMgr->findSpeaker(speaker_id)->mModeratorMutedText; + + class MuteTextResponder : public LLHTTPClient::Responder + { + public: + MuteTextResponder(const LLUUID& session_id) + { + mSessionID = session_id; + } + + virtual void error(U32 status, const std::string& reason) + { + llwarns << status << ": " << reason << llendl; + + if ( gIMMgr ) + { + //403 == you're not a mod + //should be disabled if you're not a moderator + if ( 403 == status ) + { + gIMMgr->showSessionEventError( + "mute", + "not_a_moderator", + mSessionID); + } + else + { + gIMMgr->showSessionEventError( + "mute", + "generic", + mSessionID); + } + } + } + + private: + LLUUID mSessionID; + }; + + LLHTTPClient::post( + url, + data, + new MuteTextResponder(mParent.mSpeakerMgr->getSessionID())); +} + +void LLParticipantList::LLParticipantListMenu::toggleMuteText(const LLSD& userdata) +{ + const LLUUID speaker_id = mUUIDs.front(); + BOOL is_muted = LLMuteList::getInstance()->isMuted(speaker_id, LLMute::flagTextChat); + std::string name; + + //fill in name using voice client's copy of name cache + LLPointer speakerp = mParent.mSpeakerMgr->findSpeaker(speaker_id); + if (speakerp.isNull()) + { + return; + } + + name = speakerp->mDisplayName; + + LLMute mute(speaker_id, name, speakerp->mType == LLSpeaker::SPEAKER_AGENT ? LLMute::AGENT : LLMute::OBJECT); + + if (!is_muted) + { + LLMuteList::getInstance()->add(mute, LLMute::flagTextChat); + } + else + { + LLMuteList::getInstance()->remove(mute, LLMute::flagTextChat); + } +} + +bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& userdata) +{ + std::string item = userdata.asString(); + if (item == "can_mute_text") + { + return mUUIDs.front() != gAgentID; + } + else + if (item == "can_allow_text_chat") + { + LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(mParent.mSpeakerMgr->getSessionID()); + return im_session->mType == IM_SESSION_GROUP_START && mParent.mSpeakerMgr->findSpeaker(gAgentID)->mIsModerator; + } + return true; +} + +bool LLParticipantList::LLParticipantListMenu::checkContextMenuItem(const LLSD& userdata) +{ + std::string item = userdata.asString(); + const LLUUID& id = mUUIDs.front(); + if (item == "is_muted") + return LLMuteList::getInstance()->isMuted(id, LLMute::flagTextChat); + else + if (item == "is_allowed_text_chat") + { + LLPointer selected_speakerp = mParent.mSpeakerMgr->findSpeaker(id); + + if (selected_speakerp.notNull()) + { + return !selected_speakerp->mModeratorMutedText; + } + } + return false; +} diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index fc34dd308b..1ff1515d16 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -32,6 +32,8 @@ #include "llviewerprecompiledheaders.h" #include "llevent.h" +#include "llpanelpeoplemenus.h" +#include "llimview.h" class LLSpeakerMgr; class LLAvatarList; @@ -105,6 +107,25 @@ class LLParticipantList SpeakerModeratorUpdateListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; + + /** + * Menu used in the participant list. + */ + class LLParticipantListMenu : public LLPanelPeopleMenus::ContextMenu + { + public: + LLParticipantListMenu(LLParticipantList& parent):mParent(parent){}; + /*virtual*/ LLContextMenu* createMenu(); + protected: + LLParticipantList& mParent; + private: + bool enableContextMenuItem(const LLSD& userdata); + bool checkContextMenuItem(const LLSD& userdata); + + void toggleAllowTextChat(const LLSD& userdata); + void toggleMuteText(const LLSD& userdata); + + }; private: void onAvatarListDoubleClicked(LLAvatarList* list); @@ -121,5 +142,7 @@ class LLParticipantList LLPointer mSpeakerClearListener; LLPointer mSpeakerModeratorListener; + LLParticipantListMenu* mParticipantListMenu; + EParticipantSortOrder mSortOrder; }; diff --git a/indra/newview/skins/default/xui/en/menu_participant_list.xml b/indra/newview/skins/default/xui/en/menu_participant_list.xml new file mode 100644 index 0000000000..802064992e --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + -- cgit v1.2.3 From b56f497098aca38ce8f0023b297dfd7171f8d7f4 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Mon, 9 Nov 2009 18:39:26 +0200 Subject: No ticket. Removed unused includes. Formatted xml. --HG-- branch : product-engine --- indra/newview/llparticipantlist.cpp | 3 --- .../skins/default/xui/en/menu_participant_list.xml | 16 ++++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 21b40e25a0..8155766b49 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -32,9 +32,6 @@ #include "llviewerprecompiledheaders.h" -#include "llmenugl.h" -#include "lluictrlfactory.h" - // common includes #include "lltrans.h" #include "llavataractions.h" diff --git a/indra/newview/skins/default/xui/en/menu_participant_list.xml b/indra/newview/skins/default/xui/en/menu_participant_list.xml index 802064992e..c3283c6014 100644 --- a/indra/newview/skins/default/xui/en/menu_participant_list.xml +++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml @@ -6,12 +6,12 @@ label="Mute Text" layout="topleft" name="MuteText"> - - - + @@ -19,12 +19,12 @@ label="Allow text chat" layout="topleft" name="AllowTextChat"> - - - + -- cgit v1.2.3 From 9c5d1fd3bd9f9cfb20341b9fb7b1046784206432 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Mon, 9 Nov 2009 18:50:55 +0200 Subject: - Reverted fix for normal bug EXT-2016 "Place Profile panel isn't resized". The reason is that some unnecessary free space is left in Place Profile panel. - Cleaned up obsolete code from Place Profile panel. --HG-- branch : product-engine --- indra/newview/llpanelplaceinfo.cpp | 8 +------- indra/newview/llpanelplaceinfo.h | 1 - indra/newview/skins/default/xui/en/panel_place_profile.xml | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 906f8d084b..963d39de8a 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -41,7 +41,6 @@ #include "llsdutil_math.h" #include "lliconctrl.h" -#include "llscrollcontainer.h" #include "lltextbox.h" #include "llagent.h" @@ -58,8 +57,7 @@ LLPanelPlaceInfo::LLPanelPlaceInfo() : LLPanel(), mParcelID(), mRequestedID(), - mPosRegion(), - mMinHeight(0) + mPosRegion() {} //virtual @@ -85,10 +83,6 @@ BOOL LLPanelPlaceInfo::postBuild() mMaturityRatingIcon = getChild("maturity_icon"); mMaturityRatingText = getChild("maturity_value"); - LLScrollContainer* scroll_container = getChild("place_scroll"); - scroll_container->setBorderVisible(FALSE); - mMinHeight = scroll_container->getScrolledViewRect().getHeight(); - return TRUE; } diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index ba32cc4c34..133933a880 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -110,7 +110,6 @@ protected: LLUUID mRequestedID; LLVector3 mPosRegion; std::string mCurrentTitle; - S32 mMinHeight; INFO_TYPE mInfoType; LLTextBox* mTitle; diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml index d3eb548207..b5ae05fe6c 100644 --- a/indra/newview/skins/default/xui/en/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml @@ -172,7 +172,7 @@ width="313"> Date: Tue, 10 Nov 2009 01:04:52 +0800 Subject: fix xml function param problem and adding missing settings in settings.xml --- indra/newview/app_settings/settings.xml | 11 +++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 28 +++++----------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6f6d5fb979..55ff255c38 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3598,6 +3598,17 @@ Value 0 + HideSelectedObjects + + Comment + Hide Selected Objects + Persist + 1 + Type + Boolean + Value + 0 + HtmlHelpLastPage Comment diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 66c9060b06..dbc9601680 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1932,18 +1932,15 @@ function="Advanced.ToggleConsole" parameter="debug" /> - - - - + - - - - + parameter="EnableTextureAtlas" /> + parameter="EnableTextureAtlas" /> Date: Mon, 9 Nov 2009 17:06:49 +0000 Subject: Don't have LLVoiceClient manually poke the nearbychatbar's 'speak' button's visual state as a special case - all speak buttons will soon know how to poll (sigh) the ptt state, with more reliability. --- indra/newview/llnearbychatbar.cpp | 5 ----- indra/newview/llnearbychatbar.h | 1 - indra/newview/llvoiceclient.cpp | 2 -- 3 files changed, 8 deletions(-) diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index bcb4edd7c1..d54545971b 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -695,11 +695,6 @@ LLWString LLNearbyChatBar::stripChannelNumber(const LLWString &mesg, S32* channe } } -void LLNearbyChatBar::setPTTState(bool state) -{ - mSpeakBtn->setSpeakBtnToggleState(state); -} - void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel) { LLMessageSystem* msg = gMessageSystem; diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index aa25b6aa68..56ee706a97 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -96,7 +96,6 @@ public: std::string getCurrentChat(); virtual BOOL handleKeyHere( KEY key, MASK mask ); - void setPTTState(bool state); static void startChat(const char* line); static void stopChat(); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index df5481c874..5e7afe1913 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -5791,7 +5791,6 @@ bool LLVoiceClient::getMuteMic() const void LLVoiceClient::setUserPTTState(bool ptt) { mUserPTTState = ptt; - if (LLNearbyChatBar::instanceExists()) LLNearbyChatBar::getInstance()->setPTTState(ptt); } bool LLVoiceClient::getUserPTTState() @@ -5802,7 +5801,6 @@ bool LLVoiceClient::getUserPTTState() void LLVoiceClient::toggleUserPTTState(void) { mUserPTTState = !mUserPTTState; - if (LLNearbyChatBar::instanceExists()) LLNearbyChatBar::getInstance()->setPTTState(mUserPTTState); } void LLVoiceClient::setVoiceEnabled(bool enabled) -- cgit v1.2.3 From 7e3cc1374795bc43646aecd29a0d4152b750c68e Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Mon, 9 Nov 2009 19:07:15 +0200 Subject: Fixed normal bug EXT-2103 (There are no arrow icons on the Chiclets overflow buttons), but Erica will have to set appropriate icon. --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 55 ++++++---------------- indra/newview/llchiclet.h | 3 -- indra/newview/skins/default/textures/textures.xml | 2 + .../skins/default/xui/en/panel_bottomtray.xml | 27 ++++++++++- 4 files changed, 43 insertions(+), 44 deletions(-) diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 9b27ea4728..0d724e32fb 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -58,7 +58,6 @@ static LLDefaultChildRegistry::Register t4("chiclet_im_group") static const LLRect CHICLET_RECT(0, 25, 25, 0); static const LLRect CHICLET_ICON_RECT(0, 24, 24, 0); static const LLRect VOICE_INDICATOR_RECT(25, 25, 45, 0); -static const LLRect PANEL_SCROLL_BUTTON_RECT(0, 25, 19, 5); S32 LLNotificationChiclet::mUreadSystemNotifications = 0; @@ -783,8 +782,6 @@ void LLIMGroupChiclet::onMenuItemClicked(const LLSD& user_data) LLChicletPanel::Params::Params() : chiclet_padding("chiclet_padding") , scrolling_offset("scrolling_offset") -, left_scroll_button("left_scroll_button") -, right_scroll_button("right_scroll_button") , min_width("min_width") { chiclet_padding = 3; @@ -795,22 +792,6 @@ LLChicletPanel::Params::Params() // min_width = 4 chiclets + 3 paddings min_width = 179 + 3*chiclet_padding; } - - left_scroll_button.name("left_scroll"); - left_scroll_button.label(LLStringUtil::null); - left_scroll_button.rect(PANEL_SCROLL_BUTTON_RECT); - left_scroll_button.tab_stop(false); - left_scroll_button.image_selected(LLUI::getUIImage("bottom_tray_scroll_left.tga")); - left_scroll_button.image_unselected(LLUI::getUIImage("bottom_tray_scroll_left.tga")); - left_scroll_button.image_hover_selected(LLUI::getUIImage("bottom_tray_scroll_left.tga")); - - right_scroll_button.name("right_scroll"); - right_scroll_button.label(LLStringUtil::null); - right_scroll_button.rect(PANEL_SCROLL_BUTTON_RECT); - right_scroll_button.tab_stop(false); - right_scroll_button.image_selected(LLUI::getUIImage("bottom_tray_scroll_right.tga")); - right_scroll_button.image_unselected(LLUI::getUIImage("bottom_tray_scroll_right.tga")); - right_scroll_button.image_hover_selected(LLUI::getUIImage("bottom_tray_scroll_right.tga")); }; LLChicletPanel::LLChicletPanel(const Params&p) @@ -823,23 +804,6 @@ LLChicletPanel::LLChicletPanel(const Params&p) , mMinWidth(p.min_width) , mShowControls(true) { - LLButton::Params scroll_button_params = p.left_scroll_button; - - mLeftScrollButton = LLUICtrlFactory::create(scroll_button_params); - addChild(mLeftScrollButton); - LLTransientFloaterMgr::getInstance()->addControlView(mLeftScrollButton); - - mLeftScrollButton->setClickedCallback(boost::bind(&LLChicletPanel::onLeftScrollClick,this)); - mLeftScrollButton->setEnabled(false); - - scroll_button_params = p.right_scroll_button; - mRightScrollButton = LLUICtrlFactory::create(scroll_button_params); - addChild(mRightScrollButton); - LLTransientFloaterMgr::getInstance()->addControlView(mRightScrollButton); - - mRightScrollButton->setClickedCallback(boost::bind(&LLChicletPanel::onRightScrollClick,this)); - mRightScrollButton->setEnabled(false); - LLPanel::Params panel_params; mScrollArea = LLUICtrlFactory::create(panel_params,this); @@ -890,6 +854,16 @@ BOOL LLChicletPanel::postBuild() LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLChicletPanel::findChiclet, this, _1)); LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLChicletPanel::onCurrentVoiceChannelChanged, this, _1)); + mLeftScrollButton=getChild("chicklet_left_scroll_button"); + LLTransientFloaterMgr::getInstance()->addControlView(mLeftScrollButton); + mLeftScrollButton->setClickedCallback(boost::bind(&LLChicletPanel::onLeftScrollClick,this)); + mLeftScrollButton->setEnabled(false); + + mRightScrollButton=getChild("chicklet_right_scroll_button"); + LLTransientFloaterMgr::getInstance()->addControlView(mRightScrollButton); + mRightScrollButton->setClickedCallback(boost::bind(&LLChicletPanel::onRightScrollClick,this)); + mRightScrollButton->setEnabled(false); + return TRUE; } @@ -1065,23 +1039,24 @@ void LLChicletPanel::reshape(S32 width, S32 height, BOOL called_from_parent ) static const S32 SCROLL_BUTTON_PAD = 5; + //Needed once- to avoid error at first call of reshape() before postBuild() + if(!mLeftScrollButton||!mRightScrollButton) + return; + LLRect scroll_button_rect = mLeftScrollButton->getRect(); mLeftScrollButton->setRect(LLRect(0,height,scroll_button_rect.getWidth(), height - scroll_button_rect.getHeight())); - scroll_button_rect = mRightScrollButton->getRect(); mRightScrollButton->setRect(LLRect(width - scroll_button_rect.getWidth(),height, width, height - scroll_button_rect.getHeight())); - mScrollArea->setRect(LLRect(scroll_button_rect.getWidth() + SCROLL_BUTTON_PAD, height, width - scroll_button_rect.getWidth() - SCROLL_BUTTON_PAD, 0)); - mShowControls = width > mMinWidth; mScrollArea->setVisible(mShowControls); trimChiclets(); - showScrollButtonsIfNeeded(); + } void LLChicletPanel::arrange() diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 15c9a0bad8..97af82fe2f 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -677,9 +677,6 @@ public: Optional chiclet_padding, scrolling_offset; - Optional left_scroll_button, - right_scroll_button; - Optional min_width; Params(); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index fba8e0b06c..0e533b1c0e 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -30,6 +30,8 @@ + + diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index f833e0a1cb..ef91c6cd6e 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -233,7 +233,32 @@ top="0" chiclet_padding="3" scrolling_offset="40" - width="189" /> + width="189"> +