From e398f41074f40c0779d7cc29a8127540ac78b1f9 Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Wed, 16 Dec 2009 10:13:54 +0200 Subject: implemented major task EXT-3473 Increase min width of IM Floater (increased by 20%) --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/floater_im_session.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 645c2973d8..a4ade9d0df 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -12,14 +12,14 @@ can_dock="false" can_minimize="false" visible="true" - width="300" + width="360" can_resize="true" - min_width="300" + min_width="360" min_height="350"> + + Date: Wed, 16 Dec 2009 15:06:30 -0800 Subject: Update packager to grok that we're replacing the vivox openal with our own one one linux. --- indra/newview/viewer_manifest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index d6d6aa48d1..2373ebe813 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -823,6 +823,7 @@ class Linux_i686Manifest(LinuxManifest): self.path("libopenjpeg.so.1.3.0", "libopenjpeg.so.1.3") self.path("libalut.so") self.path("libopenal.so", "libopenal.so.1") + self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname try: self.path("libkdu_v42R.so", "libkdu.so") pass @@ -844,7 +845,7 @@ class Linux_i686Manifest(LinuxManifest): if self.prefix(src="vivox-runtime/i686-linux", dst="lib"): self.path("libortp.so") self.path("libsndfile.so.1") - self.path("libvivoxoal.so.1") + #self.path("libvivoxoal.so.1") # no - we'll re-use the viewer's own OAL lib self.path("libvivoxsdk.so") self.path("libvivoxplatform.so") self.end_prefix("lib") -- cgit v1.2.3 From 2757a05bc638a68b108f638d87aa82cafa833eb5 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Wed, 16 Dec 2009 15:15:43 -0800 Subject: Add new library qtxmlpatterns4.dll to dependecies list for the new copy_w_viewer_manifest target (missed in the merge) Reivewed by mani. --- indra/newview/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3ecc35cc8e..8953682fae 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1436,6 +1436,7 @@ if (WINDOWS) ${ARCH_PREBUILT_DIRS_RELEASE}/qtnetwork4.dll ${ARCH_PREBUILT_DIRS_RELEASE}/qtopengl4.dll ${ARCH_PREBUILT_DIRS_RELEASE}/qtwebkit4.dll + ${ARCH_PREBUILT_DIRS_RELEASE}/qtxmlpatterns4.dll ${ARCH_PREBUILT_DIRS_RELEASE}/ssleay32.dll ${ARCH_PREBUILT_DIRS_RELEASE}/imageformats/qgif4.dll ${ARCH_PREBUILT_DIRS_RELEASE}/imageformats/qico4.dll @@ -1449,6 +1450,7 @@ if (WINDOWS) ${ARCH_PREBUILT_DIRS_DEBUG}/qtnetworkd4.dll ${ARCH_PREBUILT_DIRS_DEBUG}/qtopengld4.dll ${ARCH_PREBUILT_DIRS_DEBUG}/qtwebkitd4.dll + ${ARCH_PREBUILT_DIRS_DEBUG}/qtxmlpatternsd4.dll ${ARCH_PREBUILT_DIRS_DEBUG}/ssleay32.dll ${ARCH_PREBUILT_DIRS_DEBUG}/imageformats/qgifd4.dll ${ARCH_PREBUILT_DIRS_DEBUG}/imageformats/qicod4.dll -- cgit v1.2.3 From c9ea0f5097e32d27c3ffe6f5e5cd36cc4283978e Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 16 Dec 2009 15:24:36 -0800 Subject: Slightly update the linux README. --- indra/newview/linux_tools/client-readme.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt index 07a8f951ee..92d321d8c0 100644 --- a/indra/newview/linux_tools/client-readme.txt +++ b/indra/newview/linux_tools/client-readme.txt @@ -55,10 +55,13 @@ Minimum requirements: is required. If you are running a 64-bit Linux distribution then you will need its 32-bit compatibility environment installed, but this configuration is not currently supported. + * PulseAudio or ALSA Linux system sound software. A recent PulseAudio + is the recommended configuration; see README-linux-voice.txt for more + information. * Video/Graphics Card: o nVidia GeForce 2, GeForce 4mx, or better (recommend one of the following: 6700, 6800, 7600, 7800, 7900, 8400, 8500, 8600, - 8800, Go 7400, Go 7600, Go 7800, Go 7900) + 8800, Go 7400, Go 7600, Go 7800, Go 7900, +) o OR ATI Radeon 8500, 9250, or better (nVidia cards are recommended for the Linux client) -- cgit v1.2.3 From d0262fa7ce49a838e9a4530e5de8fe119de64510 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 16 Dec 2009 15:41:08 -0800 Subject: Dial down logging in mediadataclient --- indra/newview/llmediadataclient.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 91064eea6b..2bb2a3da6f 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -224,7 +224,7 @@ bool LLMediaDataClient::processQueueTimer() if(!isEmpty()) { - LL_INFOS("LLMediaDataClient") << "QueueTimer::tick() started, SORTED queue size is: " << mSortedQueue.size() + LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, SORTED queue size is: " << mSortedQueue.size() << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, SORTED queue is: " << mSortedQueue << LL_ENDL; LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, RR queue is: " << mRoundRobinQueue << LL_ENDL; @@ -262,7 +262,7 @@ void LLMediaDataClient::sortQueue() if (size > mMaxSortedQueueSize) { U32 num_to_cull = (size - mMaxSortedQueueSize); - LL_INFOS("LLMediaDataClient") << "sorted queue MAXED OUT! Culling " + LL_INFOS_ONCE("LLMediaDataClient") << "sorted queue MAXED OUT! Culling " << num_to_cull << " items" << LL_ENDL; while (num_to_cull-- > 0) { @@ -309,7 +309,7 @@ void LLMediaDataClient::serviceQueue() { if (request.isNull()) { - LL_INFOS("LLMediaDataClient") << "Skipping NULL request" << LL_ENDL; + LL_WARNS("LLMediaDataClient") << "Skipping NULL request" << LL_ENDL; } else { LL_INFOS("LLMediaDataClient") << "Skipping : " << *request << " " @@ -636,8 +636,8 @@ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason) new RetryTimer(F32(retry_timeout/*secs*/), this); } else { - LL_INFOS("LLMediaDataClient") << *mRequest << " got SERVICE_UNAVAILABLE...retry count " << - mRequest->getRetryCount() << " exceeds " << mRequest->getMaxNumRetries() << ", not retrying" << LL_ENDL; + LL_INFOS("LLMediaDataClient") << *mRequest << " got SERVICE_UNAVAILABLE...retry count " + << mRequest->getRetryCount() << " exceeds " << mRequest->getMaxNumRetries() << ", not retrying" << LL_ENDL; } } else { -- cgit v1.2.3 From c08699f900bf1560f61ea05e44449e90bb02c708 Mon Sep 17 00:00:00 2001 From: Ramzi Linden Date: Wed, 16 Dec 2009 16:27:47 -0800 Subject: L10N: harmless commit to test the Viewer Localization Tool, which has been broken for 46 days. --- indra/newview/skins/default/xui/en/floater_aaa.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index f89ad2f997..6956b73371 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -18,6 +18,7 @@ single_instance="true" width="320"> Nudge 1 + This string is extracted. Date: Thu, 17 Dec 2009 13:00:16 +0200 Subject: Work on EXT-3431 Implement 'mute/unmute everyone else' moderation in the voice control panel -- added comment to test scenario when "Moderator sends the same second request before first response is come" --HG-- branch : product-engine --- indra/newview/llspeakers.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 6e5a867426..3861a96355 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -659,25 +659,27 @@ void LLIMSpeakerMgr::moderateVoiceParticipant(const LLUUID& avatar_id, bool unmu void LLIMSpeakerMgr::moderateVoiceOtherParticipants(const LLUUID& excluded_avatar_id, bool unmute_everyone_else) { - // TODO: mantipov: add more intellectual processing of several following requests + // *TODO: mantipov: add more intellectual processing of several following requests if it is needed. + /* + Such situation should be tested: + "Moderator sends the same second request before first response is come" + Moderator sends "mute everyone else" for A and then for B + two requests to disallow voice chat are sent + UUID of B is stored. + Then first response (to disallow voice chat) is come + request to allow voice for stored avatar (B) + Then second response (to disallow voice chat) is come + have nothing to do, the latest selected speaker is already enabled + + What can happen? + If request to allow voice for stored avatar (B) is processed on server BEFORE + second request to disallow voice chat all speakers will be disabled on voice. + But I'm not sure such situation is possible. + See EXT-3431. + */ mReverseVoiceModeratedAvatarID = excluded_avatar_id; moderateVoiceSession(getSessionID(), !unmute_everyone_else); -/* - LLSpeakerMgr::speaker_list_t speakers; - getSpeakerList(&speakers, FALSE); - - for (LLSpeakerMgr::speaker_list_t::iterator iter = speakers.begin(); - iter != speakers.end(); ++iter) - { - LLSpeaker* speakerp = (*iter).get(); - LLUUID speaker_id = speakerp->mID; - - if (excluded_avatar_id == speaker_id) continue; - - moderateVoiceParticipant(speaker_id, unmute_everyone_else); - } -*/ } void LLIMSpeakerMgr::processSessionUpdate(const LLSD& session_update) -- cgit v1.2.3 From b4bb8428b9072081855a289df95b600a800d4f82 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Thu, 17 Dec 2009 13:26:53 +0200 Subject: fixed bug EXT-3371 Favorites Bar button widths not implemented correctly --HG-- branch : product-engine --- indra/newview/llfavoritesbar.cpp | 338 +++++++++------------ indra/newview/llfavoritesbar.h | 8 +- .../skins/default/xui/en/panel_navigation_bar.xml | 1 + 3 files changed, 155 insertions(+), 192 deletions(-) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 17b0710813..da0a9727a9 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -370,6 +370,7 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) mLandingTab(NULL), mLastTab(NULL), mTabsHighlightEnabled(TRUE) + , mUpdateDropDownItems(true) { // Register callback for menus with current registrar (will be parent panel's registrar) LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Favorites.DoToSelected", @@ -589,16 +590,15 @@ void LLFavoritesBarCtrl::changed(U32 mask) } else { - updateButtons(getRect().getWidth()); + updateButtons(); } } //virtual void LLFavoritesBarCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) { - updateButtons(width); - LLUICtrl::reshape(width, height, called_from_parent); + updateButtons(); } void LLFavoritesBarCtrl::draw() @@ -637,7 +637,7 @@ LLXMLNodePtr LLFavoritesBarCtrl::getButtonXMLNode() return buttonXMLNode; } -void LLFavoritesBarCtrl::updateButtons(U32 bar_width) +void LLFavoritesBarCtrl::updateButtons() { mItems.clear(); @@ -652,139 +652,142 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width) return; } - S32 buttonWidth = 120; //default value - buttonXMLNode->getAttributeS32("width", buttonWidth); - S32 buttonHGap = 2; // default value - buttonXMLNode->getAttributeS32("left", buttonHGap); - - S32 count = mItems.count(); - S32 buttons_space = bar_width - buttonHGap; - - S32 first_drop_down_item = count; - - // Calculating, how much buttons can fit in the bar - S32 buttons_width = 0; - for (S32 i = 0; i < count; ++i) + const child_list_t* childs = getChildList(); + child_list_const_iter_t child_it = childs->begin(); + int first_changed_item_index = 0; + int rightest_point = getRect().mRight - mChevronButton->getRect().getWidth(); + //lets find first changed button + while (child_it != childs->end()) { - buttons_width += buttonWidth + buttonHGap; - if (buttons_width > buttons_space) + LLFavoriteLandmarkButton* button = dynamic_cast (*child_it); + if (button) { - // There is no space for all buttons. - // Calculating the number of buttons, that are fit with chevron button - buttons_space -= mChevronButton->getRect().getWidth() + buttonHGap; - while (i >= 0 && buttons_width > buttons_space) + // an child's order and mItems should be same + if (button->getLandmarkId() != mItems[first_changed_item_index]->getUUID() // sort order has been changed + || button->getLabelSelected() != mItems[first_changed_item_index]->getDisplayName() // favorite's name has been changed + || button->getRect().mRight < rightest_point) // favbar's width has been changed { - buttons_width -= buttonWidth + buttonHGap; - i--; + break; } - first_drop_down_item = i + 1; // First item behind visible items - - break; + first_changed_item_index++; } + child_it++; } + // now first_changed_item_index should contains a number of button that need to change - bool recreate_buttons = true; - - // If inventory items are not changed up to mFirstDropDownItem, no need to recreate them - if (mFirstDropDownItem == first_drop_down_item && (mItemNamesCache.size() == count || mItemNamesCache.size() == mFirstDropDownItem)) + if (first_changed_item_index < mItems.count()) { - S32 i; - for (i = 0; i < mFirstDropDownItem; ++i) + mUpdateDropDownItems = true; + // Rebuild the buttons only + // child_list_t is a linked list, so safe to erase from the middle if we pre-incrament the iterator + + while (child_it != childs->end()) { - if (mItemNamesCache.get(i) != mItems.get(i)->getName()) + //lets remove other landmarks button and rebuild it + child_list_const_iter_t cur_it = child_it++; + LLFavoriteLandmarkButton* button = + dynamic_cast (*cur_it); + if (button) { - break; + removeChild(button); + delete button; } } - if (i == mFirstDropDownItem) + // we have to remove ChevronButton to make sure that the last item will be LandmarkButton to get the right aligning + if (mChevronButton->getParent() == this) { - recreate_buttons = false; + removeChild(mChevronButton); } - } - - if (recreate_buttons) - { - mFirstDropDownItem = first_drop_down_item; - - mItemNamesCache.clear(); - for (S32 i = 0; i < mFirstDropDownItem; i++) + int last_right_edge = 0; + if (getChildList()->size() > 0) { - mItemNamesCache.put(mItems.get(i)->getName()); + last_right_edge = getChildList()->back()->getRect().mRight; } - - // Rebuild the buttons only - // child_list_t is a linked list, so safe to erase from the middle if we pre-incrament the iterator - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ) + //last_right_edge is saving coordinates + LLButton* last_new_button = NULL; + int j = first_changed_item_index; + for (; j < mItems.count(); j++) { - child_list_const_iter_t cur_it = child_it++; - LLView* viewp = *cur_it; - LLButton* button = dynamic_cast(viewp); - if (button && (button != mChevronButton)) + last_new_button = createButton(mItems[j], buttonXMLNode, last_right_edge); + if (!last_new_button) { - removeChild(button); - delete button; + break; } - } - - createButtons(mItems, buttonXMLNode, buttonWidth, buttonHGap); - } + sendChildToBack(last_new_button); + last_right_edge = last_new_button->getRect().mRight; - // Chevron button - if (mFirstDropDownItem != count) - { - // Chevron button should stay right aligned - LLRect rect; - rect.setOriginAndSize(bar_width - mChevronButton->getRect().getWidth() - buttonHGap, 0, mChevronButton->getRect().getWidth(), mChevronButton->getRect().getHeight()); - mChevronButton->setRect(rect); - mChevronButton->setVisible(TRUE); + mLastTab = last_new_button; + } + mFirstDropDownItem = j; + // Chevron button + if (mFirstDropDownItem < mItems.count()) + { + S32 buttonHGap = 2; // default value + buttonXMLNode->getAttributeS32("left", buttonHGap); + LLRect rect; + // Chevron button should stay right aligned + rect.setOriginAndSize(getRect().mRight - mChevronButton->getRect().getWidth() - buttonHGap, 0, + mChevronButton->getRect().getWidth(), + mChevronButton->getRect().getHeight()); + + addChild(mChevronButton); + mChevronButton->setRect(rect); + mChevronButton->setVisible(TRUE); + } } else { - // Hide chevron button if all items are visible on bar - mChevronButton->setVisible(FALSE); + mUpdateDropDownItems = false; } } - -void LLFavoritesBarCtrl::createButtons(const LLInventoryModel::item_array_t &items, const LLXMLNodePtr &buttonXMLNode, S32 buttonWidth, S32 buttonHGap) +LLButton* LLFavoritesBarCtrl::createButton(const LLPointer item, LLXMLNodePtr &buttonXMLNode, S32 x_offset) { - S32 curr_x = buttonHGap; - // Adding buttons + S32 def_button_width = 120; + buttonXMLNode->getAttributeS32("width", def_button_width); + S32 button_x_delta = 2; // default value + buttonXMLNode->getAttributeS32("left", button_x_delta); + S32 curr_x = x_offset; + /** + * WORKAROUND: + * there are some problem with displaying of fonts in buttons. + * Empty space (or ...) is displaying instead of last symbols, even though the width of the button is enough. + * Problem will gone, if we stretch out the button. For that reason I have to put additional 10 pixels. + */ + int requred_width = mFont->getWidth(item->getDisplayName()) + 10; + int width = requred_width > def_button_width? def_button_width : requred_width; LLFavoriteLandmarkButton* fav_btn = NULL; - mLandingTab = mLastTab = NULL; - for(S32 i = mFirstDropDownItem -1, j = 0; i >= 0; i--) + // do we have a place for next button + double buttonHGap + mChevronButton ? + if(curr_x + width + 2*button_x_delta + mChevronButton->getRect().getWidth() > getRect().mRight ) { - LLViewerInventoryItem* item = items.get(j++); - - fav_btn = LLUICtrlFactory::defaultBuilder(buttonXMLNode, this, NULL); - if (NULL == fav_btn) - { - llwarns << "Unable to create button for landmark: " << item->getName() << llendl; - continue; - } - - fav_btn->setLandmarkID(item->getUUID()); - - // change only left and save bottom - fav_btn->setOrigin(curr_x, fav_btn->getRect().mBottom); - fav_btn->setFont(mFont); - fav_btn->setName(item->getName()); - fav_btn->setLabel(item->getName()); - fav_btn->setToolTip(item->getName()); - fav_btn->setCommitCallback(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); - fav_btn->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3,_4 )); - - fav_btn->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4)); - fav_btn->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4)); - - sendChildToBack(fav_btn); - - curr_x += buttonWidth + buttonHGap; + return NULL; } - - mLastTab = fav_btn; + fav_btn = LLUICtrlFactory::defaultBuilder(buttonXMLNode, this, NULL); + if (NULL == fav_btn) + { + llwarns << "Unable to create LLFavoriteLandmarkButton widget: " << item->getName() << llendl; + return NULL; + } + + LLRect butt_rect (fav_btn->getRect()); + fav_btn->setLandmarkID(item->getUUID()); + butt_rect.setOriginAndSize(curr_x + button_x_delta, fav_btn->getRect().mBottom, width, fav_btn->getRect().getHeight()); + + fav_btn->setRect(butt_rect); + // change only left and save bottom + fav_btn->setFont(mFont); + fav_btn->setName(item->getName()); + fav_btn->setLabel(item->getName()); + fav_btn->setToolTip(item->getName()); + fav_btn->setCommitCallback(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); + fav_btn->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3,_4 )); + + fav_btn->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4)); + fav_btn->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4)); + + return fav_btn; } @@ -844,99 +847,61 @@ void LLFavoritesBarCtrl::showDropDownMenu() LLToggleableMenu* menu = (LLToggleableMenu*)mPopupMenuHandle.get(); - if(menu) + if (menu) { if (!menu->toggleVisibility()) return; - mItems.clear(); - - if (!collectFavoriteItems(mItems)) - { - return; - } - - S32 count = mItems.count(); - - // Check it there are changed items, since last call - if (mItemNamesCache.size() == count) - { - S32 i; - for (i = mFirstDropDownItem; i < count; i++) - { - if (mItemNamesCache.get(i) != mItems.get(i)->getName()) - { - break; - } - } - - // Check passed, just show the menu - if (i == count) - { - menu->buildDrawLabels(); - menu->updateParent(LLMenuGL::sMenuContainer); - - if (menu->getButtonRect().isEmpty()) - { - menu->setButtonRect(mChevronButton->getRect(), this); - } - - LLMenuGL::showPopup(this, menu, getRect().getWidth() - menu->getRect().getWidth(), 0); - return; - } - } - - // Add menu items to cache, if there is only names of buttons - if (mItemNamesCache.size() == mFirstDropDownItem) + U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); + if (mUpdateDropDownItems) { - for (S32 i = mFirstDropDownItem; i < count; i++) - { - mItemNamesCache.put(mItems.get(i)->getName()); - } - } - - menu->empty(); + menu->empty(); - U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); - U32 widest_item = 0; + U32 widest_item = 0; - for(S32 i = mFirstDropDownItem; i < count; i++) - { - LLViewerInventoryItem* item = mItems.get(i); - const std::string& item_name = item->getName(); - - LLFavoriteLandmarkMenuItem::Params item_params; - item_params.name(item_name); - item_params.label(item_name); - - item_params.on_click.function(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); - LLFavoriteLandmarkMenuItem *menu_item = LLUICtrlFactory::create(item_params); - menu_item->initFavoritesBarPointer(this); - menu_item->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this,item->getUUID(),_1,_2,_3,_4)); - menu_item->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4)); - menu_item->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4)); - menu_item->setLandmarkID(item->getUUID()); - - // Check whether item name wider than menu - if (menu_item->getNominalWidth() > max_width) + for (S32 i = mFirstDropDownItem; i < mItems.count(); i++) { - S32 chars_total = item_name.length(); - S32 chars_fitted = 1; - menu_item->setLabel(LLStringExplicit("")); - S32 label_space = max_width - menu_item->getFont()->getWidth("...") - - menu_item->getNominalWidth(); // This returns width of menu item with empty label (pad pixels) - - while (chars_fitted < chars_total && menu_item->getFont()->getWidth(item_name, 0, chars_fitted) < label_space) + LLViewerInventoryItem* item = mItems.get(i); + const std::string& item_name = item->getName(); + + LLFavoriteLandmarkMenuItem::Params item_params; + item_params.name(item_name); + item_params.label(item_name); + + item_params.on_click.function(boost::bind( + &LLFavoritesBarCtrl::onButtonClick, this, + item->getUUID())); + LLFavoriteLandmarkMenuItem *menu_item = LLUICtrlFactory::create(item_params); + menu_item->initFavoritesBarPointer(this); + menu_item->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3, _4)); + menu_item->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4)); + menu_item->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4)); + menu_item->setLandmarkID(item->getUUID()); + + // Check whether item name wider than menu + if (menu_item->getNominalWidth() > max_width) { - chars_fitted++; + S32 chars_total = item_name.length(); + S32 chars_fitted = 1; + menu_item->setLabel(LLStringExplicit("")); + S32 label_space = max_width - menu_item->getFont()->getWidth("...") - + menu_item->getNominalWidth();// This returns width of menu item with empty label (pad pixels) + + while (chars_fitted < chars_total + && menu_item->getFont()->getWidth(item_name, 0, chars_fitted) < label_space) + { + chars_fitted++; + } + chars_fitted--; // Rolling back one char, that doesn't fit + + menu_item->setLabel(item_name.substr(0, chars_fitted) + + "..."); } - chars_fitted--; // Rolling back one char, that doesn't fit + widest_item = llmax(widest_item, menu_item->getNominalWidth()); - menu_item->setLabel(item_name.substr(0, chars_fitted) + "..."); + menu->addChild(menu_item); } - widest_item = llmax(widest_item, menu_item->getNominalWidth()); - - menu->addChild(menu_item); + mUpdateDropDownItems = false; } menu->buildDrawLabels(); @@ -945,7 +910,6 @@ void LLFavoritesBarCtrl::showDropDownMenu() menu->setButtonRect(mChevronButton->getRect(), this); LLMenuGL::showPopup(this, menu, getRect().getWidth() - max_width, 0); - } } diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index b2fe3cc651..9ac734baff 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -74,8 +74,8 @@ public: void setLandingTab(LLUICtrl* tab) { mLandingTab = tab; } protected: - void updateButtons(U32 bar_width); - void createButtons(const LLInventoryModel::item_array_t &items, const LLXMLNodePtr &root, S32 buttonWidth, S32 buttonHGap); + void updateButtons(); + LLButton* createButton(const LLPointer item, LLXMLNodePtr &root, S32 x_offset ); LLXMLNodePtr getButtonXMLNode(); BOOL collectFavoriteItems(LLInventoryModel::item_array_t &items); @@ -101,9 +101,7 @@ protected: LLUUID mFavoriteFolderId; const LLFontGL *mFont; S32 mFirstDropDownItem; - - typedef LLDynamicArray item_names_array_t; - item_names_array_t mItemNamesCache; + bool mUpdateDropDownItems; LLUUID mSelectedItemID; diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index e8e4a9dbb2..74265a51ca 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -149,6 +149,7 @@ Date: Thu, 17 Dec 2009 13:53:59 +0200 Subject: fixed normal bug (EXT-3435) All voice notifications should look similar and according to the Voice UI Spec - added new voice notification that replaced notification toasts - now LLOutgoingCallDialog manages visibility of its controls on its own --HG-- branch : product-engine --- indra/newview/llimview.cpp | 117 +++++++++++++-------- indra/newview/llimview.h | 7 +- indra/newview/llvoicechannel.cpp | 5 +- .../skins/default/xui/en/floater_outgoing_call.xml | 26 ++++- 4 files changed, 104 insertions(+), 51 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ad30b844a9..28d9f2170d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -93,7 +93,8 @@ const static std::string ADHOC_NAME_SUFFIX(" Conference"); std::string LLCallDialogManager::sPreviousSessionlName = ""; std::string LLCallDialogManager::sCurrentSessionlName = ""; LLIMModel::LLIMSession* LLCallDialogManager::sSession = NULL; - +LLVoiceChannel::EState LLCallDialogManager::sOldState = LLVoiceChannel::STATE_READY; +const LLUUID LLOutgoingCallDialog::OCD_KEY = LLUUID("7CF78E11-0CFE-498D-ADB9-1417BF03DDB4"); // // Globals // @@ -1280,12 +1281,22 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction) { LLSD mCallDialogPayload; - LLOutgoingCallDialog* ocd; + LLOutgoingCallDialog* ocd = NULL; + + if(sOldState == new_state) + { + return; + } + + sOldState = new_state; mCallDialogPayload["session_id"] = sSession->mSessionID; mCallDialogPayload["session_name"] = sSession->mName; mCallDialogPayload["other_user_id"] = sSession->mOtherParticipantID; mCallDialogPayload["old_channel_name"] = sPreviousSessionlName; + mCallDialogPayload["state"] = new_state; + mCallDialogPayload["disconnected_channel_name"] = sSession->mName; + mCallDialogPayload["session_type"] = sSession->mSessionType; switch(new_state) { @@ -1295,46 +1306,10 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat { return; } - - ocd = dynamic_cast(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); - if (ocd) - { - ocd->getChild("calling")->setVisible(true); - ocd->getChild("leaving")->setVisible(true); - ocd->getChild("connecting")->setVisible(false); - ocd->getChild("noanswer")->setVisible(false); - ocd->getChild("Cancel")->setVisible(true); - } - return; - - case LLVoiceChannel::STATE_RINGING : - ocd = dynamic_cast(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); - if (ocd) - { - ocd->getChild("calling")->setVisible(false); - ocd->getChild("leaving")->setVisible(true); - ocd->getChild("connecting")->setVisible(true); - ocd->getChild("noanswer")->setVisible(false); - ocd->getChild("Cancel")->setVisible(true); - } - return; - - case LLVoiceChannel::STATE_ERROR : - mCallDialogPayload["start_timer"] = true; - ocd = dynamic_cast(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); - if (ocd) - { - ocd->getChild("calling")->setVisible(false); - ocd->getChild("leaving")->setVisible(false); - ocd->getChild("connecting")->setVisible(false); - ocd->getChild("noanswer")->setVisible(true); - ocd->getChild("Cancel")->setVisible(false); - } - return; + break; case LLVoiceChannel::STATE_CONNECTED : - case LLVoiceChannel::STATE_HUNG_UP : - ocd = dynamic_cast(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); + ocd = LLFloaterReg::findTypedInstance("outgoing_call", LLOutgoingCallDialog::OCD_KEY); if (ocd) { ocd->closeFloater(); @@ -1345,6 +1320,11 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat break; } + ocd = LLFloaterReg::getTypedInstance("outgoing_call", LLOutgoingCallDialog::OCD_KEY); + if(ocd) + { + ocd->show(mCallDialogPayload); + } } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1374,12 +1354,13 @@ void LLCallDialog::onOpen(const LLSD& key) LLOutgoingCallDialog::LLOutgoingCallDialog(const LLSD& payload) : LLCallDialog(payload) { - LLOutgoingCallDialog* instance = LLFloaterReg::findTypedInstance("outgoing_call", payload); + LLOutgoingCallDialog* instance = LLFloaterReg::findTypedInstance("outgoing_call", LLOutgoingCallDialog::OCD_KEY); if(instance && instance->getVisible()) { instance->onCancel(instance); } } + void LLOutgoingCallDialog::draw() { if (lifetimeHasExpired()) @@ -1408,10 +1389,14 @@ void LLOutgoingCallDialog::onLifetimeExpired() closeFloater(); } -void LLOutgoingCallDialog::onOpen(const LLSD& key) +void LLOutgoingCallDialog::show(const LLSD& key) { - LLCallDialog::onOpen(key); + mPayload = key; + + // hide all text at first + hideAllText(); + // customize text strings // tell the user which voice channel they are leaving if (!mPayload["old_channel_name"].asString().empty()) { @@ -1422,6 +1407,12 @@ void LLOutgoingCallDialog::onOpen(const LLSD& key) childSetTextArg("leaving", "[CURRENT_CHAT]", getString("localchat")); } + if (!mPayload["disconnected_channel_name"].asString().empty()) + { + childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); + childSetTextArg("nearby_P2P", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); + } + std::string callee_name = mPayload["session_name"].asString(); if (callee_name == "anonymous") { @@ -1438,12 +1429,48 @@ void LLOutgoingCallDialog::onOpen(const LLSD& key) // stop timer by default mLifetimeTimer.stop(); - if(mPayload.has("start_timer")) + + // show only necessary strings and controls + switch(mPayload["state"].asInteger()) { - mLifetimeTimer.reset(); + case LLVoiceChannel::STATE_CALL_STARTED : + getChild("calling")->setVisible(true); + getChild("leaving")->setVisible(true); + break; + case LLVoiceChannel::STATE_RINGING : + getChild("leaving")->setVisible(true); + getChild("connecting")->setVisible(true); + break; + case LLVoiceChannel::STATE_ERROR : + getChild("noanswer")->setVisible(true); + getChild("Cancel")->setVisible(false); + mLifetimeTimer.start(); + break; + case LLVoiceChannel::STATE_HUNG_UP : + if (mPayload["session_type"].asInteger() == LLIMModel::LLIMSession::P2P_SESSION) + { + getChild("nearby_P2P")->setVisible(true); + } + else + { + getChild("nearby")->setVisible(true); + } + getChild("Cancel")->setVisible(false); + mLifetimeTimer.start(); } + + openFloater(LLOutgoingCallDialog::OCD_KEY); } +void LLOutgoingCallDialog::hideAllText() +{ + getChild("calling")->setVisible(false); + getChild("leaving")->setVisible(false); + getChild("connecting")->setVisible(false); + getChild("nearby_P2P")->setVisible(false); + getChild("nearby")->setVisible(false); + getChild("noanswer")->setVisible(false); +} //static void LLOutgoingCallDialog::onCancel(void* user_data) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 6eb3f3d07f..09f0c9df71 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -467,6 +467,7 @@ protected: static std::string sPreviousSessionlName; static std::string sCurrentSessionlName; static LLIMModel::LLIMSession* sSession; + static LLVoiceChannel::EState sOldState; }; class LLCallDialog : public LLDockableFloater @@ -504,14 +505,18 @@ public: LLOutgoingCallDialog(const LLSD& payload); /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); + void show(const LLSD& key); static void onCancel(void* user_data); + static const LLUUID OCD_KEY; // check timer state /*virtual*/ void draw(); private: + + // hide all text boxes + void hideAllText(); // lifetime timer for NO_ANSWER notification LLTimer mLifetimeTimer; // lifetime duration for NO_ANSWER notification diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index fd4e7bb91f..60a2c3b638 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -229,7 +229,6 @@ void LLVoiceChannel::handleStatusChange(EStatusType type) { // if forceably removed from channel // update the UI and revert to default channel - LLNotificationsUtil::add("VoiceChannelDisconnected", mNotifyArgs); deactivate(); } mIgnoreNextSessionLeave = FALSE; @@ -741,6 +740,7 @@ void LLVoiceChannelP2P::handleStatusChange(EStatusType type) case STATUS_LEFT_CHANNEL: if (callStarted() && !mIgnoreNextSessionLeave && !sSuspended) { + // *TODO: use it to show DECLINE voice notification if (mState == STATE_RINGING) { // other user declined call @@ -748,8 +748,7 @@ void LLVoiceChannelP2P::handleStatusChange(EStatusType type) } else { - // other user hung up - LLNotificationsUtil::add("VoiceChannelDisconnectedP2P", mNotifyArgs); + // other user hung up } deactivate(); } diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml index ae4d5042ef..c6bc093c6c 100644 --- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -69,7 +69,29 @@ Calling [CALLEE_NAME] word_wrap="true"> No Answer. Please try again later. - + You have been disconnected from [VOICE_CHANNEL_NAME]. You will now be reconnected to Nearby Voice Chat. + + + [VOICE_CHANNEL_NAME] has ended the call. You will now be reconnected to Nearby Voice Chat. + + Leaving [CURRENT_CHAT]. -