From 0710d0da2ba0d4c0fe66b890f1598d8df7ea4917 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 18 Aug 2009 16:54:34 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1378 https://svn.aws.productengine.com/secondlife/pe/stable-1@1386 -> viewer-2.0.0-3 EXT-357 EXT-370 EXT-385 EXT-409 EXT-472 EXT-479 EXT-513 EXT-532 EXT-541 EXT-544 EXT-546 --- indra/newview/CMakeLists.txt | 2 + indra/newview/llchiclet.cpp | 100 +++++++++++-- indra/newview/llchiclet.h | 15 +- indra/newview/llfavoritesbar.cpp | 2 +- indra/newview/llimpanel.cpp | 6 + indra/newview/llimpanel.h | 3 + indra/newview/llpanelgroup.cpp | 5 + indra/newview/llpanelgroupgeneral.cpp | 47 ------ indra/newview/llpanelgroupgeneral.h | 3 - indra/newview/llpanelpeople.cpp | 99 +++++++++++++ indra/newview/llpanelpeople.h | 10 ++ indra/newview/llpanelplaceinfo.cpp | 23 +++ indra/newview/llpanelplaceinfo.h | 6 +- indra/newview/llpanelplaces.cpp | 36 +++-- indra/newview/llpanelplaces.h | 3 - indra/newview/llteleporthistorystorage.cpp | 164 +++++++++++++++++++++ indra/newview/llteleporthistorystorage.h | 108 ++++++++++++++ .../skins/default/xui/en/menu_imchiclet_p2p.xml | 8 - .../newview/skins/default/xui/en/menu_landmark.xml | 1 - .../xui/en/menu_people_friends_view_sort.xml | 18 +++ .../xui/en/menu_people_nearby_view_sort.xml | 18 +++ .../xui/en/menu_people_recent_view_sort.xml | 15 ++ indra/newview/skins/default/xui/en/menu_place.xml | 1 - .../skins/default/xui/en/panel_bottomtray.xml | 24 +-- .../skins/default/xui/en/panel_group_general.xml | 7 +- .../default/xui/en/panel_group_land_money.xml | 15 -- .../skins/default/xui/en/panel_group_notices.xml | 12 -- .../skins/default/xui/en/panel_group_roles.xml | 23 --- .../newview/skins/default/xui/en/panel_people.xml | 9 +- .../skins/default/xui/en/panel_pick_info.xml | 15 +- .../newview/skins/default/xui/en/panel_profile.xml | 37 ++++- .../skins/default/xui/en/panel_side_tray.xml | 5 - .../skins/default/xui/en/widgets/filter_editor.xml | 1 - .../default/xui/en/widgets/location_input.xml | 1 - 34 files changed, 657 insertions(+), 185 deletions(-) create mode 100644 indra/newview/llteleporthistorystorage.cpp create mode 100644 indra/newview/llteleporthistorystorage.h create mode 100644 indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml create mode 100644 indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml create mode 100644 indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 58d7a983a2..ffdacee22a 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -361,6 +361,7 @@ set(viewer_SOURCE_FILES llsyswellitem.cpp llsyswellwindow.cpp llteleporthistory.cpp + llteleporthistorystorage.cpp lltexglobalcolor.cpp lltexlayer.cpp lltexlayerparams.cpp @@ -810,6 +811,7 @@ set(viewer_HEADER_FILES llsyswellwindow.h lltable.h llteleporthistory.h + llteleporthistorystorage.h lltexglobalcolor.h lltexlayer.h lltexlayerparams.h diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index d98f03eccb..c844d70d89 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -45,6 +45,7 @@ #include "lltextbox.h" #include "llvoiceclient.h" #include "llvoicecontrolpanel.h" +#include "llgroupmgr.h" static const std::string P2P_MENU_NAME = "IMChiclet P2P Menu"; static const std::string GROUP_MENU_NAME = "IMChiclet Group Menu"; @@ -178,6 +179,7 @@ void LLChiclet::setValue(const LLSD& value) LLIMChiclet::Params::Params() : avatar_icon("avatar_icon") +, group_insignia("group_insignia") , unread_notifications("unread_notifications") , speaker("speaker") , show_speaker("show_speaker") @@ -185,8 +187,14 @@ LLIMChiclet::Params::Params() rect(LLRect(0, 25, 45, 0)); avatar_icon.name("avatar_icon"); + avatar_icon.visible(false); avatar_icon.rect(LLRect(0, 25, 25, 0)); + //it's an icon for a group in case there is a group chat created + group_insignia.name("group_icon"); + group_insignia.visible(false); + group_insignia.rect(LLRect(0, 25, 25, 0)); + unread_notifications.name("unread"); unread_notifications.rect(LLRect(25, 25, 45, 0)); unread_notifications.font(LLFontGL::getFontSansSerif()); @@ -202,7 +210,9 @@ LLIMChiclet::Params::Params() LLIMChiclet::LLIMChiclet(const Params& p) : LLChiclet(p) +, LLGroupMgrObserver(LLUUID()) , mAvatarCtrl(NULL) +, mGroupInsignia(NULL) , mCounterCtrl(NULL) , mSpeakerCtrl(NULL) , mShowSpeaker(p.show_speaker) @@ -212,6 +222,12 @@ LLIMChiclet::LLIMChiclet(const Params& p) mAvatarCtrl = LLUICtrlFactory::create(avatar_params); addChild(mAvatarCtrl); + //Before setOtherParticipantId() we are UNAWARE which dialog type will it be + //so keeping both icons for all both p2p and group chat cases + LLIconCtrl::Params grop_icon_params = p.group_insignia; + mGroupInsignia = LLUICtrlFactory::create(grop_icon_params); + addChild(mGroupInsignia); + LLChicletNotificationCounterCtrl::Params unread_params = p.unread_notifications; mCounterCtrl = LLUICtrlFactory::create(unread_params); addChild(mCounterCtrl); @@ -228,7 +244,7 @@ LLIMChiclet::LLIMChiclet(const Params& p) LLIMChiclet::~LLIMChiclet() { - + LLGroupMgr::getInstance()->removeObserver(this); } @@ -285,22 +301,80 @@ void LLIMChiclet::setIMSessionName(const std::string& name) setToolTip(name); } +//session id should be set before calling this void LLIMChiclet::setOtherParticipantId(const LLUUID& other_participant_id) { - if (mAvatarCtrl) + llassert(getSessionId().notNull()); + + LLFloaterIMPanel*floater = gIMMgr->findFloaterBySession(getSessionId()); + + //all alive sessions have alive floater, haven't they? + llassert(floater); + + //in case participant id is being replaced with different id for a group chat + if (mOtherParticipantId.notNull() && mOtherParticipantId != other_participant_id && + mID.notNull() && mGroupInsignia->getValue().isUUID()) { - mAvatarCtrl->setValue(other_participant_id); + LLGroupMgr::getInstance()->removeObserver(this); + } + + mOtherParticipantId = other_participant_id; + + switch (floater->getDialogType()) + { + case IM_NOTHING_SPECIAL: + if (mAvatarCtrl) { + mAvatarCtrl->setVisible(TRUE); + mAvatarCtrl->setValue(other_participant_id); + } + break; + case IM_SESSION_GROUP_START: + { + if (mGroupInsignia) { + LLGroupMgr* grp_mgr = LLGroupMgr::getInstance(); + LLGroupMgrGroupData* group_data = grp_mgr->getGroupData(other_participant_id); + if (group_data && group_data->mInsigniaID.notNull()) + { + mGroupInsignia->setVisible(TRUE); + mGroupInsignia->setValue(group_data->mInsigniaID); + } + else + { + mID = mOtherParticipantId; //needed for LLGroupMgrObserver + grp_mgr->addObserver(this); + grp_mgr->sendGroupPropertiesRequest(mOtherParticipantId); + } + } + } + + break; + default: + llwarning("Unsupported dialog type", 0); + break; } + } -LLUUID LLIMChiclet::getOtherParticipantId() + +void LLIMChiclet::changed(LLGroupChange gc) { - LLUUID res = LLUUID::null; - if (mAvatarCtrl) + LLSD group_insignia = mGroupInsignia->getValue(); + if (group_insignia.isUUID() && group_insignia.asUUID().notNull()) return; + + if (GC_PROPERTIES == gc) { - res = mAvatarCtrl->getAvatarId(); + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mOtherParticipantId); + if (group_data && group_data->mInsigniaID.notNull()) + { + mGroupInsignia->setVisible(TRUE); + mGroupInsignia->setValue(group_data->mInsigniaID); + } } - return res; +} + +LLUUID LLIMChiclet::getOtherParticipantId() +{ + return mOtherParticipantId; } void LLIMChiclet::updateMenuItems() @@ -312,7 +386,7 @@ void LLIMChiclet::updateMenuItems() if(P2P_MENU_NAME == mPopupMenu->getName()) { - bool is_friend = LLAvatarActions::isFriend(mAvatarCtrl->getAvatarId()); + bool is_friend = LLAvatarActions::isFriend(getOtherParticipantId()); mPopupMenu->getChild("Add Friend")->setEnabled(!is_friend); mPopupMenu->getChild("Remove Friend")->setEnabled(is_friend); @@ -321,7 +395,7 @@ void LLIMChiclet::updateMenuItems() BOOL LLIMChiclet::handleMouseDown(S32 x, S32 y, MASK mask) { - LLIMFloater::show(getSessionId()); + LLIMFloater::toggle(getSessionId()); setCounter(0); return LLChiclet::handleMouseDown(x, y, mask); } @@ -411,7 +485,7 @@ void LLIMChiclet::createPopupMenu() void LLIMChiclet::onMenuItemClicked(const LLSD& user_data) { std::string level = user_data.asString(); - LLUUID other_participant_id = mAvatarCtrl->getAvatarId(); + LLUUID other_participant_id = getOtherParticipantId(); if("profile" == level) { @@ -425,10 +499,6 @@ void LLIMChiclet::onMenuItemClicked(const LLSD& user_data) { LLAvatarActions::requestFriendshipDialog(other_participant_id); } - else if("remove" == level) - { - LLAvatarActions::removeFriendDialog(other_participant_id); - } else if("group chat" == level) { LLGroupActions::startChat(other_participant_id); diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index f66d799c25..c83caf8ff9 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -38,6 +38,7 @@ #include "llpanel.h" #include "lltextbox.h" #include "lloutputmonitorctrl.h" +#include "llgroupmgr.h" class LLVoiceControlPanel; class LLMenuGL; @@ -235,13 +236,15 @@ private: * IMChiclet displays avatar's icon, number of unread messages(optional) * and voice chat status(optional). */ -class LLIMChiclet : public LLChiclet +class LLIMChiclet : public LLChiclet, LLGroupMgrObserver { public: struct Params : public LLInitParam::Block { Optional avatar_icon; + Optional group_insignia; + Optional unread_notifications; Optional speaker; @@ -260,6 +263,7 @@ public: /* * Sets id of person/group user is chatting with. + * Session id should be set before calling this */ virtual void setOtherParticipantId(const LLUUID& other_participant_id); @@ -305,6 +309,9 @@ public: */ /*virtual*/ LLRect getRequiredRect(); + /** comes from LLGroupMgrObserver */ + virtual void changed(LLGroupChange gc); + protected: LLIMChiclet(const Params& p); @@ -335,6 +342,9 @@ protected: protected: LLChicletAvatarIconCtrl* mAvatarCtrl; + + /** the icon of a group in case of group chat */ + LLIconCtrl* mGroupInsignia; LLChicletNotificationCounterCtrl* mCounterCtrl; LLChicletSpeakerCtrl* mSpeakerCtrl; @@ -342,6 +352,9 @@ protected: bool mShowSpeaker; + /** the id of another participant, either an avatar id or a group id*/ + LLUUID mOtherParticipantId; + template struct CollectChicletCombiner { typedef Container result_type; diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index f739e159f3..7fc127f803 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -604,7 +604,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) } else if (action == "copy") { - LLInventoryClipboard::instance().add(mSelectedItemID); + LLInventoryClipboard::instance().store(mSelectedItemID); } else if (action == "paste") { diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 1037ef0403..65bf1176ff 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -2231,6 +2231,12 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) return floater; } +//static +BOOL LLIMFloater::toggle(const LLUUID& session_id) +{ + return LLFloaterReg::toggleInstance("impanel", session_id); +} + void LLIMFloater::updateMessages() { std::list messages = LLIMModel::instance().getMessages(mSessionID, mLastMessageIndex+1); diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index d35aca0e42..52f67df4b7 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -386,6 +386,9 @@ public: static LLIMFloater* show(const LLUUID& session_id); + // Toggle panel specified by session_id + static BOOL toggle(const LLUUID& session_id); + // get new messages from LLIMModel void updateMessages(); static void onSendMsg( LLUICtrl*, void*); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 615a41b143..a7c05af50b 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -257,6 +257,7 @@ void LLPanelGroup::notifyObservers() LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mID); if(gdatap) childSetValue("group_name", gdatap->mName); + } @@ -270,6 +271,10 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) for(std::vector::iterator it = mTabs.begin();it!=mTabs.end();++it) (*it)->setGroupID(group_id); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mID); + if(gdatap) + childSetValue("group_name", gdatap->mName); + LLButton* button_apply = findChild("btn_apply"); LLButton* button_refresh = findChild("btn_refresh"); LLButton* button_create = findChild("btn_create"); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 22706513e0..2d06dcdb36 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -71,11 +71,9 @@ LLPanelGroupGeneral::LLPanelGroupGeneral() mChanged(FALSE), mFirstUse(TRUE), mGroupNameEditor(NULL), - mGroupName(NULL), mFounderName(NULL), mInsignia(NULL), mEditCharter(NULL), - mBtnJoinGroup(NULL), mListVisibleMembers(NULL), mCtrlShowInGroupList(NULL), mComboMature(NULL), @@ -100,7 +98,6 @@ BOOL LLPanelGroupGeneral::postBuild() // General info mGroupNameEditor = getChild("group_name_editor", recurse); - mGroupName = getChild("group_name", recurse); mInsignia = getChild("insignia", recurse); if (mInsignia) @@ -117,17 +114,6 @@ BOOL LLPanelGroupGeneral::postBuild() mEditCharter->setFocusChangedCallback(onFocusEdit, this); } - mBtnJoinGroup = getChild("join_button", recurse); - if ( mBtnJoinGroup ) - { - mBtnJoinGroup->setClickedCallback(onClickJoin, this); - } - - mBtnInfo = getChild("info_button", recurse); - if ( mBtnInfo ) - { - mBtnInfo->setClickedCallback(onClickInfo, this); - } mFounderName = getChild("founder_name"); @@ -224,9 +210,6 @@ BOOL LLPanelGroupGeneral::postBuild() mCtrlEnrollmentFee->setEnabled(TRUE); mSpinEnrollmentFee->setEnabled(TRUE); - mBtnJoinGroup->setVisible(FALSE); - mBtnInfo->setVisible(FALSE); - mGroupName->setVisible(FALSE); } return LLPanelGroupTab::postBuild(); @@ -692,28 +675,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) can_change_member_opts); mSpinEnrollmentFee->resetDirty(); } - if ( mBtnJoinGroup ) - { - std::string fee_buff; - bool visible; - - visible = !is_member && gdatap->mOpenEnrollment; - mBtnJoinGroup->setVisible(visible); - - if ( visible ) - { - LLStringUtil::format_map_t string_args; - string_args["[AMOUNT]"] = llformat("%d", gdatap->mMembershipFee); - fee_buff = getString("group_join_btn", string_args); - mBtnJoinGroup->setLabelSelected(fee_buff); - mBtnJoinGroup->setLabelUnselected(fee_buff); - } - } - if ( mBtnInfo ) - { - mBtnInfo->setVisible(is_member && !mAllowEdit); - } - if (mCtrlReceiveNotices) { mCtrlReceiveNotices->setVisible(is_member); @@ -728,7 +689,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if (mInsignia) mInsignia->setEnabled(mAllowEdit && can_change_ident); if (mEditCharter) mEditCharter->setEnabled(mAllowEdit && can_change_ident); - if (mGroupName) mGroupName->setText(gdatap->mName); if (mGroupNameEditor) mGroupNameEditor->setVisible(FALSE); if (mFounderName) mFounderName->setNameID(gdatap->mFounderID,FALSE); if (mInsignia) @@ -858,7 +818,6 @@ void LLPanelGroupGeneral::updateChanged() LLUICtrl *check_list[] = { mGroupNameEditor, - mGroupName, mFounderName, mInsignia, mEditCharter, @@ -914,10 +873,6 @@ void LLPanelGroupGeneral::reset() mSpinEnrollmentFee->setEnabled(TRUE); mSpinEnrollmentFee->set((F32)0); - mBtnJoinGroup->setVisible(FALSE); - mBtnInfo->setVisible(FALSE); - mGroupName->setVisible(FALSE); - mGroupNameEditor->setVisible(true); mComboActiveTitle->setVisible(false); @@ -937,7 +892,6 @@ void LLPanelGroupGeneral::reset() mListVisibleMembers->addElement(row); } - mBtnJoinGroup->setVisible(false); { mComboMature->setEnabled(true); @@ -954,7 +908,6 @@ void LLPanelGroupGeneral::resetDirty() LLUICtrl *check_list[] = { mGroupNameEditor, - mGroupName, mFounderName, mInsignia, mEditCharter, diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index e7028228b0..21d526f43d 100644 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -96,12 +96,9 @@ private: // Group information (include any updates in updateChanged) LLLineEditor *mGroupNameEditor; - LLTextBox *mGroupName; LLNameBox *mFounderName; LLTextureCtrl *mInsignia; LLTextEditor *mEditCharter; - LLButton *mBtnJoinGroup; - LLButton *mBtnInfo; LLNameListCtrl *mListVisibleMembers; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 19a5f3a5f1..8770abcee3 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -320,6 +320,10 @@ LLPanelPeople::~LLPanelPeople() delete mGroupListUpdater; LLView::deleteViewByHandle(mGroupPlusMenuHandle); + LLView::deleteViewByHandle(mNearbyViewSortMenuHandle); + LLView::deleteViewByHandle(mFriendsViewSortMenuHandle); + LLView::deleteViewByHandle(mRecentViewSortMenuHandle); + } BOOL LLPanelPeople::postBuild() @@ -336,6 +340,7 @@ BOOL LLPanelPeople::postBuild() mOfflineFriendList = getChild(FRIENDS_TAB_NAME)->getChild("avatars_offline"); mNearbyList = getChild(NEARBY_TAB_NAME)->getChild("avatar_list"); + mRecentList = getChild(RECENT_TAB_NAME)->getChild("avatar_list"); mGroupList = getChild("group_list"); @@ -370,15 +375,38 @@ BOOL LLPanelPeople::postBuild() buttonSetAction("share_btn", boost::bind(&LLPanelPeople::onShareButtonClicked, this)); buttonSetAction("more_btn", boost::bind(&LLPanelPeople::onMoreButtonClicked, this)); + getChild(NEARBY_TAB_NAME)->childSetAction("nearby_view_sort_btn",boost::bind(&LLPanelPeople::onNearbyViewSortButtonClicked, this)); + getChild(RECENT_TAB_NAME)->childSetAction("recent_viewsort_btn",boost::bind(&LLPanelPeople::onRecentViewSortButtonClicked, this)); + getChild(FRIENDS_TAB_NAME)->childSetAction("friends_viewsort_btn",boost::bind(&LLPanelPeople::onFriendsViewSortButtonClicked, this)); + // Must go after setting commit callback and initializing all pointers to children. mTabContainer->selectTabByName(FRIENDS_TAB_NAME); // Create menus. LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + registrar.add("People.Group.Plus.Action", boost::bind(&LLPanelPeople::onGroupPlusMenuItemClicked, this, _2)); + registrar.add("People.Friends.ViewSort.Action", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemClicked, this, _2)); + registrar.add("People.Nearby.ViewSort.Action", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemClicked, this, _2)); + registrar.add("People.Recent.ViewSort.Action", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemClicked, this, _2)); + LLMenuGL* plus_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_group_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGroupPlusMenuHandle = plus_menu->getHandle(); + LLMenuGL* nearby_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_nearby_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if(nearby_view_sort) + mNearbyViewSortMenuHandle = nearby_view_sort->getHandle(); + + LLMenuGL* friend_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_friends_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if(friend_view_sort) + mFriendsViewSortMenuHandle = friend_view_sort->getHandle(); + + LLMenuGL* recent_view_sort = LLUICtrlFactory::getInstance()->createFromFile("menu_people_recent_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if(recent_view_sort) + mRecentViewSortMenuHandle = recent_view_sort->getHandle(); + + + // Perform initial update. mFriendListUpdater->forceUpdate(); mRecentListUpdater->forceUpdate(); @@ -811,6 +839,56 @@ void LLPanelPeople::onGroupPlusMenuItemClicked(const LLSD& userdata) LLGroupActions::createGroup(); } +void LLPanelPeople::onFriendsViewSortMenuItemClicked(const LLSD& userdata) +{ + std::string chosen_item = userdata.asString(); + + if (chosen_item == "sort_name") + { + } + else if (chosen_item == "sort_status") + { + } + else if (chosen_item == "view_icons") + { + } + else if (chosen_item == "organize_offline") + { + } +} +void LLPanelPeople::onNearbyViewSortMenuItemClicked(const LLSD& userdata) +{ + std::string chosen_item = userdata.asString(); + + if (chosen_item == "sort_recent") + { + } + else if (chosen_item == "sort_name") + { + } + else if (chosen_item == "view_icons") + { + } + else if (chosen_item == "sort_distance") + { + } +} +void LLPanelPeople::onRecentViewSortMenuItemClicked(const LLSD& userdata) +{ + std::string chosen_item = userdata.asString(); + + if (chosen_item == "sort_most") + { + } + else if (chosen_item == "sort_name") + { + } + else if (chosen_item == "view_icons") + { + } +} + + void LLPanelPeople::onCallButtonClicked() { // *TODO: not implemented yet @@ -830,6 +908,27 @@ void LLPanelPeople::onMoreButtonClicked() { // *TODO: not implemented yet } +void LLPanelPeople::onFriendsViewSortButtonClicked() +{ + LLMenuGL* menu = (LLMenuGL*)mFriendsViewSortMenuHandle.get(); + if (!menu) + return; + showGroupMenu(menu); +} +void LLPanelPeople::onRecentViewSortButtonClicked() +{ + LLMenuGL* menu = (LLMenuGL*)mRecentViewSortMenuHandle.get(); + if (!menu) + return; + showGroupMenu(menu); +} +void LLPanelPeople::onNearbyViewSortButtonClicked() +{ + LLMenuGL* menu = (LLMenuGL*)mNearbyViewSortMenuHandle.get(); + if (!menu) + return; + showGroupMenu(menu); +} void LLPanelPeople::onOpen(const LLSD& key) { diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 2b821a432b..d0f78f4247 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -93,12 +93,19 @@ private: void onShareButtonClicked(); void onMoreButtonClicked(); void onActivateButtonClicked(); + void onRecentViewSortButtonClicked(); + void onNearbyViewSortButtonClicked(); + void onFriendsViewSortButtonClicked(); void onAvatarListDoubleClicked(LLAvatarList* list); void onAvatarListCommitted(LLAvatarList* list); void onGroupPlusButtonClicked(); void onGroupMinusButtonClicked(); void onGroupPlusMenuItemClicked(const LLSD& userdata); + void onFriendsViewSortMenuItemClicked(const LLSD& userdata); + void onNearbyViewSortMenuItemClicked(const LLSD& userdata); + void onRecentViewSortMenuItemClicked(const LLSD& userdata); + // misc callbacks bool onFriendListUpdate(U32 changed_mask); static void onAvatarPicked( @@ -115,6 +122,9 @@ private: LLGroupList* mGroupList; LLHandle mGroupPlusMenuHandle; + LLHandle mNearbyViewSortMenuHandle; + LLHandle mFriendsViewSortMenuHandle; + LLHandle mRecentViewSortMenuHandle; Updater* mFriendListUpdater; Updater* mNearbyListUpdater; diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 34feb0f5a9..c8e0a53764 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -49,6 +49,7 @@ #include "lltextbox.h" #include "llagent.h" +#include "llavatarpropertiesprocessor.h" #include "llfloaterworldmap.h" #include "llinventorymodel.h" #include "lllandmarkactions.h" @@ -513,6 +514,28 @@ void LLPanelPlaceInfo::createLandmark(const LLUUID& folder_id) folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK)); } +void LLPanelPlaceInfo::createPick(const LLVector3d& global_pos) +{ + LLPickData pick_data; + + pick_data.agent_id = gAgent.getID(); + pick_data.session_id = gAgent.getSessionID(); + pick_data.pick_id = LLUUID::generateNewID(); + pick_data.creator_id = gAgentID; + + //legacy var need to be deleted + pick_data.top_pick = FALSE; + pick_data.parcel_id = mParcelID; + pick_data.name = mParcelName->getText(); + pick_data.desc = mDescEditor->getText(); + pick_data.snapshot_id = mSnapshotCtrl->getImageAssetID(); + pick_data.pos_global = global_pos; + pick_data.sort_order = 0; + pick_data.enabled = TRUE; + + LLAvatarPropertiesProcessor::instance().sendDataUpdate(&pick_data, APT_PICK_INFO); +} + void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent) { if (mMinHeight > 0 && mScrollingPanel != NULL) diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index e7b81dc3e6..71c268c6c4 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -80,8 +80,12 @@ public: void setInfoType(INFO_TYPE type); // Create a landmark for the current location - // in a folder specified by folder_id + // in a folder specified by folder_id. void createLandmark(const LLUUID& folder_id); + + // Create a pick for the location specified + // by global_pos. + void createPick(const LLVector3d& global_pos); BOOL isMediaPanelVisible(); void toggleMediaPanel(BOOL visible); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 41be268483..39f7d41a8d 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -301,16 +301,6 @@ void LLPanelPlaces::onShareButtonClicked() } */ -void LLPanelPlaces::copySLURL() -{ - LLLandmarkActions::getSLURLfromPosGlobal(mPosGlobal, boost::bind(&onSLURLBuilt, _1)); -} - -void LLPanelPlaces::deleteLandmark() -{ - gInventory.removeItem(mItem->getUUID()); -} - void LLPanelPlaces::onTeleportButtonClicked() { if (!mPlaceInfo) @@ -398,6 +388,17 @@ void LLPanelPlaces::onOverflowButtonClicked() else if (is_landmark_info_visible && mLandmarkMenu != NULL) { menu = mLandmarkMenu; + + BOOL is_landmark_removable = FALSE; + if (mItem.notNull()) + { + const LLUUID& item_id = mItem->getUUID(); + const LLUUID& trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); + is_landmark_removable = gInventory.isObjectDescendentOf(item_id, gInventory.getRootFolderID()) && + !gInventory.isObjectDescendentOf(item_id, trash_id); + } + + menu->getChild("delete")->setEnabled(is_landmark_removable); } else { @@ -422,11 +423,22 @@ void LLPanelPlaces::onOverflowMenuItemClicked(const LLSD& param) } else if (item == "copy") { - copySLURL(); + LLLandmarkActions::getSLURLfromPosGlobal(mPosGlobal, boost::bind(&onSLURLBuilt, _1)); } else if (item == "delete") { - deleteLandmark(); + gInventory.removeItem(mItem->getUUID()); + + onBackButtonClicked(); + } + else if (item == "pick") + { + if (!mPlaceInfo) + return; + + mPlaceInfo->createPick(mPosGlobal); + + onBackButtonClicked(); } } diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index a200bc2d28..089a854762 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -81,9 +81,6 @@ private: void updateVerbs(); void showLandmarkFoldersMenu(); - - void copySLURL(); - void deleteLandmark(); LLFilterEditor* mFilterEditor; LLPanelPlacesTab* mActivePanel; diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp new file mode 100644 index 0000000000..b31edf1e5d --- /dev/null +++ b/indra/newview/llteleporthistorystorage.cpp @@ -0,0 +1,164 @@ +/** + * @file llteleporthistorystorage.cpp + * @brief Teleport history + * + * $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 "llteleporthistorystorage.h" + +#include "llsd.h" +#include "llsdserialize.h" +#include "lldir.h" + +static LLTeleportHistoryStorage tpstorage; + +LLTeleportHistoryPersistentItem::LLTeleportHistoryPersistentItem(const LLSD& val) +{ + mTitle = val["title"].asString(); + mGlobalPos.setValue(val["global_pos"]); + mDate = val["date"]; +} + +LLSD LLTeleportHistoryPersistentItem::toLLSD() const +{ + LLSD val; + + val["title"] = mTitle; + val["global_pos"] = mGlobalPos.getValue(); + val["date"] = mDate; + + return val; +} + +LLTeleportHistoryStorage::LLTeleportHistoryStorage() : + mFilename("teleport_history.txt") +{ +} + +LLTeleportHistoryStorage::~LLTeleportHistoryStorage() +{ +} + +void LLTeleportHistoryStorage::purgeItems() +{ + mItems.clear(); +} + +void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d& global_pos) +{ + mItems.push_back(LLTeleportHistoryPersistentItem(title, global_pos)); +} + +void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d& global_pos, const LLDate& date) +{ + mItems.push_back(LLTeleportHistoryPersistentItem(title, global_pos, date)); +} + +void LLTeleportHistoryStorage::removeItem(S32 idx) +{ + if (idx < 0 || idx >= (S32)mItems.size()) + return; + + mItems.erase (mItems.begin() + idx); +} + +void LLTeleportHistoryStorage::save() +{ + // build filename for each user + std::string resolvedFilename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + + // open the history file for writing + llofstream file (resolvedFilename); + if (!file.is_open()) + { + llwarns << "can't open teleport history file \"" << mFilename << "\" for writing" << llendl; + return; + } + + for (size_t i=0; i(s_item) << std::endl; + } + + file.close(); +} + +void LLTeleportHistoryStorage::load() +{ + // build filename for each user + std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); + + // open the history file for reading + llifstream file(resolved_filename); + if (!file.is_open()) + { + llwarns << "can't load teleport history from file \"" << mFilename << "\"" << llendl; + return; + } + + // remove current entries before we load over them + mItems.clear(); + + // the parser's destructor is protected so we cannot create in the stack. + LLPointer parser = new LLSDNotationParser(); + std::string line; + while (std::getline(file, line)) + { + LLSD s_item; + std::istringstream iss(line); + if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE) + { + llinfos << "Parsing saved teleport history failed" << llendl; + break; + } + + mItems.push_back(s_item); + } + + file.close(); +} + +void LLTeleportHistoryStorage::dump() const +{ + llinfos << "Teleport history storage dump (" << mItems.size() << " items):" << llendl; + + for (size_t i=0; i + +#include "llsingleton.h" +#include "lldate.h" +#include "v3dmath.h" + +class LLSD; + +/** + * An item of the teleport history, stored in file + * + * Contains the location's global coordinates, title and date. + */ +class LLTeleportHistoryPersistentItem +{ +public: + LLTeleportHistoryPersistentItem() + {} + + LLTeleportHistoryPersistentItem(const std::string title, const LLVector3d& global_pos) + : mTitle(title), mGlobalPos(global_pos), mDate(LLDate::now()) + {} + + LLTeleportHistoryPersistentItem(const std::string title, const LLVector3d& global_pos, const LLDate& date) + : mTitle(title), mGlobalPos(global_pos), mDate(date) + {} + + LLTeleportHistoryPersistentItem(const LLSD& val); + LLSD toLLSD() const; + + std::string mTitle; + LLVector3d mGlobalPos; + LLDate mDate; +}; + +/** + * Persistent teleport history. + * + */ +class LLTeleportHistoryStorage: public LLSingleton +{ + LOG_CLASS(LLTeleportHistoryStorage); + +public: + + typedef std::vector item_list_list_t; + + LLTeleportHistoryStorage(); + ~LLTeleportHistoryStorage(); + + /** + * @return history items. + */ + const item_list_list_t& getItems() const { return mItems; } + void purgeItems(); + + void addItem(const std::string title, const LLVector3d& global_pos); + void addItem(const std::string title, const LLVector3d& global_pos, const LLDate& date); + + void removeItem(S32 idx); + + void save(); + void load(); + + void dump() const; + +private: + + item_list_list_t mItems; + std::string mFilename; +}; + +#endif //LL_LLTELEPORTHISTORYSTORAGE_H diff --git a/indra/newview/skins/default/xui/en/menu_imchiclet_p2p.xml b/indra/newview/skins/default/xui/en/menu_imchiclet_p2p.xml index bad6e1e212..c205868429 100644 --- a/indra/newview/skins/default/xui/en/menu_imchiclet_p2p.xml +++ b/indra/newview/skins/default/xui/en/menu_imchiclet_p2p.xml @@ -32,12 +32,4 @@ function="IMChicletMenu.Action" parameter="add" /> - - - diff --git a/indra/newview/skins/default/xui/en/menu_landmark.xml b/indra/newview/skins/default/xui/en/menu_landmark.xml index 64f6ce9bb5..9263f75d24 100644 --- a/indra/newview/skins/default/xui/en/menu_landmark.xml +++ b/indra/newview/skins/default/xui/en/menu_landmark.xml @@ -22,7 +22,6 @@ parameter="delete" /> diff --git a/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml new file mode 100644 index 0000000000..bb5a4e51f7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml new file mode 100644 index 0000000000..8c2c5e8c9e --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml new file mode 100644 index 0000000000..00cf443cc6 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_place.xml b/indra/newview/skins/default/xui/en/menu_place.xml index a9f98e35cc..01f62985ca 100644 --- a/indra/newview/skins/default/xui/en/menu_place.xml +++ b/indra/newview/skins/default/xui/en/menu_place.xml @@ -14,7 +14,6 @@ parameter="landmark" /> diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 9910f99c17..4f241664fb 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -31,8 +31,7 @@ layout="topleft" left="0" top="0" - width="5" - min_width="5" /> + width="5"/> + width="3"/> + width="8"/> + width="5"/> + width="5"/> + width="10"/> + width="10"/> + width="5"/> diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index fd154792dd..9fa2765e97 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -43,7 +43,7 @@ Hover your mouse over the options for more help.