diff options
author | Kent Quirk <q@lindenlab.com> | 2009-12-30 00:45:11 -0500 |
---|---|---|
committer | Kent Quirk <q@lindenlab.com> | 2009-12-30 00:45:11 -0500 |
commit | f4e2287175ab1bc9d09fc73435a828071b9e2ba5 (patch) | |
tree | a3e863efea52678e6ea3f19302bef1d5500fcf42 /indra/newview | |
parent | 904de223b6da701e2512b8d8bf0d3be478421c78 (diff) | |
parent | 383cb255e0ff619fa4ee3fc0b1dc6a37643d3bc1 (diff) |
automated merge PE->viewer2.0
Diffstat (limited to 'indra/newview')
68 files changed, 906 insertions, 332 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a26aae3590..648e582e94 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -227,6 +227,7 @@ set(viewer_SOURCE_FILES llgesturemgr.cpp llglsandbox.cpp llgroupactions.cpp + llgroupiconctrl.cpp llgrouplist.cpp llgroupmgr.cpp llhomelocationresponder.cpp @@ -736,6 +737,7 @@ set(viewer_HEADER_FILES llfriendcard.h llgesturemgr.h llgroupactions.h + llgroupiconctrl.h llgrouplist.h llgroupmgr.h llhomelocationresponder.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7296c5d947..0ee39c2fc8 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2344,6 +2344,17 @@ <key>Value</key> <string>89556747-24cb-43ed-920b-47caed15465f</string> </map> + <key>DefaultUploadCost</key> + <map> + <key>Comment</key> + <string>Default sound/image/file upload cost(in case economy data is not available).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>10</integer> + </map> <key>DisableCameraConstraints</key> <map> <key>Comment</key> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 628982973c..79b0527a74 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -747,7 +747,11 @@ void LLAgent::setFlying(BOOL fly) { if (mAvatarObject.notNull()) { - if(mAvatarObject->mSignaledAnimations.find(ANIM_AGENT_STANDUP) != mAvatarObject->mSignaledAnimations.end()) + // *HACK: Don't allow to start the flying mode if we got ANIM_AGENT_STANDUP signal + // because in this case we won't get a signal to start avatar flying animation and + // it will be walking with flying mode "ON" indication. However we allow to switch + // the flying mode off if we get ANIM_AGENT_STANDUP signal. See process_avatar_animation(). + if(fly && mAvatarObject->mSignaledAnimations.find(ANIM_AGENT_STANDUP) != mAvatarObject->mSignaledAnimations.end()) { return; } diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 44cbbbb6b2..42ae122ff9 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -38,7 +38,6 @@ #include "llavatarconstants.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llavataractions.h" -#include "llimview.h" #include "llmenugl.h" #include "lluictrlfactory.h" diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index b3ef6464f6..5df73a994e 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -165,6 +165,7 @@ void LLAvatarList::clear() { getIDs().clear(); setDirty(true); + LLFlatListView::clear(); } void LLAvatarList::setNameFilter(const std::string& filter) diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 8bc11b0c1c..6945ac6932 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -165,7 +165,7 @@ void LLAvatarListItem::setOnline(bool online) mOnlineStatus = (EOnlineStatus) online; // Change avatar name font style depending on the new online status. - setStyle(online ? IS_ONLINE : IS_OFFLINE); + setState(online ? IS_ONLINE : IS_OFFLINE); } void LLAvatarListItem::setName(const std::string& name) @@ -178,7 +178,7 @@ void LLAvatarListItem::setHighlight(const std::string& highlight) setNameInternal(mAvatarName->getText(), mHighlihtSubstring = highlight); } -void LLAvatarListItem::setStyle(EItemStyle item_style) +void LLAvatarListItem::setState(EItemState item_style) { item_style_map_t& item_styles_params_map = getItemStylesParams(); diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 79303b55cc..96097bc9b5 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -46,14 +46,14 @@ class LLAvatarIconCtrl; class LLAvatarListItem : public LLPanel, public LLFriendObserver { public: - typedef enum e_item_style_type { + typedef enum e_item_state_type { IS_DEFAULT, IS_VOICE_INVITED, IS_VOICE_JOINED, IS_VOICE_LEFT, IS_ONLINE, IS_OFFLINE, - } EItemStyle; + } EItemState; class ContextMenu { @@ -82,7 +82,7 @@ public: void setOnline(bool online); void setName(const std::string& name); void setHighlight(const std::string& highlight); - void setStyle(EItemStyle item_style); + void setState(EItemState item_style); void setAvatarId(const LLUUID& id, bool ignore_status_changes = false); void setLastInteractionTime(U32 secs_since); //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly @@ -129,10 +129,10 @@ private: std::string formatSeconds(U32 secs); - typedef std::map<EItemStyle, LLStyle::Params> item_style_map_t; + typedef std::map<EItemState, LLStyle::Params> item_style_map_t; static item_style_map_t& getItemStylesParams(); - typedef std::map<EItemStyle, LLColor4> icon_color_map_t; + typedef std::map<EItemState, LLColor4> icon_color_map_t; static icon_color_map_t& getItemIconColorMap(); LLTextBox* mAvatarName; diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 1b4c274bfb..a402f59fa1 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -48,6 +48,8 @@ #include "llparticipantlist.h" #include "llspeakers.h" #include "lltransientfloatermgr.h" +#include "llviewerwindow.h" +#include "llvoicechannel.h" static void get_voice_participants_uuids(std::vector<LLUUID>& speakers_uuids); @@ -99,8 +101,10 @@ BOOL LLCallFloater::LLAvatarListItemRemoveTimer::tick() return TRUE; } +LLVoiceChannel* LLCallFloater::sCurrentVoiceCanel = NULL; + LLCallFloater::LLCallFloater(const LLSD& key) -: LLDockableFloater(NULL, false, key) +: LLTransientDockableFloater(NULL, false, key) , mSpeakerManager(NULL) , mParticipants(NULL) , mAvatarList(NULL) @@ -128,6 +132,7 @@ LLCallFloater::~LLCallFloater() mParticipants = NULL; mAvatarListRefreshConnection.disconnect(); + mVoiceChannelStateChangeConnection.disconnect(); // Don't use LLVoiceClient::getInstance() here // singleton MAY have already been destroyed. @@ -141,15 +146,16 @@ LLCallFloater::~LLCallFloater() // virtual BOOL LLCallFloater::postBuild() { - LLDockableFloater::postBuild(); + LLTransientDockableFloater::postBuild(); mAvatarList = getChild<LLAvatarList>("speakers_list"); mAvatarListRefreshConnection = mAvatarList->setRefreshCompleteCallback(boost::bind(&LLCallFloater::onAvatarListRefreshed, this)); childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this)); mNonAvatarCaller = getChild<LLNonAvatarCaller>("non_avatar_caller"); + mNonAvatarCaller->setVisible(FALSE); - LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_panel"); + LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_flyout_btn"); setDockControl(new LLDockControl( anchor_panel, this, @@ -157,8 +163,8 @@ BOOL LLCallFloater::postBuild() initAgentData(); - // update list for current session - updateSession(); + + connectToChannel(LLVoiceChannel::getCurrentVoiceChannel()); return TRUE; } @@ -192,7 +198,7 @@ void LLCallFloater::draw() if (mParticipants) mParticipants->updateRecentSpeakersOrder(); - LLDockableFloater::draw(); + LLTransientDockableFloater::draw(); } // virtual @@ -211,6 +217,15 @@ void LLCallFloater::onChange() } } +S32 LLCallFloater::notifyParent(const LLSD& info) +{ + if("size_changes" == info["action"]) + { + reshapeToFitContent(); + return 1; + } + return LLDockableFloater::notifyParent(info); +} ////////////////////////////////////////////////////////////////////////// /// PRIVATE SECTION @@ -306,17 +321,6 @@ void LLCallFloater::updateSession() void LLCallFloater::refreshParticipantList() { - // lets forget states from the previous session - // for timers... - resetVoiceRemoveTimers(); - - // ...and for speaker state - mSpeakerStateMap.clear(); - - delete mParticipants; - mParticipants = NULL; - mAvatarList->clear(); - bool non_avatar_caller = false; if (VC_PEER_TO_PEER == mVoiceType) { @@ -361,21 +365,19 @@ void LLCallFloater::onAvatarListRefreshed() } } +// static void LLCallFloater::sOnCurrentChannelChanged(const LLUUID& /*session_id*/) { - // Don't update participant list if no channel info is available. - // Fix for ticket EXT-3427 - // @see LLParticipantList::~LLParticipantList() - if(LLVoiceChannel::getCurrentVoiceChannel() && - LLVoiceChannel::STATE_NO_CHANNEL_INFO == LLVoiceChannel::getCurrentVoiceChannel()->getState()) - { - return; - } + LLVoiceChannel* channel = LLVoiceChannel::getCurrentVoiceChannel(); + + // *NOTE: if signal was sent for voice channel with LLVoiceChannel::STATE_NO_CHANNEL_INFO + // it sill be sent for the same channel again (when state is changed). + // So, lets ignore this call. + if (channel == sCurrentVoiceCanel) return; + LLCallFloater* call_floater = LLFloaterReg::getTypedInstance<LLCallFloater>("voice_controls"); - // Forget speaker manager from the previous session to avoid using it after session was destroyed. - call_floater->mSpeakerManager = NULL; - call_floater->updateSession(); + call_floater->connectToChannel(channel); } void LLCallFloater::updateTitle() @@ -573,23 +575,15 @@ void LLCallFloater::updateParticipantsVoiceState() // HAS LEFT the call. if ((getState(participant_id) == STATE_JOINED)) { - if (mVoiceType == VC_LOCAL_CHAT) + setState(item, STATE_LEFT); + + LLPointer<LLSpeaker> speaker = mSpeakerManager->findSpeaker(item->getAvatarId()); + if (speaker.isNull()) { - // Don't display avatars that aren't in our nearby chat range anymore as "left". Remove them immediately. - removeVoiceLeftParticipant(participant_id); + continue; } - else - { - setState(item, STATE_LEFT); - - LLPointer<LLSpeaker> speaker = mSpeakerManager->findSpeaker(item->getAvatarId()); - if (speaker.isNull()) - { - continue; - } - speaker->mHasLeftCurrentCall = TRUE; - } + speaker->mHasLeftCurrentCall = TRUE; } // If an avatarID is not found in a speakers list from VoiceClient and // a panel with this ID has a LEFT status this means that this person @@ -626,16 +620,16 @@ void LLCallFloater::setState(LLAvatarListItem* item, ESpeakerState state) switch (state) { case STATE_INVITED: - item->setStyle(LLAvatarListItem::IS_VOICE_INVITED); + item->setState(LLAvatarListItem::IS_VOICE_INVITED); break; case STATE_JOINED: removeVoiceRemoveTimer(item->getAvatarId()); - item->setStyle(LLAvatarListItem::IS_VOICE_JOINED); + item->setState(LLAvatarListItem::IS_VOICE_JOINED); break; case STATE_LEFT: { setVoiceRemoveTimer(item->getAvatarId()); - item->setStyle(LLAvatarListItem::IS_VOICE_LEFT); + item->setState(LLAvatarListItem::IS_VOICE_LEFT); } break; default: @@ -721,4 +715,141 @@ bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) return std::find(speakers.begin(), speakers.end(), speaker_id) != speakers.end(); } +void LLCallFloater::connectToChannel(LLVoiceChannel* channel) +{ + mVoiceChannelStateChangeConnection.disconnect(); + + sCurrentVoiceCanel = channel; + + mVoiceChannelStateChangeConnection = sCurrentVoiceCanel->setStateChangedCallback(boost::bind(&LLCallFloater::onVoiceChannelStateChanged, this, _1, _2)); + + updateState(channel->getState()); +} + +void LLCallFloater::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) +{ + updateState(new_state); +} + +void LLCallFloater::updateState(const LLVoiceChannel::EState& new_state) +{ + LL_DEBUGS("Voice") << "Updating state: " << new_state << ", session name: " << sCurrentVoiceCanel->getSessionName() << LL_ENDL; + if (LLVoiceChannel::STATE_CONNECTED == new_state) + { + updateSession(); + } + else + { + reset(); + } +} + +void LLCallFloater::reset() +{ + // lets forget states from the previous session + // for timers... + resetVoiceRemoveTimers(); + + // ...and for speaker state + mSpeakerStateMap.clear(); + + delete mParticipants; + mParticipants = NULL; + mAvatarList->clear(); + + // update floater to show Loading while waiting for data. + mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); + mAvatarList->setVisible(TRUE); + mNonAvatarCaller->setVisible(FALSE); + + mSpeakerManager = NULL; +} + +void reshape_floater(LLCallFloater* floater, S32 delta_height) +{ + // Try to update floater top side if it is docked(to bottom bar). + // Try to update floater bottom side or top side if it is un-docked. + // If world rect is too small, floater will not be reshaped at all. + + LLRect floater_rect = floater->getRect(); + LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); + + // floater is docked to bottom bar + if(floater->isDocked()) + { + // can update floater top side + if(floater_rect.mTop + delta_height < world_rect.mTop) + { + floater_rect.set(floater_rect.mLeft, floater_rect.mTop + delta_height, + floater_rect.mRight, floater_rect.mBottom); + } + } + // floater is un-docked + else + { + // can update floater bottom side + if( floater_rect.mBottom - delta_height >= world_rect.mBottom ) + { + floater_rect.set(floater_rect.mLeft, floater_rect.mTop, + floater_rect.mRight, floater_rect.mBottom - delta_height); + } + // could not update floater bottom side, check if we can update floater top side + else if( floater_rect.mTop + delta_height < world_rect.mTop ) + { + floater_rect.set(floater_rect.mLeft, floater_rect.mTop + delta_height, + floater_rect.mRight, floater_rect.mBottom); + } + } + + floater->reshape(floater_rect.getWidth(), floater_rect.getHeight()); + floater->setRect(floater_rect); +} + +void LLCallFloater::reshapeToFitContent() +{ + const S32 ITEM_HEIGHT = getParticipantItemHeight(); + static const S32 MAX_VISIBLE_ITEMS = getMaxVisibleItems(); + + static S32 items_pad = mAvatarList->getItemsPad(); + S32 list_height = mAvatarList->getRect().getHeight(); + S32 items_height = mAvatarList->getItemsRect().getHeight(); + if(items_height <= 0) + { + // make "no one near" text visible + items_height = ITEM_HEIGHT + items_pad; + } + S32 max_list_height = MAX_VISIBLE_ITEMS * ITEM_HEIGHT + items_pad * (MAX_VISIBLE_ITEMS - 1); + max_list_height += 2* mAvatarList->getBorderWidth(); + + S32 delta = items_height - list_height; + // too many items, don't reshape floater anymore, let scroll bar appear. + if(items_height > max_list_height) + { + delta = max_list_height - list_height; + } + + reshape_floater(this, delta); +} + +S32 LLCallFloater::getParticipantItemHeight() +{ + std::vector<LLPanel*> items; + mAvatarList->getItems(items); + if(items.size() > 0) + { + return items[0]->getRect().getHeight(); + } + else + { + return getChild<LLPanel>("non_avatar_caller")->getRect().getHeight(); + } +} + +S32 LLCallFloater::getMaxVisibleItems() +{ + S32 value = 5; // default value, in case convertToS32() fails. + LLStringUtil::convertToS32(getString("max_visible_items"), value); + return value; +} + //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 3df9e333c5..8aba93fc43 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -34,7 +34,8 @@ #ifndef LL_LLCALLFLOATER_H #define LL_LLCALLFLOATER_H -#include "lldockablefloater.h" +#include "lltransientdockablefloater.h" +#include "llvoicechannel.h" #include "llvoiceclient.h" class LLAvatarList; @@ -54,7 +55,7 @@ class LLSpeakerMgr; * When the Resident is engaged in any chat except Nearby Chat, the Voice Control Panel also provides an * 'Leave Call' button to allow the Resident to leave that voice channel. */ -class LLCallFloater : public LLDockableFloater, LLVoiceClientParticipantObserver +class LLCallFloater : public LLTransientDockableFloater, LLVoiceClientParticipantObserver { public: @@ -74,6 +75,11 @@ public: */ /*virtual*/ void onChange(); + /** + * Will reshape floater when participant list size changes + */ + /*virtual*/ S32 notifyParent(const LLSD& info); + static void sOnCurrentChannelChanged(const LLUUID& session_id); private: @@ -192,6 +198,43 @@ private: */ bool validateSpeaker(const LLUUID& speaker_id); + /** + * Connects to passed channel to be updated according to channel's voice states. + */ + void connectToChannel(LLVoiceChannel* channel); + + /** + * Callback to process changing of voice channel's states. + */ + void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); + + /** + * Updates floater according to passed channel's voice state. + */ + void updateState(const LLVoiceChannel::EState& new_state); + + /** + * Resets floater to be ready to show voice participants. + * + * Clears all data from the latest voice session. + */ + void reset(); + + /** + * Reshapes floater to fit participant list height + */ + void reshapeToFitContent(); + + /** + * Returns height of participant list item + */ + S32 getParticipantItemHeight(); + + /** + * Returns predefined max visible participants. + */ + S32 getMaxVisibleItems(); + private: speaker_state_map_t mSpeakerStateMap; LLSpeakerMgr* mSpeakerManager; @@ -242,6 +285,16 @@ private: timers_map mVoiceLeftTimersMap; S32 mVoiceLeftRemoveDelay; + + /** + * Stores reference to current voice channel. + * + * Is used to ignore voice channel changed callback for the same channel. + * + * @see sOnCurrentChannelChanged() + */ + static LLVoiceChannel* sCurrentVoiceCanel; + boost::signals2::connection mVoiceChannelStateChangeConnection; }; diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 82413878ad..d988770f90 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -62,7 +62,6 @@ #include "llviewerobjectlist.h" #include "llviewerwindow.h" #include "llvoavatar.h" -#include "llimview.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index cbb566b3a7..769387c26c 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -36,7 +36,6 @@ #include "llappviewer.h" #include "llviewercontrol.h" -#include "llimview.h" #include "llviewerwindow.h" #include "llrootview.h" #include "llsyswellwindow.h" diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index b1ddddc4b1..21cadda6e3 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -31,12 +31,14 @@ */ #include "llviewerprecompiledheaders.h" + +#include "llinstantmessage.h" + #include "llchathistory.h" #include "llpanel.h" #include "lluictrlfactory.h" #include "llscrollcontainer.h" #include "llavatariconctrl.h" -#include "llimview.h" #include "llcallingcard.h" //for LLAvatarTracker #include "llagentdata.h" #include "llavataractions.h" diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 6e3d5499a2..a0b2de85f0 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -51,8 +51,7 @@ #include "lluictrlfactory.h" #include "message.h" -LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, - void* userdata, +LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, BOOL allow_multiple, BOOL closeOnSelect) { @@ -60,8 +59,7 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, LLFloaterAvatarPicker* floater = LLFloaterReg::showTypedInstance<LLFloaterAvatarPicker>("avatar_picker"); - floater->mCallback = callback; - floater->mCallbackUserdata = userdata; + floater->mSelectionCallback = callback; floater->setAllowMultiple(allow_multiple); floater->mNearMeListComplete = FALSE; floater->mCloseOnSelect = closeOnSelect; @@ -82,8 +80,6 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) : LLFloater(key), mNumResultsReturned(0), - mCallback(NULL), - mCallbackUserdata(NULL), mNearMeListComplete(FALSE), mCloseOnSelect(FALSE) { @@ -93,29 +89,29 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) BOOL LLFloaterAvatarPicker::postBuild() { - getChild<LLLineEditor>("Edit")->setKeystrokeCallback(editKeystroke, this); + getChild<LLLineEditor>("Edit")->setKeystrokeCallback( boost::bind(&LLFloaterAvatarPicker::editKeystroke, this, _1, _2),NULL); - childSetAction("Find", onBtnFind, this); + childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this)); childDisable("Find"); - childSetAction("Refresh", onBtnRefresh, this); - childSetCommitCallback("near_me_range", onRangeAdjust, this); + childSetAction("Refresh", boost::bind(&LLFloaterAvatarPicker::onBtnRefresh, this)); + getChild<LLUICtrl>("near_me_range")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onRangeAdjust, this)); LLScrollListCtrl* searchresults = getChild<LLScrollListCtrl>("SearchResults"); - searchresults->setDoubleClickCallback(onBtnSelect, this); - childSetCommitCallback("SearchResults", onList, this); + searchresults->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); + searchresults->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this)); childDisable("SearchResults"); LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe"); - nearme->setDoubleClickCallback(onBtnSelect, this); - childSetCommitCallback("NearMe", onList, this); + nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); + nearme->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this)); LLScrollListCtrl* friends = getChild<LLScrollListCtrl>("Friends"); - friends->setDoubleClickCallback(onBtnSelect, this); - childSetCommitCallback("Friends", onList, this); + friends->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); + getChild<LLUICtrl>("Friends")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this)); - childSetAction("ok_btn", onBtnSelect, this); + childSetAction("ok_btn", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); childDisable("ok_btn"); - childSetAction("cancel_btn", onBtnClose, this); + childSetAction("cancel_btn", boost::bind(&LLFloaterAvatarPicker::onBtnClose, this)); childSetFocus("Edit"); @@ -156,10 +152,9 @@ LLFloaterAvatarPicker::~LLFloaterAvatarPicker() gFocusMgr.releaseFocusIfNeeded( this ); } -void LLFloaterAvatarPicker::onBtnFind(void* userdata) +void LLFloaterAvatarPicker::onBtnFind() { - LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; - if(self) self->find(); + find(); } static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std::string>& avatar_names, std::vector<LLUUID>& avatar_ids) @@ -176,34 +171,33 @@ static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std: } } -void LLFloaterAvatarPicker::onBtnSelect(void* userdata) +void LLFloaterAvatarPicker::onBtnSelect() { - LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; // If select btn not enabled then do not callback - if (!self || !self->isSelectBtnEnabled()) + if (!isSelectBtnEnabled()) return; - if(self->mCallback) + if(mSelectionCallback) { std::string acvtive_panel_name; LLScrollListCtrl* list = NULL; - LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs"); + LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); if(active_panel) { acvtive_panel_name = active_panel->getName(); } if(acvtive_panel_name == "SearchPanel") { - list = self->getChild<LLScrollListCtrl>("SearchResults"); + list = getChild<LLScrollListCtrl>("SearchResults"); } else if(acvtive_panel_name == "NearMePanel") { - list =self->getChild<LLScrollListCtrl>("NearMe"); + list = getChild<LLScrollListCtrl>("NearMe"); } else if (acvtive_panel_name == "FriendsPanel") { - list =self->getChild<LLScrollListCtrl>("Friends"); + list = getChild<LLScrollListCtrl>("Friends"); } if(list) @@ -211,50 +205,39 @@ void LLFloaterAvatarPicker::onBtnSelect(void* userdata) std::vector<std::string> avatar_names; std::vector<LLUUID> avatar_ids; getSelectedAvatarData(list, avatar_names, avatar_ids); - self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata); + mSelectionCallback(avatar_names, avatar_ids); } } - self->getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE); - self->getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE); - self->getChild<LLScrollListCtrl>("Friends")->deselectAllItems(TRUE); - if(self->mCloseOnSelect) + getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE); + getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE); + getChild<LLScrollListCtrl>("Friends")->deselectAllItems(TRUE); + if(mCloseOnSelect) { - self->mCloseOnSelect = FALSE; - self->closeFloater(); + mCloseOnSelect = FALSE; + closeFloater(); } } -void LLFloaterAvatarPicker::onBtnRefresh(void* userdata) +void LLFloaterAvatarPicker::onBtnRefresh() { - LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; - if (!self) - { - return; - } - - self->getChild<LLScrollListCtrl>("NearMe")->deleteAllItems(); - self->getChild<LLScrollListCtrl>("NearMe")->setCommentText(self->getString("searching")); - self->mNearMeListComplete = FALSE; + getChild<LLScrollListCtrl>("NearMe")->deleteAllItems(); + getChild<LLScrollListCtrl>("NearMe")->setCommentText(getString("searching")); + mNearMeListComplete = FALSE; } -void LLFloaterAvatarPicker::onBtnClose(void* userdata) +void LLFloaterAvatarPicker::onBtnClose() { - LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; - if(self) self->closeFloater(); + closeFloater(); } -void LLFloaterAvatarPicker::onRangeAdjust(LLUICtrl* source, void* data) +void LLFloaterAvatarPicker::onRangeAdjust() { - LLFloaterAvatarPicker::onBtnRefresh(data); + onBtnRefresh(); } -void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata) +void LLFloaterAvatarPicker::onList() { - LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; - if (self) - { - self->childSetEnabled("ok_btn", self->isSelectBtnEnabled()); - } + childSetEnabled("ok_btn", isSelectBtnEnabled()); } void LLFloaterAvatarPicker::populateNearMe() @@ -297,7 +280,7 @@ void LLFloaterAvatarPicker::populateNearMe() childEnable("NearMe"); childEnable("ok_btn"); near_me_scroller->selectFirstItem(); - onList(near_me_scroller, this); + onList(); near_me_scroller->setFocus(TRUE); } @@ -451,7 +434,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* { floater->childEnable("ok_btn"); search_results->selectFirstItem(); - floater->onList(search_results, floater); + floater->onList(); search_results->setFocus(TRUE); } } @@ -459,8 +442,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* //static void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data) { - LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)user_data; - self->childSetEnabled("Find", caller->getText().size() >= 3); + childSetEnabled("Find", caller->getText().size() >= 3); } // virtual @@ -470,11 +452,11 @@ BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask) { if (childHasFocus("Edit")) { - onBtnFind(this); + onBtnFind(); } else { - onBtnSelect(this); + onBtnSelect(); } return TRUE; } diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 13e491834e..e35466cec8 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -43,11 +43,10 @@ public: typedef boost::signals2::signal<bool(const std::vector<LLUUID>&), boost_boolean_combiner> validate_signal_t; typedef validate_signal_t::slot_type validate_callback_t; - // Call this to select an avatar. // The callback function will be called with an avatar name and UUID. - typedef void(*callback_t)(const std::vector<std::string>&, const std::vector<LLUUID>&, void*); - static LLFloaterAvatarPicker* show(callback_t callback, - void* userdata, + typedef boost::function<void (const std::vector<std::string>&, const std::vector<LLUUID>&)> select_callback_t; + // Call this to select an avatar. + static LLFloaterAvatarPicker* show(select_callback_t callback, BOOL allow_multiple = FALSE, BOOL closeOnSelect = FALSE); @@ -61,16 +60,16 @@ public: static void processAvatarPickerReply(class LLMessageSystem* msg, void**); private: - static void editKeystroke(class LLLineEditor* caller, void* user_data); + void editKeystroke(class LLLineEditor* caller, void* user_data); - static void onBtnFind(void* userdata); - static void onBtnSelect(void* userdata); - static void onBtnRefresh(void* userdata); - static void onRangeAdjust(LLUICtrl* source, void* data); - static void onBtnClose(void* userdata); - static void onList(class LLUICtrl* ctrl, void* userdata); - void onTabChanged(); - bool isSelectBtnEnabled(); + void onBtnFind(); + void onBtnSelect(); + void onBtnRefresh(); + void onRangeAdjust(); + void onBtnClose(); + void onList(); + void onTabChanged(); + bool isSelectBtnEnabled(); void populateNearMe(); void populateFriend(); @@ -87,9 +86,8 @@ private: BOOL mNearMeListComplete; BOOL mCloseOnSelect; - void (*mCallback)(const std::vector<std::string>& name, const std::vector<LLUUID>& id, void* userdata); - void* mCallbackUserdata; validate_signal_t mOkButtonValidateSignal; + select_callback_t mSelectionCallback; }; #endif diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index 1b14ca573a..9108cfb72b 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -44,6 +44,7 @@ #include "llviewercontrol.h" #include "llvoicechannel.h" #include "llimpanel.h" +#include "llimview.h" // // LLFloaterMyFriends diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h index 3929e6e36c..ab44281d81 100644 --- a/indra/newview/llfloaterchatterbox.h +++ b/indra/newview/llfloaterchatterbox.h @@ -36,8 +36,8 @@ #define LL_LLFLOATERCHATTERBOX_H #include "llfloater.h" +#include "llmultifloater.h" #include "llstring.h" -#include "llimview.h" #include "llimpanel.h" class LLTabContainer; diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 56291c57a6..ccc5cab85a 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -572,8 +572,7 @@ void LLPanelFriends::onClickIM(void* user_data) // static void LLPanelFriends::onPickAvatar(const std::vector<std::string>& names, - const std::vector<LLUUID>& ids, - void* ) + const std::vector<LLUUID>& ids) { if (names.empty()) return; if (ids.empty()) return; @@ -585,7 +584,7 @@ void LLPanelFriends::onClickAddFriend(void* user_data) { LLPanelFriends* panelp = (LLPanelFriends*)user_data; LLFloater* root_floater = gFloaterView->getParentFloater(panelp); - LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onPickAvatar, user_data, FALSE, TRUE); + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelFriends::onPickAvatar, _1,_2), FALSE, TRUE); if (root_floater) { root_floater->addDependentFloater(picker); diff --git a/indra/newview/llfloaterfriends.h b/indra/newview/llfloaterfriends.h index 9c6660c0dc..0042da48d3 100644 --- a/indra/newview/llfloaterfriends.h +++ b/indra/newview/llfloaterfriends.h @@ -116,7 +116,7 @@ private: static void onSelectName(LLUICtrl* ctrl, void* user_data); static bool callbackAddFriend(const LLSD& notification, const LLSD& response); static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); - static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data); + static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); static void onMaximumSelect(); static void onClickIM(void* user_data); diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index e1409b8ad5..c2b0bd18fa 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -1165,7 +1165,7 @@ bool LLPanelObjectTools::callbackSimWideDeletes( const LLSD& notification, const void LLPanelObjectTools::onClickSet() { // grandparent is a floater, which can have a dependent - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, this)); + gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, this, _1,_2))); } void LLPanelObjectTools::onClickSetBySelection(void* data) @@ -1189,14 +1189,12 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) panelp->childSetValue("target_avatar_name", name); } -// static -void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data) +void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) { - LLPanelObjectTools* object_tools = (LLPanelObjectTools*) data; if (ids.empty() || names.empty()) return; - object_tools->mTargetAvatar = ids[0]; - object_tools->childSetValue("target_avatar_name", names[0]); - object_tools->refresh(); + mTargetAvatar = ids[0]; + childSetValue("target_avatar_name", names[0]); + refresh(); } void LLPanelObjectTools::onChangeAnything() diff --git a/indra/newview/llfloatergodtools.h b/indra/newview/llfloatergodtools.h index ebab1fde11..ef5ce02749 100644 --- a/indra/newview/llfloatergodtools.h +++ b/indra/newview/llfloatergodtools.h @@ -234,7 +234,7 @@ public: void onChangeAnything(); void onApplyChanges(); void onClickSet(); - static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data); + void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); void onClickDeletePublicOwnedBy(); void onClickDeleteAllScriptedOwnedBy(); void onClickDeleteAllOwnedBy(); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 02884575b0..598a13de15 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2284,9 +2284,9 @@ BOOL LLPanelLandAccess::postBuild() childSetCommitCallback("PriceSpin", onCommitAny, this); childSetCommitCallback("HoursSpin", onCommitAny, this); - childSetAction("add_allowed", onClickAddAccess, this); + childSetAction("add_allowed", boost::bind(&LLPanelLandAccess::onClickAddAccess, this)); childSetAction("remove_allowed", onClickRemoveAccess, this); - childSetAction("add_banned", onClickAddBanned, this); + childSetAction("add_banned", boost::bind(&LLPanelLandAccess::onClickAddBanned, this)); childSetAction("remove_banned", onClickRemoveBanned, this); mListAccess = getChild<LLNameListCtrl>("AccessList"); @@ -2694,29 +2694,22 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) self->refresh(); } -// static -void LLPanelLandAccess::onClickAddAccess(void* data) +void LLPanelLandAccess::onClickAddAccess() { - LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; - if (panelp) - { - gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBAccess, data) ); - } + gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1,_2)) ); } -// static -void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata) +void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) { - LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata; if (!names.empty() && !ids.empty()) { LLUUID id = ids[0]; - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (parcel) { parcel->addToAccessList(id, 0); LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS); - panelp->refresh(); + refresh(); } } } @@ -2745,25 +2738,23 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data) } // static -void LLPanelLandAccess::onClickAddBanned(void* data) +void LLPanelLandAccess::onClickAddBanned() { - LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; - gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBBanned, data) ); + gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1,_2))); } // static -void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata) +void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) { - LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata; if (!names.empty() && !ids.empty()) { LLUUID id = ids[0]; - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (parcel) { parcel->addToBanList(id, 0); LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN); - panelp->refresh(); + refresh(); } } } diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index eb47fbe15b..d7d02ba1a3 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -367,14 +367,15 @@ public: static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata); static void onCommitAny(LLUICtrl* ctrl, void *userdata); - static void onClickAddAccess(void*); - static void callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata); static void onClickRemoveAccess(void*); - static void onClickAddBanned(void*); - static void callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata); static void onClickRemoveBanned(void*); virtual BOOL postBuild(); + + void onClickAddAccess(); + void onClickAddBanned(); + void callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); + void callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); protected: LLNameListCtrl* mListAccess; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 496fa62d05..c4b87c1b2d 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -586,7 +586,7 @@ BOOL LLPanelRegionGeneralInfo::postBuild() initCtrl("restrict_pushobject"); initCtrl("block_parcel_search_check"); - childSetAction("kick_btn", onClickKick, this); + childSetAction("kick_btn", boost::bind(&LLPanelRegionGeneralInfo::onClickKick, this)); childSetAction("kick_all_btn", onClickKickAll, this); childSetAction("im_btn", onClickMessage, this); // childSetAction("manage_telehub_btn", onClickManageTelehub, this); @@ -594,27 +594,22 @@ BOOL LLPanelRegionGeneralInfo::postBuild() return LLPanelRegionInfo::postBuild(); } -// static -void LLPanelRegionGeneralInfo::onClickKick(void* userdata) +void LLPanelRegionGeneralInfo::onClickKick() { llinfos << "LLPanelRegionGeneralInfo::onClickKick" << llendl; - LLPanelRegionGeneralInfo* panelp = (LLPanelRegionGeneralInfo*)userdata; // this depends on the grandparent view being a floater // in order to set up floater dependency - LLFloater* parent_floater = gFloaterView->getParentFloater(panelp); - LLFloater* child_floater = LLFloaterAvatarPicker::show(onKickCommit, userdata, FALSE, TRUE); + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1,_2), FALSE, TRUE); parent_floater->addDependentFloater(child_floater); } -// static -void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata) +void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) { if (names.empty() || ids.empty()) return; if(ids[0].notNull()) { - LLPanelRegionGeneralInfo* self = (LLPanelRegionGeneralInfo*)userdata; - if(!self) return; strings_t strings; // [0] = our agent id // [1] = target agent id @@ -626,7 +621,7 @@ void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& name strings.push_back(strings_t::value_type(buffer)); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - self->sendEstateOwnerMessage(gMessageSystem, "teleporthomeuser", invoice, strings); + sendEstateOwnerMessage(gMessageSystem, "teleporthomeuser", invoice, strings); } } @@ -790,7 +785,7 @@ BOOL LLPanelRegionDebugInfo::postBuild() initCtrl("disable_collisions_check"); initCtrl("disable_physics_check"); - childSetAction("choose_avatar_btn", onClickChooseAvatar, this); + childSetAction("choose_avatar_btn", boost::bind(&LLPanelRegionDebugInfo::onClickChooseAvatar, this)); childSetAction("return_btn", onClickReturn, this); childSetAction("top_colliders_btn", onClickTopColliders, this); childSetAction("top_scripts_btn", onClickTopScripts, this); @@ -842,19 +837,18 @@ BOOL LLPanelRegionDebugInfo::sendUpdate() return TRUE; } -void LLPanelRegionDebugInfo::onClickChooseAvatar(void* data) +void LLPanelRegionDebugInfo::onClickChooseAvatar() { - LLFloaterAvatarPicker::show(callbackAvatarID, data, FALSE, TRUE); + LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionDebugInfo::callbackAvatarID, this, _1, _2), FALSE, TRUE); } -// static -void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data) + +void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) { - LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*) data; if (ids.empty() || names.empty()) return; - self->mTargetAvatar = ids[0]; - self->childSetValue("target_avatar_name", LLSD(names[0])); - self->refreshFromRegion( gAgent.getRegion() ); + mTargetAvatar = ids[0]; + childSetValue("target_avatar_name", LLSD(names[0])); + refreshFromRegion( gAgent.getRegion() ); } // static @@ -1528,18 +1522,16 @@ struct LLKickFromEstateInfo LLUUID mAgentID; }; -void LLPanelEstateInfo::onClickKickUser(void *user_data) +void LLPanelEstateInfo::onClickKickUser() { - LLPanelEstateInfo* panelp = (LLPanelEstateInfo*)user_data; - // this depends on the grandparent view being a floater // in order to set up floater dependency - LLFloater* parent_floater = gFloaterView->getParentFloater(panelp); - LLFloater* child_floater = LLFloaterAvatarPicker::show(LLPanelEstateInfo::onKickUserCommit, user_data, FALSE, TRUE); + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1, _2), FALSE, TRUE); parent_floater->addDependentFloater(child_floater); } -void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata) +void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) { if (names.empty() || ids.empty()) return; @@ -1550,12 +1542,9 @@ void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, return; } - LLPanelEstateInfo* self = (LLPanelEstateInfo*)userdata; - if(!self) return; - //keep track of what user they want to kick and other misc info LLKickFromEstateInfo *kick_info = new LLKickFromEstateInfo(); - kick_info->mEstatePanelp = self; + kick_info->mEstatePanelp = this; kick_info->mAgentID = ids[0]; //Bring up a confirmation dialog @@ -1563,7 +1552,7 @@ void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, args["EVIL_USER"] = names[0]; LLSD payload; payload["agent_id"] = ids[0]; - LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, self, _1, _2)); + LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, this, _1, _2)); } @@ -1727,7 +1716,7 @@ bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& res LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]); // avatar picker yes multi-select, yes close-on-select - LLFloaterAvatarPicker::show(accessAddCore3, (void*)change_info, TRUE, TRUE); + LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, _2, (void*)change_info), TRUE, TRUE); return false; } @@ -2107,7 +2096,7 @@ BOOL LLPanelEstateInfo::postBuild() childSetAction("add_estate_manager_btn", onClickAddEstateManager, this); childSetAction("remove_estate_manager_btn", onClickRemoveEstateManager, this); childSetAction("message_estate_btn", onClickMessageEstate, this); - childSetAction("kick_user_from_estate_btn", onClickKickUser, this); + childSetAction("kick_user_from_estate_btn", boost::bind(&LLPanelEstateInfo::onClickKickUser, this)); childSetAction("WLEditSky", onClickEditSky, this); childSetAction("WLEditDayCycle", onClickEditDayCycle, this); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index a21b96bf16..8d315bdb78 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -167,8 +167,8 @@ public: protected: virtual BOOL sendUpdate(); - static void onClickKick(void* userdata); - static void onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata); + void onClickKick(); + void onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); static void onClickKickAll(void* userdata); bool onKickAllCommit(const LLSD& notification, const LLSD& response); static void onClickMessage(void* userdata); @@ -192,8 +192,8 @@ public: protected: virtual BOOL sendUpdate(); - static void onClickChooseAvatar(void*); - static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data); + void onClickChooseAvatar(); + void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); static void onClickReturn(void *); bool callbackReturn(const LLSD& notification, const LLSD& response); static void onClickTopColliders(void*); @@ -275,7 +275,7 @@ public: static void onClickRemoveBannedAgent(void* user_data); static void onClickAddEstateManager(void* user_data); static void onClickRemoveEstateManager(void* user_data); - static void onClickKickUser(void* userdata); + void onClickKickUser(); // Group picker callback is different, can't use core methods below bool addAllowedGroup(const LLSD& notification, const LLSD& response); @@ -296,7 +296,7 @@ public: // Send the actual EstateOwnerRequest "estateaccessdelta" message static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id); - static void onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata); + void onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); static void onClickMessageEstate(void* data); bool onMessageCommit(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 9f3dcae8ef..e0f2fca580 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -57,7 +57,6 @@ #include "llfloaterreg.h" #include "lltexturectrl.h" #include "llscrolllistctrl.h" -#include "llimview.h" #include "lldispatcher.h" #include "llviewerobject.h" #include "llviewerregion.h" @@ -173,7 +172,7 @@ BOOL LLFloaterReporter::postBuild() std::string("tool_face_active.tga") ); childSetAction("pick_btn", onClickObjPicker, this); - childSetAction("select_abuser", onClickSelectAbuser, this); + childSetAction("select_abuser", boost::bind(&LLFloaterReporter::onClickSelectAbuser, this)); childSetAction("send_btn", onClickSend, this); childSetAction("cancel_btn", onClickCancel, this); @@ -307,26 +306,20 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) } -// static -void LLFloaterReporter::onClickSelectAbuser(void *userdata) +void LLFloaterReporter::onClickSelectAbuser() { - LLFloaterReporter *self = (LLFloaterReporter *)userdata; - - gFloaterView->getParentFloater(self)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, userdata, FALSE, TRUE )); + gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE )); } -// static -void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data) +void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) { - LLFloaterReporter* self = (LLFloaterReporter*) data; - if (ids.empty() || names.empty()) return; - self->childSetText("abuser_name_edit", names[0] ); + childSetText("abuser_name_edit", names[0] ); - self->mAbuserID = ids[0]; + mAbuserID = ids[0]; - self->refresh(); + refresh(); } diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index a3776f3d27..cc2dfb2f98 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -97,7 +97,7 @@ public: static void onClickSend (void *userdata); static void onClickCancel (void *userdata); static void onClickObjPicker (void *userdata); - static void onClickSelectAbuser (void *userdata); + void onClickSelectAbuser (); static void closePickTool (void *userdata); static void uploadDoneCallback(const LLUUID &uuid, void* user_data, S32 result, LLExtStat ext_status); static void addDescription(const std::string& description, LLMeanCollisionData *mcd = NULL); @@ -120,7 +120,7 @@ private: void setPosBox(const LLVector3d &pos); void enableControls(BOOL own_avatar); void getObjectInfo(const LLUUID& object_id); - static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data); + void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); private: EReportType mReportType; diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index e5260aa7b9..e2b0c4b66f 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -89,14 +89,14 @@ private: void setBadge(const char* id, Badge badge); static void onChangeValue(LLUICtrl *ctrl, void *userdata); - static void doSelectAgent(void *userdata); + void doSelectAgent(); static void doCancel(void *userdata); static void doSellLand(void *userdata); bool onConfirmSale(const LLSD& notification, const LLSD& response); static void doShowObjects(void *userdata); static bool callbackHighlightTransferable(const LLSD& notification, const LLSD& response); - static void callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data); + void callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); public: virtual BOOL postBuild(); @@ -165,7 +165,7 @@ BOOL LLFloaterSellLandUI::postBuild() childSetCommitCallback("price", onChangeValue, this); childSetPrevalidate("price", LLLineEditor::prevalidateNonNegativeS32); childSetCommitCallback("sell_objects", onChangeValue, this); - childSetAction("sell_to_select_agent", doSelectAgent, this); + childSetAction("sell_to_select_agent", boost::bind( &LLFloaterSellLandUI::doSelectAgent, this)); childSetAction("cancel_btn", doCancel, this); childSetAction("sell_btn", doSellLand, this); childSetAction("show_objects", doShowObjects, this); @@ -361,7 +361,7 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata) self->mSellToBuyer = true; if (self->mAuthorizedBuyer.isNull()) { - doSelectAgent(self); + self->doSelectAgent(); } } else if (sell_to == "anyone") @@ -384,30 +384,26 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata) self->refreshUI(); } -// static -void LLFloaterSellLandUI::doSelectAgent(void *userdata) +void LLFloaterSellLandUI::doSelectAgent() { - LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)userdata; // grandparent is a floater, in order to set up dependency - floaterp->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarPick, floaterp, FALSE, TRUE)); + addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE)); } -// static -void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data) +void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) { - LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)data; - LLParcel* parcel = floaterp->mParcelSelection->getParcel(); + LLParcel* parcel = mParcelSelection->getParcel(); if (names.empty() || ids.empty()) return; LLUUID id = ids[0]; parcel->setAuthorizedBuyerID(id); - floaterp->mAuthorizedBuyer = ids[0]; + mAuthorizedBuyer = ids[0]; - floaterp->childSetText("sell_to_agent", names[0]); + childSetText("sell_to_agent", names[0]); - floaterp->refreshUI(); + refreshUI(); } // static diff --git a/indra/newview/llgroupiconctrl.cpp b/indra/newview/llgroupiconctrl.cpp new file mode 100644 index 0000000000..0b03d49cbc --- /dev/null +++ b/indra/newview/llgroupiconctrl.cpp @@ -0,0 +1,145 @@ +/** + * @file llgroupiconctrl.cpp + * @brief LLGroupIconCtrl class implementation + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llgroupiconctrl.h" + +#include "llagent.h" +/* +#include "llavatarconstants.h" +#include "llcallingcard.h" // for LLAvatarTracker +#include "llavataractions.h" +#include "llmenugl.h" +#include "lluictrlfactory.h" + +#include "llcachename.h" +#include "llagentdata.h" +#include "llimfloater.h" +*/ + +static LLDefaultChildRegistry::Register<LLGroupIconCtrl> g_i("group_icon"); + +LLGroupIconCtrl::Params::Params() +: group_id("group_id") +, draw_tooltip("draw_tooltip", true) +, default_icon_name("default_icon_name") +{ +} + + +LLGroupIconCtrl::LLGroupIconCtrl(const LLGroupIconCtrl::Params& p) +: LLIconCtrl(p) +, mGroupId(LLUUID::null) +, mDrawTooltip(p.draw_tooltip) +, mDefaultIconName(p.default_icon_name) +{ + mPriority = LLViewerFetchedTexture::BOOST_ICON; + + if (p.group_id.isProvided()) + { + LLSD value(p.group_id); + setValue(value); + } + else + { + LLIconCtrl::setValue(mDefaultIconName); + } +} + +LLGroupIconCtrl::~LLGroupIconCtrl() +{ + LLGroupMgr::getInstance()->removeObserver(this); +} + +void LLGroupIconCtrl::setValue(const LLSD& value) +{ + if (value.isUUID()) + { + LLGroupMgr* gm = LLGroupMgr::getInstance(); + if (mGroupId.notNull()) + { + gm->removeObserver(this); + } + + if (mGroupId != value.asUUID()) + { + mGroupId = value.asUUID(); + + // Check if cache already contains image_id for that group + if (!updateFromCache()) + { + LLIconCtrl::setValue(mDefaultIconName); + gm->addObserver(this); + gm->sendGroupPropertiesRequest(mGroupId); + } + } + } + else + { + LLIconCtrl::setValue(value); + } +} + +void LLGroupIconCtrl::changed(LLGroupChange gc) +{ + if (GC_PROPERTIES == gc) + { + updateFromCache(); + } +} + +bool LLGroupIconCtrl::updateFromCache() +{ + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mGroupId); + if (!group_data) return false; + + if (group_data->mInsigniaID.notNull()) + { + LLIconCtrl::setValue(group_data->mInsigniaID); + } + else + { + LLIconCtrl::setValue(mDefaultIconName); + } + + if (mDrawTooltip && !group_data->mName.empty()) + { + setToolTip(group_data->mName); + } + else + { + setToolTip(LLStringUtil::null); + } + return true; +} + diff --git a/indra/newview/llgroupiconctrl.h b/indra/newview/llgroupiconctrl.h new file mode 100644 index 0000000000..7ac2ca0219 --- /dev/null +++ b/indra/newview/llgroupiconctrl.h @@ -0,0 +1,92 @@ +/** + * @file llgroupiconctrl.h + * @brief LLGroupIconCtrl class declaration + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLGROUPICONCTRL_H +#define LL_LLGROUPICONCTRL_H + +#include "lliconctrl.h" + +#include "llgroupmgr.h" + +/** + * Extends IconCtrl to show group icon wherever it is needed. + * + * It gets icon id by group id from the LLGroupMgr. + * If group data is not loaded yet it subscribes as LLGroupMgr observer and requests necessary data. + */ +class LLGroupIconCtrl + : public LLIconCtrl, public LLGroupMgrObserver +{ +public: + struct Params : public LLInitParam::Block<Params, LLIconCtrl::Params> + { + Optional <LLUUID> group_id; + Optional <bool> draw_tooltip; + Optional <std::string> default_icon_name; + Params(); + }; + +protected: + LLGroupIconCtrl(const Params&); + friend class LLUICtrlFactory; + +public: + virtual ~LLGroupIconCtrl(); + + /** + * Determines group icon id by group id and sets it as icon value. + * + * Icon id is got from the appropriate LLGroupMgrGroupData specified by group UUID. + * If necessary it requests necessary data from the LLGroupMgr. + * + * @params value - if LLUUID - it is processed as group id otherwise base method is called. + */ + virtual void setValue(const LLSD& value); + + // LLGroupMgrObserver observer trigger + virtual void changed(LLGroupChange gc); + + const std::string& getGroupName() const { return mGroupName; } + void setDrawTooltip(bool value) { mDrawTooltip = value;} + + const LLUUID& getGroupId() const { return mGroupId; } + +protected: + LLUUID mGroupId; + std::string mGroupName; + bool mDrawTooltip; + std::string mDefaultIconName; + + bool updateFromCache(); +}; + +#endif // LL_LLGROUPICONCTRL_H diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 8b6762ce38..4b45a9aba9 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -57,13 +57,11 @@ #include "llfloateractivespeakers.h" #include "llfloatercall.h" #include "llavataractions.h" -#include "llimview.h" #include "llinventory.h" #include "llinventorymodel.h" #include "llfloaterinventory.h" #include "llfloaterchat.h" #include "lliconctrl.h" -#include "llimview.h" // for LLIMModel to get other avatar id in chat #include "llkeyboard.h" #include "lllineeditor.h" #include "llpanelimcontrolpanel.h" diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index b8f99d45c9..abbf1e68ab 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -33,7 +33,6 @@ #ifndef LL_IMPANEL_H #define LL_IMPANEL_H -#include "llimview.h" //for LLIMModel #include "lldockablefloater.h" #include "lllogchat.h" #include "lluuid.h" diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 37ab144934..a7ce027416 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -57,6 +57,7 @@ #include "llhttpnode.h" #include "llimfloater.h" #include "llimpanel.h" +#include "llgroupiconctrl.h" #include "llresizebar.h" #include "lltabcontainer.h" #include "llviewercontrol.h" @@ -1495,6 +1496,34 @@ void LLCallDialog::draw() } } +void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) +{ + // *NOTE: 12/28/2009: check avaline calls: LLVoiceClient::isParticipantAvatar returns false for them + bool participant_is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id); + + bool is_group = participant_is_avatar && gAgent.isInGroup(session_id); + + LLAvatarIconCtrl* avatar_icon = getChild<LLAvatarIconCtrl>("avatar_icon"); + LLGroupIconCtrl* group_icon = getChild<LLGroupIconCtrl>("group_icon"); + + avatar_icon->setVisible(!is_group); + group_icon->setVisible(is_group); + + if (is_group) + { + group_icon->setValue(session_id); + } + else if (participant_is_avatar) + { + avatar_icon->setValue(participant_id); + } + else + { + avatar_icon->setValue("Avaline_Icon"); + avatar_icon->setToolTip(std::string("")); + } +} + bool LLOutgoingCallDialog::lifetimeHasExpired() { if (mLifetimeTimer.getStarted()) @@ -1556,8 +1585,9 @@ void LLOutgoingCallDialog::show(const LLSD& key) LLSD callee_id = mPayload["other_user_id"]; childSetTextArg("calling", "[CALLEE_NAME]", callee_name); childSetTextArg("connecting", "[CALLEE_NAME]", callee_name); - LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); - icon->setValue(callee_id); + + // for outgoing group calls callee_id == group id == session id + setIcon(callee_id, callee_id); // stop timer by default mLifetimeTimer.stop(); @@ -1711,15 +1741,7 @@ BOOL LLIncomingCallDialog::postBuild() LLUICtrl* caller_name_widget = getChild<LLUICtrl>("caller name"); caller_name_widget->setValue(caller_name + " " + call_type); - LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); - if (is_avatar) - { - icon->setValue(caller_id); - } - else - { - icon->setValue("Avaline_Icon"); - } + setIcon(session_id, caller_id); childSetAction("Accept", onAccept, this); childSetAction("Reject", onReject, this); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index cec9d1642f..11860d0efb 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -501,6 +501,17 @@ protected: virtual void onLifetimeExpired() {}; virtual void getAllowedRect(LLRect& rect); + + /** + * Sets icon depend on session. + * + * If passed session_id is a group id group icon will be shown, otherwise avatar icon for participant_id + * + * @param session_id - UUID of session + * @param participant_id - UUID of other participant + */ + void setIcon(const LLSD& session_id, const LLSD& participant_id); + LLSD mPayload; }; diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 98ca339f0c..404e266806 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -634,6 +634,8 @@ void LLLocationInputCtrl::refreshLocation() { location_name = "???"; } + // store human-readable location to compare it in changeLocationPresentation() + mHumanReadableLocation = location_name; setText(location_name); } @@ -823,11 +825,11 @@ void LLLocationInputCtrl::updateWidgetlayout() void LLLocationInputCtrl::changeLocationPresentation() { - //change location presentation only if user does not select anything and + //change location presentation only if user does not select/past anything and //human-readable region name is being displayed std::string text = mTextEntry->getText(); LLStringUtil::trim(text); - if(mTextEntry && !mTextEntry->hasSelection() && !LLSLURL::isSLURL(text)) + if(mTextEntry && !mTextEntry->hasSelection() && text == mHumanReadableLocation ) { //needs unescaped one mTextEntry->setText(LLAgentUI::buildSLURL(false)); diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 0211062b05..7959fab2de 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -169,6 +169,8 @@ private: std::string mAddLandmarkTooltip; std::string mEditLandmarkTooltip; + // this field holds a human-readable form of the location string, it is needed to be able to compare copy-pated value and real location + std::string mHumanReadableLocation; }; #endif diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 913152e259..f3d6dbbb46 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -331,6 +331,33 @@ void LLPanelAvatarNotes::onShareButtonClick() //*TODO not implemented. } +LLPanelAvatarNotes::~LLPanelAvatarNotes() +{ + if(getAvatarId().notNull()) + { + LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); + } +} + +// virtual, called by LLAvatarTracker +void LLPanelAvatarNotes::changed(U32 mask) +{ + childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); +} + +void LLPanelAvatarNotes::setAvatarId(const LLUUID& id) +{ + if(id.notNull()) + { + if(getAvatarId().notNull()) + { + LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); + } + LLPanelProfileTab::setAvatarId(id); + LLAvatarTracker::instance().addParticularFriendObserver(getAvatarId(), this); + } +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -396,9 +423,18 @@ void LLPanelProfileTab::onMapButtonClick() void LLPanelProfileTab::updateButtons() { - bool enable_map_btn = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()) - && gAgent.isGodlike() || is_agent_mappable(getAvatarId()); + bool is_avatar_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()); + + if(LLAvatarActions::isFriend(getAvatarId())) + { + childSetEnabled("teleport", is_avatar_online); + } + else + { + childSetEnabled("teleport", true); + } + bool enable_map_btn = is_avatar_online && gAgent.isGodlike() || is_agent_mappable(getAvatarId()); childSetEnabled("show_on_map_btn", enable_map_btn); childSetEnabled("call", LLAvatarActions::canCall(getAvatarId())); } @@ -716,6 +752,33 @@ void LLPanelAvatarProfile::onOverflowButtonClicked() LLMenuGL::showPopup(this, mProfileMenu, rect.mRight, rect.mTop); } +LLPanelAvatarProfile::~LLPanelAvatarProfile() +{ + if(getAvatarId().notNull()) + { + LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); + } +} + +// virtual, called by LLAvatarTracker +void LLPanelAvatarProfile::changed(U32 mask) +{ + childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); +} + +void LLPanelAvatarProfile::setAvatarId(const LLUUID& id) +{ + if(id.notNull()) + { + if(getAvatarId().notNull()) + { + LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); + } + LLPanelProfileTab::setAvatarId(id); + LLAvatarTracker::instance().addParticularFriendObserver(getAvatarId(), this); + } +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 8f07c67fb1..22efa5dc35 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -35,6 +35,7 @@ #include "llpanel.h" #include "llavatarpropertiesprocessor.h" +#include "llcallingcard.h" class LLComboBox; class LLLineEditor; @@ -120,13 +121,22 @@ private: */ class LLPanelAvatarProfile : public LLPanelProfileTab + , public LLFriendObserver { public: LLPanelAvatarProfile(); + /*virtual*/ ~LLPanelAvatarProfile(); /*virtual*/ void onOpen(const LLSD& key); /** + * LLFriendObserver trigger + */ + virtual void changed(U32 mask); + + /*virtual*/ void setAvatarId(const LLUUID& id); + + /** * Processes data received from server. */ /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); @@ -246,9 +256,18 @@ private: */ class LLPanelAvatarNotes : public LLPanelProfileTab + , public LLFriendObserver { public: LLPanelAvatarNotes(); + /*virtual*/ ~LLPanelAvatarNotes(); + + virtual void setAvatarId(const LLUUID& id); + + /** + * LLFriendObserver trigger + */ + virtual void changed(U32 mask); /*virtual*/ void onOpen(const LLSD& key); diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index ae703ebd8e..362657a458 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -171,7 +171,7 @@ void LLPanelBlockedList::onPickBtnClick() { const BOOL allow_multiple = FALSE; const BOOL close_on_select = TRUE; - /*LLFloaterAvatarPicker* picker = */LLFloaterAvatarPicker::show(callbackBlockPicked, this, allow_multiple, close_on_select); + /*LLFloaterAvatarPicker* picker = */LLFloaterAvatarPicker::show(boost::bind(&LLPanelBlockedList::callbackBlockPicked, this, _1, _2), allow_multiple, close_on_select); // *TODO: mantipov: should LLFloaterAvatarPicker be closed when panel is closed? // old Floater dependency is not enable in panel @@ -183,8 +183,7 @@ void LLPanelBlockedList::onBlockByNameClick() LLFloaterGetBlockedObjectName::show(&LLPanelBlockedList::callbackBlockByName); } -//static -void LLPanelBlockedList::callbackBlockPicked(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data) +void LLPanelBlockedList::callbackBlockPicked(const std::vector<std::string>& names, const std::vector<LLUUID>& ids) { if (names.empty() || ids.empty()) return; LLMute mute(ids[0], names[0], LLMute::AGENT); diff --git a/indra/newview/llpanelblockedlist.h b/indra/newview/llpanelblockedlist.h index 0993f46f79..1ef16a02f4 100644 --- a/indra/newview/llpanelblockedlist.h +++ b/indra/newview/llpanelblockedlist.h @@ -78,7 +78,7 @@ private: void onPickBtnClick(); void onBlockByNameClick(); - static void callbackBlockPicked(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data); + void callbackBlockPicked(const std::vector<std::string>& names, const std::vector<LLUUID>& ids); static void callbackBlockByName(const std::string& text); private: diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 375ee0fdc4..06a682c905 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -292,8 +292,8 @@ void LLPanelGroupInvite::impl::callbackClickAdd(void* userdata) LLFloater* parentp; parentp = gFloaterView->getParentFloater(panelp); - parentp->addDependentFloater(LLFloaterAvatarPicker::show(callbackAddUsers, - panelp->mImplementation, + parentp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(impl::callbackAddUsers, _1, _2, + panelp->mImplementation), TRUE)); } } diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index a8a75a1feb..279818d52f 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -184,6 +184,12 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) // Disable "Add friend" button for friends. childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); + + // Disable "Teleport" button if friend is offline + if(LLAvatarActions::isFriend(mAvatarID)) + { + childSetEnabled("teleport_btn", LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); + } getChild<LLAvatarIconCtrl>("avatar_icon")->setValue(mAvatarID); @@ -214,6 +220,12 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) void LLPanelIMControlPanel::changed(U32 mask) { childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); + + // Disable "Teleport" button if friend is offline + if(LLAvatarActions::isFriend(mAvatarID)) + { + childSetEnabled("teleport_btn", LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); + } } void LLPanelIMControlPanel::nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 961d3dec8b..e74a39c85c 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -35,6 +35,7 @@ #include "llagent.h" #include "lldndbutton.h" +#include "lleconomy.h" #include "llfilepicker.h" #include "llfloaterinventory.h" #include "llinventorybridge.h" @@ -97,7 +98,8 @@ LLPanelMainInventory::LLPanelMainInventory() mSavedFolderState(NULL), mFilterText(""), mMenuGearDefault(NULL), - mMenuAdd(NULL) + mMenuAdd(NULL), + mNeedUploadCost(true) { LLMemType mt(LLMemType::MTYPE_INVENTORY_VIEW_INIT); // Menu Callbacks (non contex menus) @@ -895,6 +897,8 @@ void LLPanelMainInventory::onGearButtonClick() void LLPanelMainInventory::onAddButtonClick() { + setUploadCostIfNeeded(); + showActionMenu(mMenuAdd,"add_btn"); } @@ -1131,5 +1135,39 @@ bool LLPanelMainInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropType return true; } +void LLPanelMainInventory::setUploadCostIfNeeded() +{ + // *NOTE dzaporozhan + // Upload cost is set in process_economy_data() (llviewermessage.cpp). But since we + // have two instances of Inventory panel at the moment(and two instances of context menu), + // call to gMenuHolder->childSetLabelArg() sets upload cost only for one of the instances. + + if(mNeedUploadCost && mMenuAdd) + { + LLMenuItemBranchGL* upload_menu = mMenuAdd->findChild<LLMenuItemBranchGL>("upload"); + if(upload_menu) + { + S32 upload_cost = -1;//LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + std::string cost_str; + + // getPriceUpload() returns -1 if no data available yet. + if(upload_cost >= 0) + { + mNeedUploadCost = false; + cost_str = llformat("%d", upload_cost); + } + else + { + cost_str = llformat("%d", gSavedSettings.getU32("DefaultUploadCost")); + } + + upload_menu->getChild<LLView>("Upload Image")->setLabelArg("[COST]", cost_str); + upload_menu->getChild<LLView>("Upload Sound")->setLabelArg("[COST]", cost_str); + upload_menu->getChild<LLView>("Upload Animation")->setLabelArg("[COST]", cost_str); + upload_menu->getChild<LLView>("Bulk Upload")->setLabelArg("[COST]", cost_str); + } + } +} + // List Commands // //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 69f8a14583..d9ea0da2da 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -139,10 +139,16 @@ protected: BOOL isActionEnabled(const LLSD& command_name); void onCustomAction(const LLSD& command_name); bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); + /** + * Set upload cost in "Upload" sub menu. + */ + void setUploadCostIfNeeded(); private: LLPanel* mListCommands; LLMenuGL* mMenuGearDefault; LLMenuGL* mMenuAdd; + + bool mNeedUploadCost; // List Commands // //////////////////////////////////////////////////////////////////////////////// }; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 5cc4d4aec6..249a9ca1a0 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1069,7 +1069,7 @@ bool LLPanelPeople::isItemsFreeOfFriends(const std::vector<LLUUID>& uuids) void LLPanelPeople::onAddFriendWizButtonClicked() { // Show add friend wizard. - LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onAvatarPicked, NULL, FALSE, TRUE); + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelPeople::onAvatarPicked, _1, _2), FALSE, TRUE); // Need to disable 'ok' button when friend occurs in selection if (picker) picker->setOkBtnEnableCb(boost::bind(&LLPanelPeople::isItemsFreeOfFriends, this, _1)); LLFloater* root_floater = gFloaterView->getParentFloater(this); @@ -1130,8 +1130,7 @@ void LLPanelPeople::onActivateButtonClicked() // static void LLPanelPeople::onAvatarPicked( const std::vector<std::string>& names, - const std::vector<LLUUID>& ids, - void*) + const std::vector<LLUUID>& ids) { if (!names.empty() && !ids.empty()) LLAvatarActions::requestFriendshipDialog(ids[0], names[0]); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 0d2bae1baf..da2c0e368c 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -129,8 +129,7 @@ private: // misc callbacks static void onAvatarPicked( const std::vector<std::string>& names, - const std::vector<LLUUID>& ids, - void*); + const std::vector<LLUUID>& ids); void onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list); diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 330e220af3..db4f9a2d95 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -36,7 +36,6 @@ #include "lltrans.h" #include "llavataractions.h" #include "llagent.h" -#include "llimview.h" #include "llparticipantlist.h" #include "llspeakers.h" diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index d15ec980db..70badbc40d 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -33,7 +33,6 @@ #include "llviewerprecompiledheaders.h" #include "llevent.h" #include "llpanelpeoplemenus.h" -#include "llimview.h" #include "llavatarlist.h" // for LLAvatarItemRecentSpeakerComparator class LLSpeakerMgr; diff --git a/indra/newview/llsidetraypanelcontainer.cpp b/indra/newview/llsidetraypanelcontainer.cpp index 3024492ab9..f2215a2250 100644 --- a/indra/newview/llsidetraypanelcontainer.cpp +++ b/indra/newview/llsidetraypanelcontainer.cpp @@ -38,6 +38,7 @@ static LLDefaultChildRegistry::Register<LLSideTrayPanelContainer> r2("panel_cont std::string LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME = "sub_panel_name"; LLSideTrayPanelContainer::Params::Params() + : default_panel_name("default_panel_name") { // Always hide tabs. hide_tabs(true); @@ -45,6 +46,7 @@ LLSideTrayPanelContainer::Params::Params() LLSideTrayPanelContainer::LLSideTrayPanelContainer(const Params& p) : LLTabContainer(p) + , mDefaultPanelName(p.default_panel_name) { } @@ -53,19 +55,14 @@ void LLSideTrayPanelContainer::onOpen(const LLSD& key) // Select specified panel and save navigation history. if(key.has(PARAM_SUB_PANEL_NAME)) { + //*NOTE dzaporozhan + // Navigation history is not used after fix for EXT-3186, + // openPreviousPanel() always opens default panel + // Save panel navigation history std::string panel_name = key[PARAM_SUB_PANEL_NAME]; - S32 old_index = getCurrentPanelIndex(); selectTabByName(panel_name); - - S32 new_index = getCurrentPanelIndex(); - - // Don't update navigation history if we are opening same panel again. - if(old_index != new_index) - { - mPanelHistory[panel_name] = old_index; - } } // Will reopen current panel if no panel name was passed. getCurrentPanel()->onOpen(key); @@ -73,11 +70,13 @@ void LLSideTrayPanelContainer::onOpen(const LLSD& key) void LLSideTrayPanelContainer::openPreviousPanel() { - std::string current_panel_name = getCurrentPanel()->getName(); - panel_navigation_history_t::const_iterator it = mPanelHistory.find(current_panel_name); - if(mPanelHistory.end() != it) + if(!mDefaultPanelName.empty()) + { + selectTabByName(mDefaultPanelName); + } + else { - selectTab(it->second); + selectTab(0); } } diff --git a/indra/newview/llsidetraypanelcontainer.h b/indra/newview/llsidetraypanelcontainer.h index 3f3cb552f8..beed328269 100644 --- a/indra/newview/llsidetraypanelcontainer.h +++ b/indra/newview/llsidetraypanelcontainer.h @@ -51,6 +51,7 @@ public: struct Params : public LLInitParam::Block<Params, LLTabContainer::Params> { + Optional<std::string> default_panel_name; Params(); }; @@ -90,6 +91,7 @@ protected: // Navigation history panel_navigation_history_t mPanelHistory; + std::string mDefaultPanelName; }; #endif //LL_LLSIDETRAY_PANEL_CONTAINER_H diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 23c4f00ab7..5ce3bbb9f6 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -50,7 +50,6 @@ #include "llkeyboard.h" #include "lllineeditor.h" #include "llmenugl.h" -#include "llimview.h" #include "llsd.h" #include "lltextbox.h" #include "llui.h" @@ -226,14 +225,6 @@ LLStatusBar::~LLStatusBar() void LLStatusBar::draw() { refresh(); - - if (isBackgroundVisible()) - { - static LLUICachedControl<S32> drop_shadow_floater ("DropShadowFloater", 0); - static LLUIColor color_drop_shadow = LLUIColorTable::instance().getColor("ColorDropShadow"); - gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, - color_drop_shadow, drop_shadow_floater ); - } LLPanel::draw(); } diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index bcaefc3690..26d8338b24 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -52,7 +52,7 @@ #include "llspeakers.h" //--------------------------------------------------------------------------------- -LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLDockableFloater(NULL, key), +LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLTransientDockableFloater(NULL, true, key), mChannel(NULL), mMessageList(NULL), mSysWellChiclet(NULL), @@ -90,13 +90,13 @@ BOOL LLSysWellWindow::postBuild() // mouse up callback is not called in this case. setMouseDownCallback(boost::bind(&LLSysWellWindow::releaseNewMessagesState, this)); - return LLDockableFloater::postBuild(); + return LLTransientDockableFloater::postBuild(); } //--------------------------------------------------------------------------------- void LLSysWellWindow::setMinimized(BOOL minimize) { - LLDockableFloater::setMinimized(minimize); + LLTransientDockableFloater::setMinimized(minimize); } //--------------------------------------------------------------------------------- @@ -176,7 +176,7 @@ void LLSysWellWindow::setVisible(BOOL visible) // do not show empty window if (NULL == mMessageList || isWindowEmpty()) visible = FALSE; - LLDockableFloater::setVisible(visible); + LLTransientDockableFloater::setVisible(visible); // update notification channel state if(mChannel) @@ -192,15 +192,9 @@ void LLSysWellWindow::setVisible(BOOL visible) } //--------------------------------------------------------------------------------- -void LLSysWellWindow::onFocusLost() -{ - setVisible(false); -} - -//--------------------------------------------------------------------------------- void LLSysWellWindow::setDocked(bool docked, bool pop_on_undock) { - LLDockableFloater::setDocked(docked, pop_on_undock); + LLTransientDockableFloater::setDocked(docked, pop_on_undock); // update notification channel state if(mChannel) diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 7030f4b427..d21d095d1a 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -35,7 +35,7 @@ #include "llsyswellitem.h" -#include "lldockablefloater.h" +#include "lltransientdockablefloater.h" #include "llbutton.h" #include "llscreenchannel.h" #include "llscrollcontainer.h" @@ -50,7 +50,7 @@ class LLScriptChiclet; class LLSysWellChiclet; -class LLSysWellWindow : public LLDockableFloater +class LLSysWellWindow : public LLTransientDockableFloater { public: LLSysWellWindow(const LLSD& key); @@ -72,11 +72,6 @@ public: // override LLFloater's minimization according to EXT-1216 /*virtual*/ void setMinimized(BOOL minimize); - /** - * Hides window when user clicks away from it (EXT-3084) - */ - /*virtual*/ void onFocusLost(); - void onStartUpToastClick(S32 x, S32 y, MASK mask); void setSysWellChiclet(LLSysWellChiclet* chiclet) { mSysWellChiclet = chiclet; } diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 2a56b2cd3a..96d1624cd4 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -245,7 +245,7 @@ void LLToast::setVisible(BOOL show) if(show) { setBackgroundOpaque(TRUE); - if(!mTimer.getStarted()) + if(!mTimer.getStarted() && mCanFade) { mTimer.start(); } @@ -266,8 +266,6 @@ void LLToast::onMouseEnter(S32 x, S32 y, MASK mask) { mOnToastHoverSignal(this, MOUSE_ENTER); - setBackgroundOpaque(TRUE); - //toasts fading is management by Screen Channel sendChildToFront(mHideBtn); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 2a9c738c97..15855f154d 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -70,6 +70,7 @@ #include "lltooltip.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" +#include "llimview.h" #include "llinventorybridge.h" #include "llpanellogin.h" #include "llpanelblockedlist.h" diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 87045d2abf..f9f778449b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llviewermessage.h" +#include "llanimationstates.h" #include "llaudioengine.h" #include "lscript_byteformat.h" #include "lleconomy.h" @@ -3941,6 +3942,16 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data) avatarp->mSignaledAnimations[animation_id] = anim_sequence_id; + // *HACK: Disabling flying mode if it has been enabled shortly before the agent + // stand up animation is signaled. In this case we don't get a signal to start + // flying animation from server, the AGENT_CONTROL_FLY flag remains set but the + // avatar does not play flying animation, so we switch flying mode off. + // See LLAgent::setFlying(). This may cause "Stop Flying" button to blink. + if (animation_id == ANIM_AGENT_STANDUP && gAgent.getFlying()) + { + gAgent.setFlying(FALSE); + } + if (i < num_source_blocks) { mesgsys->getUUIDFast(_PREHASH_AnimationSourceList, _PREHASH_ObjectID, object_id, i); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 95db84cb32..b5f6109b1b 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -574,6 +574,8 @@ with the same filename but different name <texture name="Toast_CloseBtn" file_name="windows/Toast_CloseBtn.png" preload="true" /> <texture name="Toast_Background" file_name="windows/Toast_Background.png" preload="true" scale.left="4" scale.top="28" scale.right="60" scale.bottom="4" /> + <texture name="Toast_Over" file_name="windows/Toast_Over.png" preload="true" + scale.left="4" scale.top="28" scale.right="60" scale.bottom="4" /> <texture name="Tool_Create" file_name="build/Tool_Create.png" preload="false" /> <texture name="Tool_Dozer" file_name="build/Tool_Dozer.png" preload="false" /> diff --git a/indra/newview/skins/default/xui/en/favorites_bar_button.xml b/indra/newview/skins/default/xui/en/favorites_bar_button.xml index 361f5a7bc8..dcf9847adb 100644 --- a/indra/newview/skins/default/xui/en/favorites_bar_button.xml +++ b/indra/newview/skins/default/xui/en/favorites_bar_button.xml @@ -3,6 +3,7 @@ <!-- All buttons in the Favorites bar will be created from this one --> <button follows="left|bottom" + font_halign="center" halign="center" height="15" image_disabled="transparent.j2c" @@ -14,10 +15,14 @@ image_pressed="Favorite_Link_Over" image_pressed_selected="Favorite_Link_Over" hover_glow_amount="0.15" + label_shadow="false" layout="topleft" left="0" name="favorites_bar_btn" + pad_bottom="-1" + pad_left="11" + pad_right="7" tab_stop="false" top="0" use_ellipses="true" - width="120" /> + width="140" /> 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 b9ce11600f..1d67123726 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -43,6 +43,13 @@ left_delta="19" top="35" width="36" /> + <group_icon + enabled="false" + follows="left|top" + height="36" + layout="topleft" + top="35" + width="36" /> <text clip_partial="true" font="SansSerifLarge" 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 104ac2143f..eb772cc0bd 100644 --- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -39,6 +39,13 @@ left_delta="19" top="35" width="36" /> + <group_icon + enabled="false" + follows="left|top" + height="36" + layout="topleft" + top="35" + width="36" /> <text font="SansSerifLarge" height="20" diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 474b703ae5..47fd03b8f6 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -5,7 +5,7 @@ can_close="false" height="270" layout="topleft" - min_height="146" + min_height="122" min_width="190" name="floater_voice_controls" title="Voice Controls" @@ -32,6 +32,10 @@ name="no_one_near"> No one near </string> + <string + name="max_visible_items"> + 5 + </string> <panel bevel_style="out" border="true" diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 00eba94f47..1ade66f2dd 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -252,7 +252,7 @@ top="0" name="chiclet_list_panel" width="189" - min_width="100" + min_width="110" user_resize="false" auto_resize="true"> <!--*NOTE: min_width of the chiclet_panel (chiclet_list) must be the same diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index bbf86089cb..be3c0bbd96 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -293,7 +293,7 @@ right="-10" name="partner_edit_link" value="[[URL] Edit]" - width="150" /> + width="50" /> <panel follows="left|top|right" height="15" diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml index d51893793c..10381d3987 100644 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -37,7 +37,7 @@ height="485" layout="topleft" name="profile_scroll" - reserve_scroll_corner="true" + reserve_scroll_corner="false" opaque="true" top="0" width="313"> @@ -48,7 +48,7 @@ layout="topleft" top="0" left="0" - width="313"> + width="297"> <panel follows="left|top" height="117" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 41bd7f3dcc..c98555735a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -329,10 +329,9 @@ text_readonly_color="LabelDisabledColor" bg_writeable_color="LtGray" use_ellipses="false" - bg_visible="false" - border_visible="false" + bg_visible="true" + border_visible="true" hover="false" - text_color="LabelTextColor" commit_on_focus_lost = "true" follows="left|top" height="50" diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index 63b7112c17..4565663bba 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -42,6 +42,7 @@ > <panel_container name="panel_container" + default_panel_name="panel_people" width="333" > <panel diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml index 707b24c92c..ba2d61afb7 100644 --- a/indra/newview/skins/default/xui/en/panel_toast.xml +++ b/indra/newview/skins/default/xui/en/panel_toast.xml @@ -14,7 +14,7 @@ left="0" top="0" follows="right|bottom" - bg_opaque_image="Toast_Background" + bg_opaque_image="Toast_Over" bg_alpha_image="Toast_Background" can_minimize="false" can_tear_off="false" diff --git a/indra/newview/skins/default/xui/en/widgets/group_icon.xml b/indra/newview/skins/default/xui/en/widgets/group_icon.xml new file mode 100644 index 0000000000..58d5e19fcc --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/group_icon.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<group_icon + default_icon_name="Generic_Group" + image_name="Generic_Group" + name="group_icon" /> diff --git a/indra/newview/skins/default/xui/en/widgets/talk_button.xml b/indra/newview/skins/default/xui/en/widgets/talk_button.xml index 7781bdd066..68cf082c35 100644 --- a/indra/newview/skins/default/xui/en/widgets/talk_button.xml +++ b/indra/newview/skins/default/xui/en/widgets/talk_button.xml @@ -11,14 +11,14 @@ image_unselected="SegmentedBtn_Left_Off" image_pressed="SegmentedBtn_Left_Selected_Press" image_pressed_selected="SegmentedBtn_Left_Selected_Press" - name="left" + name="speak_btn" label="Speak" label_selected="Speak" tab_stop="false" /> <show_button follows="right" - name="right" + name="speak_flyout_btn" label="" left="0" top="0" |