From 8077f1990de23b10d73034c919027d0f220abe48 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 22 Dec 2009 12:22:33 -0500 Subject: Intercept notifications as filter rather than as a peer listener. --- indra/llui/llnotificationslistener.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp index 629964c322..ee6ec0f88f 100644 --- a/indra/llui/llnotificationslistener.cpp +++ b/indra/llui/llnotificationslistener.cpp @@ -188,9 +188,10 @@ public: LLNotificationChannelPtr channelptr(llnotifications.getChannel(channel)); if (channelptr) { - // Try connecting at the front of the 'changed' signal. That way - // we shouldn't get starved by preceding listeners. - channelptr->connectAtFrontChanged(boost::bind(&Forwarder::handle, this, _1)); + // Insert our processing as a "passed filter" listener. This way + // we get to run before all the "changed" listeners, and we get to + // swipe it (hide it from the other listeners) if desired. + channelptr->connectPassedFilter(boost::bind(&Forwarder::handle, this, _1)); } } @@ -251,6 +252,7 @@ bool LLNotificationsListener::Forwarder::handle(const LLSD& notification) const if (notification["sigtype"].asString() == "delete") { LL_INFOS("LLNotificationsListener") << "ignoring delete" << LL_ENDL; + // let other listeners see the "delete" operation return false; } LLNotificationPtr note(mNotifications.find(notification["id"])); @@ -262,6 +264,8 @@ bool LLNotificationsListener::Forwarder::handle(const LLSD& notification) const if (! matchType(mTypes, note->getType())) { LL_INFOS("LLNotificationsListener") << "didn't match types " << mTypes << LL_ENDL; + // We're not supposed to intercept this particular notification. Let + // other listeners process it. return false; } LL_INFOS("LLNotificationsListener") << "sending via '" << mPumpName << "'" << LL_ENDL; @@ -282,7 +286,11 @@ bool LLNotificationsListener::Forwarder::handle(const LLSD& notification) const mNotifications.cancel(note); } } - return false; // let other listeners get same notification + // If we've auto-responded to this notification, then it's going to be + // deleted. Other listeners would get the change operation, try to look it + // up and be baffled by lookup failure. So when we auto-respond, suppress + // this notification: don't pass it to other listeners. + return mRespond; } bool LLNotificationsListener::Forwarder::matchType(const LLSD& filter, const std::string& type) const @@ -314,7 +322,7 @@ bool LLNotificationsListener::Forwarder::matchType(const LLSD& filter, const std LLSD LLNotificationsListener::asLLSD(LLNotificationPtr note) { LLSD notificationInfo(note->asLLSD()); - // For some reason the following aren't included in asLLSD(). + // For some reason the following aren't included in LLNotification::asLLSD(). notificationInfo["summary"] = note->summarize(); notificationInfo["id"] = note->id(); notificationInfo["type"] = note->getType(); -- cgit v1.2.3 From 6f2b14c716f1c91b3631fc6eeae2fd4bf4013e75 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Tue, 22 Dec 2009 11:36:35 -0800 Subject: EXT-3593 Fixed up llkdu and tcmalloc dependencies for the viewer build. --- indra/newview/CMakeLists.txt | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f3d399c616..7d8e9268e5 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1397,12 +1397,29 @@ if (WINDOWS) # be met. I'm looking forward to a source-code split-up project next year that will address this kind of thing. # In the meantime, if you have any ideas on how to easily maintain one list, either here or in viewer_manifest.py # and have the build deps get tracked *please* tell me about it. + + if(LLKDU_LIBRARY) + # Configure a var for llkdu which may not exist for all builds. + set(LLKDU_DLL_SOURCE ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llkdu.dll) + endif(LLKDU_LIBRARY) + + if(USE_GOOGLE_PERFTOOLS) + # Configure a var for tcmalloc location, if used. + # Note the need to specify multiple names explicitly. + set(GOOGLE_PERF_TOOLS_SOURCE + ${SHARED_LIB_STAGING_DIR}/Release/libtcmalloc_minimal.dll + ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libtcmalloc_minimal.dll + ${SHARED_LIB_STAGING_DIR}/Debug/libtcmalloc_minimal-debug.dll + ) + endif(USE_GOOGLE_PERFTOOLS) + + set(COPY_INPUT_DEPENDECIES # The following commented dependencies are determined at variably at build time. Can't do this here. - #llkdu.dll => llkdu.dll #${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libtcmalloc_minimal.dll => None ... Skipping libtcmalloc_minimal.dll ${CMAKE_SOURCE_DIR}/../etc/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg + ${LLKDU_DLL_SOURCE} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapr-1.dll ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libaprutil-1.dll @@ -1426,6 +1443,7 @@ if (WINDOWS) ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/zlib1.dll ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxplatform.dll ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxoal.dll + ${GOOGLE_PERF_TOOLS_SOURCE} ${CMAKE_CURRENT_SOURCE_DIR}/licenses-win32.txt ${CMAKE_CURRENT_SOURCE_DIR}/featuretable.txt ${CMAKE_CURRENT_SOURCE_DIR}/dbghelp.dll @@ -1501,7 +1519,7 @@ if (WINDOWS) if(LLKDU_LIBRARY) # kdu may not exist! - add_dependencies(${VIEWER_BINARY_NAME} llkdu) + add_dependencies(copy_w_viewer_manifest llkdu) endif(LLKDU_LIBRARY) if (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts) -- cgit v1.2.3 From 8f8e5c850a0574f30f9be1e3164531751139d2c5 Mon Sep 17 00:00:00 2001 From: Palmer Truelson Date: Tue, 22 Dec 2009 14:06:25 -0600 Subject: EXT-3640 We support the eaglelake chipset No code changed --- indra/newview/gpu_table.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 5c5c4e5b3c..cc8f6780e3 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -157,7 +157,7 @@ Intel Bear Lake .*Intel.*Bear Lake.* 0 0 Intel Broadwater .*Intel.*Broadwater.* 0 0 Intel Brookdale .*Intel.*Brookdale.* 0 0 Intel Cantiga .*Intel.*Cantiga.* 0 0 -Intel Eaglelake .*Intel.*Eaglelake.* 0 0 +Intel Eaglelake .*Intel.*Eaglelake.* 0 1 Intel Montara .*Intel.*Montara.* 0 0 Intel Springdale .*Intel.*Springdale.* 0 0 Matrox .*Matrox.* 0 0 -- cgit v1.2.3 From 5a1e07002a8851e9227cf85171c1af497c94f0cf Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 22 Dec 2009 19:17:14 -0500 Subject: Add lleventhost queries to list LLEventAPIs or describe one. Add LLEventDispatcher::getDispatchKey() to retrieve a previously- inaccessible value. --- indra/llcommon/lleventdispatcher.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/llcommon/lleventdispatcher.h b/indra/llcommon/lleventdispatcher.h index c8c4fe0c3c..1e625bcee8 100644 --- a/indra/llcommon/lleventdispatcher.h +++ b/indra/llcommon/lleventdispatcher.h @@ -139,6 +139,9 @@ public: /// Get information about a specific Callable LLSD getMetadata(const std::string& name) const; + /// Retrieve the LLSD key we use for one-arg operator() method + std::string getDispatchKey() const { return mKey; } + private: template void addMethod(const std::string& name, const std::string& desc, -- cgit v1.2.3 From 3e8e3b85d9d84ef2386bb36beed4ade677c5a5e1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 22 Dec 2009 16:47:50 -0800 Subject: DEV-44607 ugly/broken font used for region labels in world map view --- indra/newview/llworldmapview.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index e6857ea780..1940d65ae4 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -334,7 +334,6 @@ void LLWorldMapView::draw() gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.setColorMask(true, true); -#if 1 // Draw the image tiles drawMipmap(width, height); gGL.flush(); @@ -452,7 +451,7 @@ void LLWorldMapView::draw() // Draw the region name in the lower left corner if (sMapScale >= DRAW_TEXT_THRESHOLD) { - LLFontGL* font = LLFontGL::getFontSansSerifSmall(); + LLFontGL* font = LLFontGL::getFont(LLFontDescriptor("SansSerif", "Small", LLFontGL::BOLD)); std::string mesg; if (info->isDown()) { @@ -468,14 +467,13 @@ void LLWorldMapView::draw() mesg, 0, llfloor(left + 3), llfloor(bottom + 2), LLColor4::white, - LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); + LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); } } } - #endif - #if 1 + // Draw background rectangle LLGLSUIDefault gls_ui; { @@ -566,7 +564,7 @@ void LLWorldMapView::draw() drawTracking( LLWorldMap::getInstance()->getTrackedPositionGlobal(), loading_color, TRUE, getString("Loading"), ""); } } - #endif + // turn off the scissor LLGLDisable no_scissor(GL_SCISSOR_TEST); -- cgit v1.2.3 From 0521baf33951965dfcd5aa6d80ba7624dbadbc19 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 23 Dec 2009 14:08:22 +0200 Subject: Fix for normal bug EXT-3626 - 'Online' accordion doesn't appear after online avatar is added to friends. --HG-- branch : product-engine --- indra/newview/llpanelpeople.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e5846c7318..374af5c059 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -984,6 +984,8 @@ void LLPanelPeople::onTabSelected(const LLSD& param) mNearbyListUpdater->setActive(tab_name == NEARBY_TAB_NAME); updateButtons(); + showFriendsAccordionsIfNeeded(); + if (GROUP_TAB_NAME == tab_name) mFilterEditor->setLabel(getString("groups_filter_label")); else -- cgit v1.2.3 From d07fd64b6fc3f4c6af648ec43b84cd82c7e62fc6 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 23 Dec 2009 14:40:52 +0200 Subject: finished EXT-1912 Add handling restrictions of PSTN P2P calls in new IM Floaters chiclets for avaline calls are not spawned anymore --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 6 ++++++ indra/newview/llimview.cpp | 11 +++++++++++ indra/newview/llimview.h | 2 ++ indra/newview/llsyswellwindow.cpp | 8 ++++++-- 4 files changed, 25 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 4d5d416907..976b312509 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -148,6 +148,12 @@ void LLBottomTray::sessionAdded(const LLUUID& session_id, const std::string& nam { if (!getChicletPanel()) return; + LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); + if (!session) return; + + // no need to spawn chiclets for participants in P2P calls called through Avaline + if (session->isP2P() && session->isOtherParticipantAvaline()) return; + if (getChicletPanel()->findChiclet(session_id)) return; LLIMChiclet* chiclet = createIMChiclet(session_id); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d209060b58..3345f7d0bf 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -483,6 +483,17 @@ bool LLIMModel::LLIMSession::isAdHoc() return IM_SESSION_CONFERENCE_START == mType || (IM_SESSION_INVITE == mType && !gAgent.isInGroup(mSessionID)); } +bool LLIMModel::LLIMSession::isP2P() +{ + return IM_NOTHING_SPECIAL == mType; +} + +bool LLIMModel::LLIMSession::isOtherParticipantAvaline() +{ + return !mOtherParticipantIsAvatar; +} + + void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, const LLUUID& new_session_id) { LLIMSession* session = findIMSession(old_session_id); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 3f46b0d754..92caf0af9a 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -75,6 +75,8 @@ public: static void chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& msg, void* userdata); bool isAdHoc(); + bool isP2P(); + bool isOtherParticipantAvaline(); LLUUID mSessionID; std::string mName; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 8c6ea59407..3cddf6d902 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -743,9 +743,13 @@ BOOL LLIMWellWindow::postBuild() void LLIMWellWindow::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { - if (mMessageList->getItemByValue(session_id)) return; + LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); + if (!session) return; + + // no need to spawn chiclets for participants in P2P calls called through Avaline + if (session->isP2P() && session->isOtherParticipantAvaline()) return; - if (!gIMMgr->hasSession(session_id)) return; + if (mMessageList->getItemByValue(session_id)) return; addIMRow(session_id, 0, name, other_participant_id); reshapeWindow(); -- cgit v1.2.3 From 4cea2cac115f47e3699f1528f92ce3adcf76d87a Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 23 Dec 2009 16:35:45 +0200 Subject: fixed EXT-3635 States of Call/Leave Call buttons are not properly managed when starting call using Call button in people panels --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 9 ++++++++- indra/newview/llpanelimcontrolpanel.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 3f309b3bf5..a8a75a1feb 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -65,7 +65,11 @@ void LLPanelChatControlPanel::onOpenVoiceControlsClicked() void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) { - bool is_call_started = ( new_state >= LLVoiceChannel::STATE_CALL_STARTED ); + updateButtons(new_state >= LLVoiceChannel::STATE_CALL_STARTED); +} + +void LLPanelChatControlPanel::updateButtons(bool is_call_started) +{ childSetVisible("end_call_btn", is_call_started); childSetVisible("voice_ctrls_btn", is_call_started); childSetVisible("call_btn", ! is_call_started); @@ -112,6 +116,9 @@ void LLPanelChatControlPanel::setSessionId(const LLUUID& session_id) if(voice_channel) { mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2)); + + //call (either p2p, group or ad-hoc) can be already in started state + updateButtons(voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED); } } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 711340efc7..c18be5a6df 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -57,6 +57,8 @@ public: virtual void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); + void updateButtons(bool is_call_started); + virtual void setSessionId(const LLUUID& session_id); const LLUUID& getSessionId() { return mSessionId; } -- cgit v1.2.3 From 6c48bb9f2df743eb85a91da040d33f0816721aa3 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Wed, 23 Dec 2009 16:51:21 +0200 Subject: =?UTF-8?q?fixed=20EXT-3425=20=E2=80=9CUndocked=20floaters=20focus?= =?UTF-8?q?=20issue=E2=80=9D,=20made=20focus=20be=20passed=20to=20game=20a?= =?UTF-8?q?rea=20in=20case=20floater=20can't=20hold=20focus;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/llui/llfloater.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d7a692ec9b..845203b420 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2148,6 +2148,11 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus) if (give_focus && !gFocusMgr.childHasKeyboardFocus(child)) { child->setFocus(TRUE); + // floater did not take focus, so relinquish focus to world + if (!child->hasFocus()) + { + gFocusMgr.setKeyboardFocus(NULL); + } } } -- cgit v1.2.3 From 170719096ae6f249e7ac0ab7ad368cbaf24115f5 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 23 Dec 2009 17:01:02 +0200 Subject: Fixed low bug EXT-3007 (Viewer stalls while resetting filter in teleport history) --HG-- branch : product-engine --- indra/llui/llflatlistview.cpp | 88 +++++++++++- indra/llui/llflatlistview.h | 11 +- indra/newview/llpanelteleporthistory.cpp | 223 +++++++++++++++++++++++++++---- 3 files changed, 294 insertions(+), 28 deletions(-) (limited to 'indra') diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 7b7a3139a4..3754d155cf 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -66,7 +66,7 @@ const LLRect& LLFlatListView::getItemsRect() const return mItemsPanel->getRect(); } -bool LLFlatListView::addItem(LLPanel * item, const LLSD& value /*= LLUUID::null*/, EAddPosition pos /*= ADD_BOTTOM*/) +bool LLFlatListView::addItem(LLPanel * item, const LLSD& value /*= LLUUID::null*/, EAddPosition pos /*= ADD_BOTTOM*/,bool rearrange /*= true*/) { if (!item) return false; if (value.isUndefined()) return false; @@ -97,8 +97,11 @@ bool LLFlatListView::addItem(LLPanel * item, const LLSD& value /*= LLUUID::null* // Children don't accept the focus item->setTabStop(false); - rearrangeItems(); - notifyParentItemsRectChanged(); + if (rearrange) + { + rearrangeItems(); + notifyParentItemsRectChanged(); + } return true; } @@ -980,7 +983,86 @@ S32 LLFlatListView::notify(const LLSD& info) return 1; } } + else if (info.has("rearrange")) + { + rearrangeItems(); + notifyParentItemsRectChanged(); + return 1; + } return 0; } +void LLFlatListView::detachItems(std::vector& detached_items) +{ + LLSD action; + action.with("detach", LLSD()); + // Clear detached_items list + detached_items.clear(); + // Go through items and detach valid items, remove them from items panel + // and add to detached_items. + for (pairs_iterator_t + iter = mItemPairs.begin(), + iter_end = mItemPairs.end(); + iter != iter_end; ++iter) + { + LLPanel* pItem = (*iter)->first; + if (1 == pItem->notify(action)) + { + selectItemPair((*iter), false); + mItemsPanel->removeChild(pItem); + detached_items.push_back(pItem); + } + } + if (!detached_items.empty()) + { + // Some items were detached, clean ourself from unusable memory + if (detached_items.size() == mItemPairs.size()) + { + // This way will be faster if all items were disconnected + for (pairs_iterator_t + iter = mItemPairs.begin(), + iter_end = mItemPairs.end(); + iter != iter_end; ++iter) + { + (*iter)->first = NULL; + delete *iter; + } + mItemPairs.clear(); + // Also set items panel height to zero. + // Reshape it to allow reshaping of non-item children. + LLRect rc = mItemsPanel->getRect(); + rc.mBottom = rc.mTop; + mItemsPanel->reshape(rc.getWidth(), rc.getHeight()); + mItemsPanel->setRect(rc); + setNoItemsCommentVisible(true); + } + else + { + for (std::vector::const_iterator + detached_iter = detached_items.begin(), + detached_iter_end = detached_items.end(); + detached_iter != detached_iter_end; ++detached_iter) + { + LLPanel* pDetachedItem = *detached_iter; + for (pairs_iterator_t + iter = mItemPairs.begin(), + iter_end = mItemPairs.end(); + iter != iter_end; ++iter) + { + item_pair_t* item_pair = *iter; + if (item_pair->first == pDetachedItem) + { + mItemPairs.erase(iter); + item_pair->first = NULL; + delete item_pair; + break; + } + } + } + rearrangeItems(); + } + notifyParentItemsRectChanged(); + } +} + //EOF diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index a488b00854..5999e79f61 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -133,7 +133,7 @@ public: * Adds and item and LLSD value associated with it to the list at specified position * @return true if the item was added, false otherwise */ - virtual bool addItem(LLPanel * item, const LLSD& value = LLUUID::null, EAddPosition pos = ADD_BOTTOM); + virtual bool addItem(LLPanel * item, const LLSD& value = LLUUID::null, EAddPosition pos = ADD_BOTTOM, bool rearrange = true); /** * Insert item_to_add along with associated value to the list right after the after_item. @@ -270,6 +270,15 @@ public: /** Removes all items from the list */ virtual void clear(); + /** + * Removes all items that can be detached from the list but doesn't destroy + * them, caller responsible to manage items after they are detached. + * Detachable item should accept "detach" action via notify() method, + * where it disconnect all callbacks, does other valuable routines and + * return 1. + */ + void detachItems(std::vector& detached_items); + /** * Set comparator to use for future sorts. * diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 596bd2909a..3eb90e919c 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -60,13 +60,18 @@ class LLTeleportHistoryFlatItem : public LLPanel { public: LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name, const std::string &hl); - virtual ~LLTeleportHistoryFlatItem() {}; + virtual ~LLTeleportHistoryFlatItem(); virtual BOOL postBuild(); + /*virtual*/ S32 notify(const LLSD& info); + S32 getIndex() { return mIndex; } void setIndex(S32 index) { mIndex = index; } const std::string& getRegionName() { return mRegionName;} + void setRegionName(const std::string& name); + void setHighlightedText(const std::string& text); + void updateTitle(); /*virtual*/ void setValue(const LLSD& value); @@ -75,18 +80,51 @@ public: virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); static void showPlaceInfoPanel(S32 index); + + LLHandle getItemHandle() { mItemHandle.bind(this); return mItemHandle; } + private: void onProfileBtnClick(); LLButton* mProfileBtn; + LLTextBox* mTitle; LLTeleportHistoryPanel::ContextMenu *mContextMenu; S32 mIndex; std::string mRegionName; std::string mHighlight; + LLRootHandle mItemHandle; +}; + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +class LLTeleportHistoryFlatItemStorage: public LLSingleton { +protected: + typedef std::vector< LLHandle > flat_item_list_t; + +public: + LLTeleportHistoryFlatItem* getFlatItemForPersistentItem ( + LLTeleportHistoryPanel::ContextMenu *context_menu, + const LLTeleportHistoryPersistentItem& persistent_item, + const S32 cur_item_index, + const std::string &hl); + + void removeItem(LLTeleportHistoryFlatItem* item); + + void purge(); + +private: + + flat_item_list_t mItems; }; +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name, const std::string &hl) : LLPanel(), mIndex(index), @@ -97,18 +135,37 @@ LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistor LLUICtrlFactory::getInstance()->buildPanel(this, "panel_teleport_history_item.xml"); } +LLTeleportHistoryFlatItem::~LLTeleportHistoryFlatItem() +{ +} + //virtual BOOL LLTeleportHistoryFlatItem::postBuild() { - LLTextUtil::textboxSetHighlightedVal(getChild("region"), LLStyle::Params(), mRegionName, mHighlight); + mTitle = getChild("region"); mProfileBtn = getChild("profile_btn"); mProfileBtn->setClickedCallback(boost::bind(&LLTeleportHistoryFlatItem::onProfileBtnClick, this)); + updateTitle(); + return true; } +S32 LLTeleportHistoryFlatItem::notify(const LLSD& info) +{ + if(info.has("detach")) + { + delete mMouseDownSignal; + mMouseDownSignal = NULL; + delete mRightMouseDownSignal; + mRightMouseDownSignal = NULL; + return 1; + } + return 0; +} + void LLTeleportHistoryFlatItem::setValue(const LLSD& value) { if (!value.isMap()) return;; @@ -116,6 +173,25 @@ void LLTeleportHistoryFlatItem::setValue(const LLSD& value) childSetVisible("selected_icon", value["selected"]); } +void LLTeleportHistoryFlatItem::setHighlightedText(const std::string& text) +{ + mHighlight = text; +} + +void LLTeleportHistoryFlatItem::setRegionName(const std::string& name) +{ + mRegionName = name; +} + +void LLTeleportHistoryFlatItem::updateTitle() +{ + LLTextUtil::textboxSetHighlightedVal( + mTitle, + LLStyle::Params(), + mRegionName, + mHighlight); +} + void LLTeleportHistoryFlatItem::onMouseEnter(S32 x, S32 y, MASK mask) { childSetVisible("hovered_icon", true); @@ -155,6 +231,82 @@ void LLTeleportHistoryFlatItem::onProfileBtnClick() LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex); } +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +LLTeleportHistoryFlatItem* +LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem ( + LLTeleportHistoryPanel::ContextMenu *context_menu, + const LLTeleportHistoryPersistentItem& persistent_item, + const S32 cur_item_index, + const std::string &hl) +{ + LLTeleportHistoryFlatItem* item = NULL; + if ( cur_item_index < mItems.size() ) + { + item = mItems[cur_item_index].get(); + if (item->getParent() == NULL) + { + item->setIndex(cur_item_index); + item->setRegionName(persistent_item.mTitle); + item->setHighlightedText(hl); + item->setVisible(TRUE); + item->updateTitle(); + } + else + { + // Item already added to parent + item = NULL; + } + } + + if ( !item ) + { + item = new LLTeleportHistoryFlatItem(cur_item_index, + context_menu, + persistent_item.mTitle, + hl); + mItems.push_back(item->getItemHandle()); + } + + return item; +} + +void LLTeleportHistoryFlatItemStorage::removeItem(LLTeleportHistoryFlatItem* item) +{ + if (item) + { + flat_item_list_t::iterator item_iter = std::find(mItems.begin(), + mItems.end(), + item->getItemHandle()); + if (item_iter != mItems.end()) + { + mItems.erase(item_iter); + } + } +} + +void LLTeleportHistoryFlatItemStorage::purge() +{ + for ( flat_item_list_t::iterator + it = mItems.begin(), + it_end = mItems.end(); + it != it_end; ++it ) + { + LLHandle item_handle = *it; + if ( !item_handle.isDead() && item_handle.get()->getParent() == NULL ) + { + item_handle.get()->die(); + } + } + mItems.clear(); +} + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + LLTeleportHistoryPanel::ContextMenu::ContextMenu() : mMenu(NULL) { @@ -236,6 +388,7 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel() LLTeleportHistoryPanel::~LLTeleportHistoryPanel() { + LLTeleportHistoryFlatItemStorage::instance().purge(); LLView::deleteViewByHandle(mGearMenuHandle); } @@ -319,8 +472,11 @@ void LLTeleportHistoryPanel::draw() // virtual void LLTeleportHistoryPanel::onSearchEdit(const std::string& string) { - sFilterSubString = string; - showTeleportHistory(); + if (sFilterSubString != string) + { + sFilterSubString = string; + showTeleportHistory(); + } } // virtual @@ -478,16 +634,15 @@ void LLTeleportHistoryPanel::refresh() while (mCurrentItem >= 0) { // Filtering - std::string landmark_title = items[mCurrentItem].mTitle; - LLStringUtil::toUpper(landmark_title); - - std::string::size_type match_offset = sFilterSubString.size() ? landmark_title.find(sFilterSubString) : std::string::npos; - bool passed = sFilterSubString.size() == 0 || match_offset != std::string::npos; - - if (!passed) + if (!sFilterSubString.empty()) { - mCurrentItem--; - continue; + std::string landmark_title(items[mCurrentItem].mTitle); + LLStringUtil::toUpper(landmark_title); + if( std::string::npos == landmark_title.find(sFilterSubString) ) + { + mCurrentItem--; + continue; + } } // Checking whether date of item is earlier, than tab_boundary_date. @@ -521,9 +676,14 @@ void LLTeleportHistoryPanel::refresh() if (curr_flat_view) { - LLTeleportHistoryFlatItem* item = new LLTeleportHistoryFlatItem(mCurrentItem, &mContextMenu, items[mCurrentItem].mTitle, sFilterSubString); - curr_flat_view->addItem(item); - + LLTeleportHistoryFlatItem* item = + LLTeleportHistoryFlatItemStorage::instance() + .getFlatItemForPersistentItem(&mContextMenu, + items[mCurrentItem], + mCurrentItem, + sFilterSubString); + if ( !curr_flat_view->addItem(item, LLUUID::null, ADD_BOTTOM, false) ) + llerrs << "Couldn't add flat item to teleport history." << llendl; if (mLastSelectedItemIndex == mCurrentItem) curr_flat_view->selectItem(item, true); } @@ -534,6 +694,16 @@ void LLTeleportHistoryPanel::refresh() break; } + for (S32 n = mItemContainers.size() - 1; n >= 0; --n) + { + LLAccordionCtrlTab* tab = mItemContainers.get(n); + LLFlatListView* fv = getFlatListViewFromTab(tab); + if (fv) + { + fv->notify(LLSD().with("rearrange", LLSD())); + } + } + mHistoryAccordion->arrange(); updateVerbs(); @@ -566,11 +736,12 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index) } const LLTeleportHistoryStorage::slurl_list_t& history_items = mTeleportHistory->getItems(); - LLTeleportHistoryFlatItem* item = new LLTeleportHistoryFlatItem(history_items.size(), // index will be decremented inside loop below - &mContextMenu, - history_items[history_items.size() - 1].mTitle, // Most recent item, it was - sFilterSubString); - // added instead of removed + LLTeleportHistoryFlatItem* item = LLTeleportHistoryFlatItemStorage::instance() + .getFlatItemForPersistentItem(&mContextMenu, + history_items[history_items.size() - 1], // Most recent item, it was added instead of removed + history_items.size(), // index will be decremented inside loop below + sFilterSubString); + fv->addItem(item, LLUUID::null, ADD_TOP); // Index of each item, from last to removed item should be decremented @@ -598,6 +769,8 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index) if (item->getIndex() == removed_index) { + LLTeleportHistoryFlatItemStorage::instance().removeItem(item); + fv->removeItem(item); // If flat list becames empty, then accordion tab should be hidden @@ -629,10 +802,12 @@ void LLTeleportHistoryPanel::showTeleportHistory() LLFlatListView* fv = getFlatListViewFromTab(tab); if (fv) - fv->clear(); + { + // Detached panels are managed by LLTeleportHistoryFlatItemStorage + std::vector detached_items; + fv->detachItems(detached_items); + } } - - refresh(); } void LLTeleportHistoryPanel::handleItemSelect(LLFlatListView* selected) -- cgit v1.2.3 From a6f854979acb5e3e83973c5021077362b3643e01 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 23 Dec 2009 17:21:41 +0200 Subject: fixed EXT-3400 Instuction string doesn't fit button's caption in IM floater --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 32eae9d11d..f004c95aca 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2907,7 +2907,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Joining voice call... - Connected, click End Call to hang up + Connected, click Leave Call to hang up Left voice call -- cgit v1.2.3 From 315c6dec0647f6f985d73d2bd28070aa78f3899e Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Wed, 23 Dec 2009 17:25:49 +0200 Subject: fixed normal bug (EXT-2787) Outdated voice chat invitation never hides itself - P2P and AVALINE invitationswill hide now if a call is not valid anymore - GROUP and ADHOC invitations will stay on a screen --HG-- branch : product-engine --- indra/newview/llimview.cpp | 63 +++++++++++++++++++++- indra/newview/llimview.h | 22 +++++--- .../skins/default/xui/en/floater_incoming_call.xml | 4 ++ .../skins/default/xui/en/floater_outgoing_call.xml | 4 ++ 4 files changed, 85 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 3345f7d0bf..e2e3524f74 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1511,7 +1511,7 @@ bool LLOutgoingCallDialog::lifetimeHasExpired() if (mLifetimeTimer.getStarted()) { F32 elapsed_time = mLifetimeTimer.getElapsedTimeF32(); - if (elapsed_time > LIFETIME) + if (elapsed_time > mLifetime) { return true; } @@ -1532,6 +1532,13 @@ void LLOutgoingCallDialog::show(const LLSD& key) // hide all text at first hideAllText(); + // init notification's lifetime + std::istringstream ss( getString("lifetime") ); + if (!(ss >> mLifetime)) + { + mLifetime = DEFAULT_LIFETIME; + } + // customize text strings // tell the user which voice channel they are leaving if (!mPayload["old_channel_name"].asString().empty()) @@ -1641,6 +1648,43 @@ LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) : LLCallDialog(payload) { } +void LLIncomingCallDialog::draw() +{ + if (lifetimeHasExpired()) + { + onLifetimeExpired(); + } + LLDockableFloater::draw(); +} + +bool LLIncomingCallDialog::lifetimeHasExpired() +{ + if (mLifetimeTimer.getStarted()) + { + F32 elapsed_time = mLifetimeTimer.getElapsedTimeF32(); + if (elapsed_time > mLifetime) + { + return true; + } + } + return false; +} + +void LLIncomingCallDialog::onLifetimeExpired() +{ + // check whether a call is valid or not + if (LLVoiceClient::getInstance()->findSession(mPayload["caller_id"].asUUID())) + { + // restart notification's timer if call is still valid + mLifetimeTimer.start(); + } + else + { + // close invitation if call is already not valid + mLifetimeTimer.stop(); + closeFloater(); + } +} BOOL LLIncomingCallDialog::postBuild() { @@ -1650,6 +1694,13 @@ BOOL LLIncomingCallDialog::postBuild() LLSD caller_id = mPayload["caller_id"]; std::string caller_name = mPayload["caller_name"].asString(); + // init notification's lifetime + std::istringstream ss( getString("lifetime") ); + if (!(ss >> mLifetime)) + { + mLifetime = DEFAULT_LIFETIME; + } + std::string call_type; if (gAgent.isInGroup(session_id)) { @@ -1687,6 +1738,16 @@ BOOL LLIncomingCallDialog::postBuild() childSetAction("Start IM", onStartIM, this); childSetFocus("Accept"); + if(mPayload["notify_box_type"] != "VoiceInviteGroup" && mPayload["notify_box_type"] != "VoiceInviteAdHoc") + { + // starting notification's timer for P2P and AVALINE invitations + mLifetimeTimer.start(); + } + else + { + mLifetimeTimer.stop(); + } + return TRUE; } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 92caf0af9a..d0ac819161 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -489,6 +489,14 @@ public: virtual BOOL postBuild(); protected: + // lifetime timer for a notification + LLTimer mLifetimeTimer; + // notification's lifetime in seconds + S32 mLifetime; + static const S32 DEFAULT_LIFETIME = 5; + virtual bool lifetimeHasExpired() {return false;}; + virtual void onLifetimeExpired() {}; + virtual void getAllowedRect(LLRect& rect); LLSD mPayload; }; @@ -501,11 +509,16 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + // check timer state + /*virtual*/ void draw(); + static void onAccept(void* user_data); static void onReject(void* user_data); static void onStartIM(void* user_data); private: + /*virtual*/ bool lifetimeHasExpired(); + /*virtual*/ void onLifetimeExpired(); void processCallResponse(S32 response); }; @@ -524,15 +537,10 @@ public: /*virtual*/ void draw(); private: - // hide all text boxes void hideAllText(); - // lifetime timer for NO_ANSWER notification - LLTimer mLifetimeTimer; - // lifetime duration for NO_ANSWER notification - static const S32 LIFETIME = 5; - bool lifetimeHasExpired(); - void onLifetimeExpired(); + /*virtual*/ bool lifetimeHasExpired(); + /*virtual*/ void onLifetimeExpired(); }; // Globals diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml index 81c54ae55e..b9ce11600f 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -10,6 +10,10 @@ help_topic="incoming_call" title="UNKNOWN PERSON IS CALLING" width="410"> + + 5 + Nearby Voice Chat 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 c6bc093c6c..104ac2143f 100644 --- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -10,6 +10,10 @@ help_topic="outgoing_call" title="CALLING" width="410"> + + 5 + Nearby Voice Chat -- cgit v1.2.3 From d741d040bc0f06f573b4a2507fba2b245191c36d Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 23 Dec 2009 17:47:22 +0200 Subject: fixed win build --HG-- branch : product-engine --- indra/newview/llpanelteleporthistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 3eb90e919c..03b616d280 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -243,7 +243,7 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem ( const std::string &hl) { LLTeleportHistoryFlatItem* item = NULL; - if ( cur_item_index < mItems.size() ) + if ( cur_item_index < (S32) mItems.size() ) { item = mItems[cur_item_index].get(); if (item->getParent() == NULL) -- cgit v1.2.3