diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-06-28 15:23:07 -0700 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-06-28 15:23:07 -0700 |
commit | a32522b99a9e9f98a689f07344f4fad0fc221d06 (patch) | |
tree | e09906da9679b8c2cbdd63e4dadcd660362d50e7 /indra | |
parent | 8c36966a07a599269c3a0fa2fca2f8ba1844e06f (diff) |
ACME-638: Removing the personfolderview, personmodelcommon and persontabview. Also removing FBC Test Two tab from the 'People' panel.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/CMakeLists.txt | 6 | ||||
-rwxr-xr-x | indra/newview/llpanelpeople.cpp | 121 | ||||
-rwxr-xr-x | indra/newview/llpanelpeople.h | 11 | ||||
-rw-r--r-- | indra/newview/llpersonfolderview.cpp | 149 | ||||
-rw-r--r-- | indra/newview/llpersonfolderview.h | 70 | ||||
-rw-r--r-- | indra/newview/llpersonmodelcommon.cpp | 313 | ||||
-rw-r--r-- | indra/newview/llpersonmodelcommon.h | 248 | ||||
-rw-r--r-- | indra/newview/llpersontabview.cpp | 465 | ||||
-rw-r--r-- | indra/newview/llpersontabview.h | 151 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/panel_people.xml | 100 |
10 files changed, 0 insertions, 1634 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f593375aed..1f43debe1b 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -467,9 +467,6 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp - llpersonfolderview.cpp - llpersonmodelcommon.cpp - llpersontabview.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp llpipelinelistener.cpp @@ -1044,9 +1041,6 @@ set(viewer_HEADER_FILES llpathfindingobjectlist.h llpathfindingpathtool.h llpersistentnotificationstorage.h - llpersonfolderview.h - llpersonmodelcommon.h - llpersontabview.h llphysicsmotion.h llphysicsshapebuilderutil.h llpipelinelistener.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index d3493373f6..457ccb8285 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -63,9 +63,6 @@ #include "llnetmap.h" #include "llpanelpeoplemenus.h" #include "llparticipantlist.h" -#include "llpersonfolderview.h" -#include "llpersonmodelcommon.h" -#include "llpersontabview.h" #include "llsidetraypanelcontainer.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings @@ -86,7 +83,6 @@ static const std::string FRIENDS_TAB_NAME = "friends_panel"; static const std::string GROUP_TAB_NAME = "groups_panel"; static const std::string RECENT_TAB_NAME = "recent_panel"; static const std::string BLOCKED_TAB_NAME = "blocked_panel"; // blocked avatars -static const std::string FBCTESTTWO_TAB_NAME = "fbctesttwo_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; @@ -507,7 +503,6 @@ public: LLPanelPeople::LLPanelPeople() : LLPanel(), - mPersonFolderView(NULL), mTryToConnectToFbc(true), mTabContainer(NULL), mOnlineFriendList(NULL), @@ -526,7 +521,6 @@ LLPanelPeople::LLPanelPeople() mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this)); mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); - mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this)); mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); mCommitCallbackRegistrar.add("People.AddFriendWizard", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this)); @@ -645,47 +639,6 @@ BOOL LLPanelPeople::postBuild() mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu); - //===Test START======================================================================== - - LLPanel * socialtwo_tab = getChild<LLPanel>(FBCTESTTWO_TAB_NAME); - socialtwo_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2)); - - //Create folder view - LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel); - - LLPersonFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams<LLPersonFolderView>()); - - folder_view_params.parent_panel = socialtwo_tab; - folder_view_params.listener = base_item; - folder_view_params.view_model = &mPersonFolderViewModel; - folder_view_params.root = NULL; - folder_view_params.use_ellipses = true; - folder_view_params.use_label_suffix = true; - folder_view_params.options_menu = "menu_conversation.xml"; - folder_view_params.name = "fbcfolderview"; - mPersonFolderView = LLUICtrlFactory::create<LLPersonFolderView>(folder_view_params); - - //Create scroller - LLRect scroller_view_rect = socialtwo_tab->getRect(); - scroller_view_rect.mTop -= 2+27; // 27 is the height of the top toolbar - scroller_view_rect.mRight -= 4; - scroller_view_rect.mLeft += 2; - LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams<LLFolderViewScrollContainer>()); - scroller_params.rect(scroller_view_rect); - - LLScrollContainer* scroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params); - socialtwo_tab->addChildInBack(scroller); - scroller->addChild(mPersonFolderView); - scroller->setFollowsAll(); - mPersonFolderView->setScrollContainer(scroller); - mPersonFolderView->setFollowsAll(); - - gIdleCallbacks.addFunction(idle, this); - - //===Test END======================================================================== - - - setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); setSortOrder(mNearbyList, (ESortOrder)gSavedSettings.getU32("NearbyPeopleSortOrder"), false); @@ -765,12 +718,6 @@ void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI, updateButtons(); } -void LLPanelPeople::idle(void * user_data) -{ - LLPanelPeople * self = static_cast<LLPanelPeople *>(user_data); - self->mPersonFolderView->update(); -} - void LLPanelPeople::updateFriendListHelpText() { // show special help text for just created account to help finding friends. EXT-4836 @@ -1014,11 +961,6 @@ LLUUID LLPanelPeople::getCurrentItemID() const if (cur_tab == BLOCKED_TAB_NAME) return LLUUID::null; // FIXME? - - - if (cur_tab == FBCTESTTWO_TAB_NAME) - return LLUUID::null; - llassert(0 && "unknown tab selected"); return LLUUID::null; @@ -1042,8 +984,6 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const mGroupList->getSelectedUUIDs(selected_uuids); else if (cur_tab == BLOCKED_TAB_NAME) selected_uuids.clear(); // FIXME? - else if (cur_tab == FBCTESTTWO_TAB_NAME) - return; else llassert(0 && "unknown tab selected"); @@ -1167,11 +1107,6 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) { mRecentList->setNameFilter(filter); } - else if (cur_tab == FBCTESTTWO_TAB_NAME) - { - mPersonFolderViewModel.getFilter().setFilterSubString(filter); - mPersonFolderView->requestArrange(); - } } void LLPanelPeople::onTabSelected(const LLSD& param) @@ -1605,62 +1540,6 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild<LLUICtrl>(name)); } -void LLPanelPeople::addTestParticipant() -{ - std::string suffix("Aa"); - std::string prefix("FB Name"); - LLPersonTabModel * person_tab_model; - LLUUID agentID; - std::string name; - LLPersonTabModel::tab_type tab_type; - - for(int i = 0; i < 300; ++i) - { - //Adds FB+SL people that aren't yet SL friends - if(i < 10) - { - tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; - agentID = gAgent.getID(); - } - //Adds FB only friends - else - { - tab_type = LLPersonTabModel::FB_ONLY_FRIEND; - agentID = LLUUID(NULL); - } - - person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type)); - name = prefix + " " + suffix; - addParticipantToModel(person_tab_model, agentID, name); - // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... - suffix[1]+=1; - if (suffix[1]=='{') - { - suffix[1]='a'; - suffix[0]+=1; - if (suffix[0]=='[') - suffix[0]='A'; - } - } -} - -void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model, const LLUUID& agent_id, const std::string& name) -{ - LLPersonModel* person_model = NULL; - - LLAvatarName avatar_name; - bool has_name = agent_id.notNull() ? LLAvatarNameCache::get(agent_id, &avatar_name) : false; - std::string avatar_name_string; - - if(has_name) - { - avatar_name_string = avatar_name.getDisplayName(); - } - - person_model = new LLPersonModel(agent_id, avatar_name_string, name, mPersonFolderViewModel); - person_folder_model->addParticipant(person_model); -} - void LLPanelPeople::onLoginFbcButtonClicked() { if (LLFacebookConnect::instance().isConnected()) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 55c2c3cdae..db8eddb376 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -30,7 +30,6 @@ #include <llpanel.h> #include "llcallingcard.h" // for avatar tracker -#include "llpersonmodelcommon.h" #include "llfloaterwebcontent.h" #include "llvoiceclient.h" @@ -38,8 +37,6 @@ class LLAvatarList; class LLAvatarName; class LLFilterEditor; class LLGroupList; -class LLPersonFolderView; -class LLSocialList; class LLMenuButton; class LLTabContainer; @@ -59,11 +56,6 @@ public: // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); - static void idle(void * user_data); - - void addTestParticipant(); - void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); - bool mTryToConnectToFbc; // internals @@ -165,9 +157,6 @@ private: Updater* mButtonsUpdater; LLMenuButton* mFBCGearButton; LLHandle< LLFloater > mPicker; - - LLPersonFolderViewModel mPersonFolderViewModel; - LLPersonFolderView* mPersonFolderView; }; #endif //LL_LLPANELPEOPLE_H diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp deleted file mode 100644 index 7e969fc96c..0000000000 --- a/indra/newview/llpersonfolderview.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/** -* @file llpersonfolderview.cpp -* @brief Implementation of llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llpersonfolderview.h" - -#include "llpersontabview.h" - - -LLPersonFolderView::LLPersonFolderView(const Params &p) : -LLFolderView(p), - mConversationsEventStream("ConversationsEventsTwo") -{ - rename("Persons"); // For tracking! - mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1)); - - createPersonTabs(); -} - -LLPersonFolderView::~LLPersonFolderView() -{ - mConversationsEventStream.stopListening("ConversationsRefresh"); -} - -BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) -{ - LLFolderViewItem * item = getCurSelectedItem(); - - //Will disable highlight on tab - if(item) - { - LLPersonTabView * person_tab= dynamic_cast<LLPersonTabView *>(item); - if(person_tab) - { - person_tab->highlight = false; - } - else - { - person_tab = dynamic_cast<LLPersonTabView *>(item->getParent()); - person_tab->highlight = false; - } - } - - mKeyboardSelection = FALSE; - mSearchString.clear(); - - LLEditMenuHandler::gEditMenuHandler = this; - - return LLView::handleMouseDown( x, y, mask ); -} - -void LLPersonFolderView::createPersonTabs() -{ - createPersonTab(LLPersonTabModel::FB_SL_NON_SL_FRIEND, "SL residents you may want to friend"); - createPersonTab(LLPersonTabModel::FB_ONLY_FRIEND, "Invite people you know to SL"); -} - -void LLPersonFolderView::createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name) -{ - //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel(tab_type, tab_name, *mViewModel); - LLPersonTabView::Params params; - params.name = item->getDisplayName(); - params.root = this; - params.listener = item; - params.tool_tip = params.name; - LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params); - widget->addToFolder(this); - - mIndexToFolderMap[tab_type] = item->getID(); - mPersonFolderModelMap[item->getID()] = item; - mPersonFolderViewMap[item->getID()] = widget; -} - -bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) -{ - std::string type = event.get("type").asString(); - LLUUID folder_id = event.get("folder_id").asUUID(); - LLUUID person_id = event.get("person_id").asUUID(); - - if(type == "add_participant") - { - LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderModelMap[folder_id]); - LLPersonTabView * person_tab_view = dynamic_cast<LLPersonTabView *>(mPersonFolderViewMap[folder_id]); - - if(person_tab_model) - { - LLPersonModel * person_model = person_tab_model->findParticipant(person_id); - - if(person_model) - { - LLPersonView * person_view = createConversationViewParticipant(person_model); - person_view->addToFolder(person_tab_view); - } - } - } - - return false; -} - -LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonModel * item) -{ - LLPersonView::Params params; - - params.name = item->getDisplayName(); - params.root = this; - params.listener = item; - - //24 should be loaded from .xml somehow - params.rect = LLRect (0, 24, getRect().getWidth(), 0); - params.tool_tip = params.name; - - return LLUICtrlFactory::create<LLPersonView>(params); -} - -LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type) -{ - return mPersonFolderModelMap[mIndexToFolderMap[tab_type]]; -} - -LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type) -{ - return mPersonFolderViewMap[mIndexToFolderMap[tab_type]]; -} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h deleted file mode 100644 index 85dec6515d..0000000000 --- a/indra/newview/llpersonfolderview.h +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @file llpersonfolderview.h -* @brief Header file for llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLPERSONFOLDERVIEW_H -#define LL_LLPERSONFOLDERVIEW_H - -#include "llevents.h" -#include "llfolderview.h" -#include "llpersonmodelcommon.h" - -class LLPersonTabView; -class LLPersonView; -class LLPersonModel; - -typedef std::map<LLUUID, LLPersonTabModel *> person_folder_model_map; -typedef std::map<LLUUID, LLPersonTabView *> person_folder_view_map; - -class LLPersonFolderView : public LLFolderView -{ -public: - struct Params : public LLInitParam::Block<Params, LLFolderView::Params> - { - Params() - {} - }; - - LLPersonFolderView(const Params &p); - ~LLPersonFolderView(); - - BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - - void createPersonTabs(); - void createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name); - bool onConversationModelEvent(const LLSD &event); - LLPersonView * createConversationViewParticipant(LLPersonModel * item); - - LLPersonTabModel * getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type); - LLPersonTabView * getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type); - - person_folder_model_map mPersonFolderModelMap; - person_folder_view_map mPersonFolderViewMap; - std::map<LLPersonTabModel::tab_type, LLUUID> mIndexToFolderMap; - LLEventStream mConversationsEventStream; -}; - -#endif // LL_LLPERSONFOLDERVIEW_H - diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp deleted file mode 100644 index 73239dcb8d..0000000000 --- a/indra/newview/llpersonmodelcommon.cpp +++ /dev/null @@ -1,313 +0,0 @@ -/** -* @file llavatarfolder.cpp -* @brief Implementation of llavatarfolder -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llpersonmodelcommon.h" - -#include "llevents.h" -#include "llsdutil.h" -#include "llstring.h" - -// -// LLPersonModelCommon -// - -LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) : - LLFolderViewModelItemCommon(root_view_model), - mLabelSuffix(""), - mID(LLUUID().generateNewID()) -{ - renameItem(display_name); -} - -LLPersonModelCommon::LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model) : -LLFolderViewModelItemCommon(root_view_model), - mID(LLUUID().generateNewID()) -{ - mLabelSuffix = suffix; - renameItem(display_name); -} - -LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) : - LLFolderViewModelItemCommon(root_view_model), - mName(""), - mLabelSuffix(""), - mSearchableName(""), - mPrevPassedAllFilters(false), - mID(LLUUID().generateNewID()) -{ -} - -LLPersonModelCommon::~LLPersonModelCommon() -{ - -} - -BOOL LLPersonModelCommon::renameItem(const std::string& new_name) -{ - mName = new_name; - mSearchableName = new_name + " " + mLabelSuffix; - LLStringUtil::toUpper(mSearchableName); - return TRUE; -} - -void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonTabModel* folder, LLPersonModel* person) -{ - LLUUID folder_id = folder->getID(); - LLUUID person_id = person->getID(); - LLSD event(LLSDMap("type", event_type)("folder_id", folder_id)("person_id", person_id)); - LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event); -} - -// Virtual action callbacks -void LLPersonModelCommon::performAction(LLInventoryModel* model, std::string action) -{ -} - -void LLPersonModelCommon::openItem( void ) -{ -} - -void LLPersonModelCommon::closeItem( void ) -{ -} - -void LLPersonModelCommon::previewItem( void ) -{ -} - -void LLPersonModelCommon::showProperties(void) -{ -} - -bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) -{ -/* - Hack: for the moment, we always apply the filter if we're called - if (!filter.isModified()) - { - llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl; - return true; - } - */ - if (!mChildren.empty()) - { - // If the current instance has children, it's a "person folder" and always passes filters (we do not filter out empty folders) - setPassedFilter(1, filter.getCurrentGeneration()); - // Call filter recursively on all children - for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); - iter != end_iter; - ++iter) - { - LLPersonModelCommon* item = dynamic_cast<LLPersonModelCommon*>(*iter); - item->filter(filter); - } - } - else - { - // If there's no children, the current instance is a person and we check and set the passed filter flag on it - const bool passed_filter = filter.check(this); - setPassedFilter(passed_filter, filter.getCurrentGeneration(), filter.getStringMatchOffset(this), filter.getFilterStringSize()); - } - - filter.clearModified(); - return true; -} - -void LLPersonModelCommon::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size) -{ - LLFolderViewModelItemCommon::setPassedFilter(passed, filter_generation, string_offset, string_size); - bool before = mPrevPassedAllFilters; - mPrevPassedAllFilters = passedFilter(filter_generation); - - if (before != mPrevPassedAllFilters) - { - // Need to rearrange the folder if the filtered state of the item changed - LLFolderViewFolder* parent_folder = mFolderViewItem->getParentFolder(); - if (parent_folder) - { - parent_folder->requestArrange(); - } - } -} - - -// -// LLPersonTabModel -// - -LLPersonTabModel::LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(display_name,root_view_model), -mTabType(tab_type) -{ - -} - -LLPersonTabModel::LLPersonTabModel(LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(root_view_model) -{ - -} - -void LLPersonTabModel::addParticipant(LLPersonModel* participant) -{ - addChild(participant); - postEvent("add_participant", this, participant); -} - -void LLPersonTabModel::removeParticipant(LLPersonModel* participant) -{ - removeChild(participant); - postEvent("remove_participant", this, participant); -} - -void LLPersonTabModel::removeParticipant(const LLUUID& participant_id) -{ - LLPersonModel* participant = findParticipant(participant_id); - if (participant) - { - removeParticipant(participant); - } -} - -void LLPersonTabModel::clearParticipants() -{ - clearChildren(); -} - -LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id) -{ - LLPersonModel * person_model = NULL; - child_list_t::iterator iter; - - for(iter = mChildren.begin(); iter != mChildren.end(); ++iter) - { - person_model = static_cast<LLPersonModel *>(*iter); - - if(person_model->getID() == person_id) - { - break; - } - } - - return iter == mChildren.end() ? NULL : person_model; -} - -// -// LLPersonModel -// - -LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(display_name, suffix, root_view_model), -mAgentID(agent_id) -{ -} - -LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(root_view_model), -mAgentID(LLUUID(NULL)) -{ -} - -LLUUID LLPersonModel::getAgentID() -{ - return mAgentID; -} - -// -// LLPersonViewFilter -// - -LLPersonViewFilter::LLPersonViewFilter() : - mEmptyLookupMessage(""), - mFilterSubString(""), - mName(""), - mFilterModified(FILTER_NONE), - mCurrentGeneration(0) -{ -} - -void LLPersonViewFilter::setFilterSubString(const std::string& string) -{ - std::string filter_sub_string_new = string; - LLStringUtil::trimHead(filter_sub_string_new); - LLStringUtil::toUpper(filter_sub_string_new); - - if (mFilterSubString != filter_sub_string_new) - { - // *TODO : Add logic to support more and less restrictive filtering - setModified(FILTER_RESTART); - mFilterSubString = filter_sub_string_new; - } -} - -bool LLPersonViewFilter::showAllResults() const -{ - return mFilterSubString.size() > 0; -} - -bool LLPersonViewFilter::check(const LLFolderViewModelItem* item) -{ - return (mFilterSubString.size() ? (item->getSearchableName().find(mFilterSubString) != std::string::npos) : true); -} - -std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const -{ - return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; -} - -std::string::size_type LLPersonViewFilter::getFilterStringSize() const -{ - return mFilterSubString.size(); -} - -bool LLPersonViewFilter::isActive() const -{ - return mFilterSubString.size(); -} - -bool LLPersonViewFilter::isModified() const -{ - return mFilterModified != FILTER_NONE; -} - -void LLPersonViewFilter::clearModified() -{ - mFilterModified = FILTER_NONE; -} - -void LLPersonViewFilter::setEmptyLookupMessage(const std::string& message) -{ - mEmptyLookupMessage = message; -} - -std::string LLPersonViewFilter::getEmptyLookupMessage() const -{ - return mEmptyLookupMessage; -} - diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h deleted file mode 100644 index 74598eaee0..0000000000 --- a/indra/newview/llpersonmodelcommon.h +++ /dev/null @@ -1,248 +0,0 @@ -/** -* @file llavatarfolder.h -* @brief Header file for llavatarfolder -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLPERSONMODELCOMMON_H -#define LL_LLPERSONMODELCOMMON_H - -#include "../llui/llfolderviewitem.h" -#include "../llui/llfolderviewmodel.h" - -class LLPersonTabModel; -class LLPersonModel; - -// Conversation items: we hold a list of those and create an LLFolderViewItem widget for each -// that we tuck into the mConversationsListPanel. -class LLPersonModelCommon : public LLFolderViewModelItemCommon -{ -public: - - LLPersonModelCommon(std::string name, LLFolderViewModelInterface& root_view_model); - LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model); - LLPersonModelCommon(LLFolderViewModelInterface& root_view_model); - virtual ~LLPersonModelCommon(); - - // Stub those things we won't really be using in this conversation context - virtual const std::string& getName() const { return mName; } - virtual const std::string& getDisplayName() const { return mName; } - virtual const std::string& getSearchableName() const { return mSearchableName; } - - virtual LLPointer<LLUIImage> getIcon() const { return NULL; } - virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); } - virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } - virtual std::string getLabelSuffix() const { return mLabelSuffix; } - virtual BOOL isItemRenameable() const { return TRUE; } - virtual BOOL renameItem(const std::string& new_name); - virtual BOOL isItemMovable( void ) const { return FALSE; } - virtual BOOL isItemRemovable( void ) const { return FALSE; } - virtual BOOL isItemInTrash( void) const { return FALSE; } - virtual BOOL removeItem() { return FALSE; } - virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch) { } - virtual void move( LLFolderViewModelItem* parent_listener ) { } - virtual BOOL isItemCopyable() const { return FALSE; } - virtual BOOL copyToClipboard() const { return FALSE; } - virtual BOOL cutToClipboard() const { return FALSE; } - virtual BOOL isClipboardPasteable() const { return FALSE; } - virtual void pasteFromClipboard() { } - virtual void pasteLinkFromClipboard() { } - virtual void buildContextMenu(LLMenuGL& menu, U32 flags) { } - virtual BOOL isUpToDate() const { return TRUE; } - virtual bool hasChildren() const { return FALSE; } - - virtual bool potentiallyVisible() { return true; } - - virtual bool filter( LLFolderViewFilter& filter); - - virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; } - virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0); - virtual bool passedFilter(S32 filter_generation = -1) { return mPassedFilter; } - - // The action callbacks - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void openItem( void ); - virtual void closeItem( void ); - virtual void previewItem( void ); - virtual void selectItem(void) { } - virtual void showProperties(void); - - // This method will be called to determine if a drop can be - // performed, and will set drop to TRUE if a drop is - // requested. - // Returns TRUE if a drop is possible/happened, FALSE otherwise. - virtual BOOL dragOrDrop(MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - std::string& tooltip_msg) { return FALSE; } - - const LLUUID& getID() {return mID;} - void postEvent(const std::string& event_type, LLPersonTabModel* session, LLPersonModel* participant); - -protected: - - std::string mName; // Name of the person - std::string mLabelSuffix; - std::string mSearchableName; // Name used in string matching for this person - bool mPrevPassedAllFilters; - LLUUID mID; -}; - -class LLPersonTabModel : public LLPersonModelCommon -{ -public: - enum tab_type - { - FB_SL_NON_SL_FRIEND, - FB_ONLY_FRIEND, - }; - - LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model); - LLPersonTabModel(LLFolderViewModelInterface& root_view_model); - - LLPointer<LLUIImage> getIcon() const { return NULL; } - void addParticipant(LLPersonModel* participant); - void removeParticipant(LLPersonModel* participant); - void removeParticipant(const LLUUID& participant_id); - void clearParticipants(); - LLPersonModel* findParticipant(const LLUUID& person_id); - - tab_type mTabType; - -private: -}; - -class LLPersonModel : public LLPersonModelCommon -{ -public: - LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model); - LLPersonModel(LLFolderViewModelInterface& root_view_model); - - LLUUID getAgentID(); - -private: - LLUUID mAgentID; -}; - -// Filtering functional object - -class LLPersonViewFilter : public LLFolderViewFilter -{ -public: - - enum ESortOrderType - { - SO_NAME = 0, // Sort by name - SO_ONLINE_STATUS = 0x1 // Sort by online status (i.e. online or not) - }; - // Default sort order is by name - static const U32 SO_DEFAULT = SO_NAME; - - LLPersonViewFilter(); - ~LLPersonViewFilter() {} - - // +-------------------------------------------------------------------+ - // + Execution And Results - // +-------------------------------------------------------------------+ - bool check(const LLFolderViewModelItem* item); - bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } - - void setEmptyLookupMessage(const std::string& message); - std::string getEmptyLookupMessage() const; - - bool showAllResults() const; - - std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const; - std::string::size_type getFilterStringSize() const; - - // +-------------------------------------------------------------------+ - // + Status - // +-------------------------------------------------------------------+ - bool isActive() const; - bool isModified() const; - void clearModified(); - const std::string& getName() const { return mName; } - const std::string& getFilterText() { return mName; } - void setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; mCurrentGeneration++; } - - // +-------------------------------------------------------------------+ - // + Time - // +-------------------------------------------------------------------+ - // Note : we currently filter the whole person list at once, no need to timeout then. - void resetTime(S32 timeout) { } - bool isTimedOut() { return false; } - - // +-------------------------------------------------------------------+ - // + Default - // +-------------------------------------------------------------------+ - // Note : we don't support runtime default setting for person filter - bool isDefault() const { return !isActive(); } - bool isNotDefault() const { return isActive(); } - void markDefault() { } - void resetDefault() { setModified(); } - - // +-------------------------------------------------------------------+ - // + Generation - // +-------------------------------------------------------------------+ - // Note : For the moment, we do not support restrictive filtering so all generation indexes are pointing to the current generation - S32 getCurrentGeneration() const { return mCurrentGeneration; } - S32 getFirstSuccessGeneration() const { return mCurrentGeneration; } - S32 getFirstRequiredGeneration() const { return mCurrentGeneration; } - - // Non Virtual Methods (i.e. specific to this class) - void setFilterSubString(const std::string& string); - -private: - std::string mName; - std::string mEmptyLookupMessage; - std::string mFilterSubString; - EFilterModified mFilterModified; - S32 mCurrentGeneration; -}; - -class LLPersonViewSort -{ -public: - LLPersonViewSort(U32 order = LLPersonViewFilter::SO_DEFAULT) : mSortOrder(order) { } - - bool operator()(const LLPersonModelCommon* const& a, const LLPersonModelCommon* const& b) const {return false;} - operator U32() const { return mSortOrder; } -private: - // Note: we're treating this value as a sort order bitmask as done in other places in the code (e.g. inventory) - U32 mSortOrder; -}; - - -class LLPersonFolderViewModel - : public LLFolderViewModel<LLPersonViewSort, LLPersonModelCommon, LLPersonModelCommon, LLPersonViewFilter> -{ -public: - typedef LLFolderViewModel<LLPersonViewSort, LLPersonModelCommon, LLPersonModelCommon, LLPersonViewFilter> base_t; - - void sort(LLFolderViewFolder* folder) { base_t::sort(folder);} - bool startDrag(std::vector<LLFolderViewModelItem*>& items) { return false; } // We do not allow drag of conversation items -}; - - -#endif // LL_LLPERSONMODELCOMMON_H - diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp deleted file mode 100644 index 34ffc6ffce..0000000000 --- a/indra/newview/llpersontabview.cpp +++ /dev/null @@ -1,465 +0,0 @@ -/** -* @file llpersontabview.cpp -* @brief Implementation of llpersontabview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llpersontabview.h" - -#include "llavataractions.h" -#include "llfloaterreg.h" -#include "llpersonmodelcommon.h" - -static LLDefaultChildRegistry::Register<LLPersonTabView> r_person_tab_view("person_tab_view"); - -const LLColor4U DEFAULT_WHITE(255, 255, 255); - -LLPersonTabView::Params::Params() -{} - -LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) : -LLFolderViewFolder(p), -highlight(false), -mImageHeader(LLUI::getUIImage("Accordion_Off")), -mImageHeaderOver(LLUI::getUIImage("Accordion_Over")), -mImageHeaderFocused(LLUI::getUIImage("Accordion_Selected")) -{ -} - -S32 LLPersonTabView::getLabelXPos() -{ - return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash; -} - -LLPersonTabView::~LLPersonTabView() -{ - -} - -BOOL LLPersonTabView::handleMouseDown( S32 x, S32 y, MASK mask ) -{ - bool selected_item = LLFolderViewFolder::handleMouseDown(x, y, mask); - - if(selected_item) - { - gFocusMgr.setKeyboardFocus( this ); - highlight = true; - } - - return selected_item; -} - -void LLPersonTabView::draw() -{ - static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); - static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLPersonTabView>(); - - const LLFontGL * font = LLFontGL::getFontSansSerif(); - F32 text_left = (F32)getLabelXPos(); - F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; - LLColor4 color = sFgColor; - F32 right_x = 0; - - drawHighlight(); - updateLabelRotation(); - drawOpenFolderArrow(default_params, sFgColor); - - drawLabel(font, text_left, y, color, right_x); - - LLView::draw(); -} - -void LLPersonTabView::drawHighlight() -{ - S32 width = getRect().getWidth(); - S32 height = mItemHeight; - S32 x = 1; - S32 y = getRect().getHeight() - mItemHeight; - - if(highlight) - { - mImageHeaderFocused->draw(x,y,width,height); - } - else - { - mImageHeader->draw(x,y,width,height); - } - - if(mIsMouseOverTitle) - { - mImageHeaderOver->draw(x,y,width,height); - } - -} - -// -// LLPersonView -// - -static LLDefaultChildRegistry::Register<LLPersonView> r_person_view("person_view"); - -bool LLPersonView::sChildrenWidthsInitialized = false; -ChildWidthVec LLPersonView::mChildWidthVec; - -LLPersonView::Params::Params() : -facebook_icon("facebook_icon"), -avatar_icon("avatar_icon"), -last_interaction_time_textbox("last_interaction_time_textbox"), -permission_edit_theirs_icon("permission_edit_theirs_icon"), -permission_edit_mine_icon("permission_edit_mine_icon"), -permission_map_icon("permission_map_icon"), -permission_online_icon("permission_online_icon"), -info_btn("info_btn"), -profile_btn("profile_btn"), -output_monitor("output_monitor") -{} - -LLPersonView::LLPersonView(const LLPersonView::Params& p) : -LLFolderViewItem(p), -mImageOver(LLUI::getUIImage("ListItem_Over")), -mImageSelected(LLUI::getUIImage("ListItem_Select")), -mFacebookIcon(NULL), -mAvatarIcon(NULL), -mLastInteractionTimeTextbox(NULL), -mPermissionEditTheirsIcon(NULL), -mPermissionEditMineIcon(NULL), -mPermissionMapIcon(NULL), -mPermissionOnlineIcon(NULL), -mInfoBtn(NULL), -mProfileBtn(NULL), -mOutputMonitorCtrl(NULL) -{ -} - -S32 LLPersonView::getLabelXPos() -{ - S32 label_x_pos; - - if(mAvatarIcon->getVisible()) - { - label_x_pos = getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; - } - else - { - label_x_pos = getIndentation() + mFacebookIcon->getRect().getWidth() + mIconPad; - } - - - return label_x_pos; -} - -void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) -{ - const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); - - LLFolderViewItem::addToFolder(person_folder_view); - //Added item to folder could change folder's mHasVisibleChildren flag so call arrange - person_folder_view->requestArrange(); - - mPersonTabModel = static_cast<LLPersonTabModel *>(getParentFolder()->getViewModelItem()); - - if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) - { - mAvatarIcon->setVisible(TRUE); - mFacebookIcon->setVisible(TRUE); - - S32 label_width = font->getWidth(mLabel); - F32 text_left = (F32)getLabelXPos(); - - LLRect mFacebookIconRect = mFacebookIcon->getRect(); - S32 new_left = text_left + label_width + 7; - mFacebookIconRect.set(new_left, - mFacebookIconRect.mTop, - new_left + mFacebookIconRect.getWidth(), - mFacebookIconRect.mBottom); - mFacebookIcon->setRect(mFacebookIconRect); - } - else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) - { - mFacebookIcon->setVisible(TRUE); - } - -} - -LLPersonView::~LLPersonView() -{ - -} - -BOOL LLPersonView::postBuild() -{ - if(!sChildrenWidthsInitialized) - { - initChildrenWidthVec(this); - sChildrenWidthsInitialized = true; - } - - initChildVec(); - updateChildren(); - - LLPersonModel * person_model = static_cast<LLPersonModel *>(getViewModelItem()); - - mAvatarIcon->setValue(person_model->getAgentID()); - mInfoBtn->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", person_model->getAgentID()), FALSE)); - mProfileBtn->setClickedCallback(boost::bind(&LLAvatarActions::showProfile, person_model->getAgentID())); - - return LLFolderViewItem::postBuild(); -} - -void LLPersonView::onMouseEnter(S32 x, S32 y, MASK mask) -{ - if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) - { - mInfoBtn->setVisible(TRUE); - mProfileBtn->setVisible(TRUE); - } - - updateChildren(); - LLFolderViewItem::onMouseEnter(x, y, mask); -} - -void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask) -{ - if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) - { - mInfoBtn->setVisible(FALSE); - mProfileBtn->setVisible(FALSE); - } - - updateChildren(); - LLFolderViewItem::onMouseLeave(x, y, mask); -} - -BOOL LLPersonView::handleMouseDown( S32 x, S32 y, MASK mask) -{ - if(!LLView::childrenHandleMouseDown(x, y, mask)) - { - gFocusMgr.setMouseCapture( this ); - } - - if (!mIsSelected) - { - if(mask & MASK_CONTROL) - { - getRoot()->changeSelection(this, !mIsSelected); - } - else if (mask & MASK_SHIFT) - { - getParentFolder()->extendSelectionTo(this); - } - else - { - getRoot()->setSelection(this, FALSE); - } - make_ui_sound("UISndClick"); - } - else - { - // If selected, we reserve the decision of deselecting/reselecting to the mouse up moment. - // This is necessary so we maintain selection consistent when starting a drag. - mSelectPending = TRUE; - } - - mDragStartX = x; - mDragStartY = y; - return TRUE; -} - -void LLPersonView::draw() -{ - static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); - static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); - - const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); - F32 text_left = (F32)getLabelXPos(); - F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; - LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; - F32 right_x = 0; - - drawHighlight(); - if(mLabel.length()) - { - drawLabel(mLabel, font, text_left, y, color, right_x); - } - if(mLabelSuffix.length()) - { - drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); - } - - LLView::draw(); -} - -void LLPersonView::drawHighlight() -{ - static LLUIColor outline_color = LLUIColorTable::instance().getColor("EmphasisColor", DEFAULT_WHITE); - - S32 width = getRect().getWidth(); - S32 height = mItemHeight; - S32 x = 1; - S32 y = 0; - - if(mIsSelected) - { - mImageSelected->draw(x, y, width, height); - //Draw outline - gl_rect_2d(x, - height, - width, - y, - outline_color, FALSE); - } - - if(mIsMouseOverTitle) - { - mImageOver->draw(x, y, width, height); - } -} - -void LLPersonView::drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x) -{ - font->renderUTF8(text, 0, x, y, color, - LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - S32_MAX, getRect().getWidth() - (S32) x - mLabelPaddingRight, &right_x, TRUE); -} - -void LLPersonView::initFromParams(const LLPersonView::Params & params) -{ - LLIconCtrl::Params facebook_icon_params(params.facebook_icon()); - applyXUILayout(facebook_icon_params, this); - mFacebookIcon = LLUICtrlFactory::create<LLIconCtrl>(facebook_icon_params); - addChild(mFacebookIcon); - - LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon()); - applyXUILayout(avatar_icon_params, this); - mAvatarIcon = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_icon_params); - addChild(mAvatarIcon); - - LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox()); - applyXUILayout(last_interaction_time_textbox, this); - mLastInteractionTimeTextbox = LLUICtrlFactory::create<LLTextBox>(last_interaction_time_textbox); - addChild(mLastInteractionTimeTextbox); - - LLIconCtrl::Params permission_edit_theirs_icon(params.permission_edit_theirs_icon()); - applyXUILayout(permission_edit_theirs_icon, this); - mPermissionEditTheirsIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_edit_theirs_icon); - addChild(mPermissionEditTheirsIcon); - - LLIconCtrl::Params permission_edit_mine_icon(params.permission_edit_mine_icon()); - applyXUILayout(permission_edit_mine_icon, this); - mPermissionEditMineIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_edit_mine_icon); - addChild(mPermissionEditMineIcon); - - LLIconCtrl::Params permission_map_icon(params.permission_map_icon()); - applyXUILayout(permission_map_icon, this); - mPermissionMapIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_map_icon); - addChild(mPermissionMapIcon); - - LLIconCtrl::Params permission_online_icon(params.permission_online_icon()); - applyXUILayout(permission_online_icon, this); - mPermissionOnlineIcon = LLUICtrlFactory::create<LLIconCtrl>(permission_online_icon); - addChild(mPermissionOnlineIcon); - - LLButton::Params info_btn(params.info_btn()); - applyXUILayout(info_btn, this); - mInfoBtn = LLUICtrlFactory::create<LLButton>(info_btn); - addChild(mInfoBtn); - - LLButton::Params profile_btn(params.profile_btn()); - applyXUILayout(profile_btn, this); - mProfileBtn = LLUICtrlFactory::create<LLButton>(profile_btn); - addChild(mProfileBtn); - - LLOutputMonitorCtrl::Params output_monitor(params.output_monitor()); - applyXUILayout(output_monitor, this); - mOutputMonitorCtrl = LLUICtrlFactory::create<LLOutputMonitorCtrl>(output_monitor); - addChild(mOutputMonitorCtrl); -} - -void LLPersonView::initChildrenWidthVec(LLPersonView* self) -{ - S32 output_monitor_width = self->getRect().getWidth() - self->mOutputMonitorCtrl->getRect().mLeft; - S32 profile_btn_width = self->mOutputMonitorCtrl->getRect().mLeft - self->mProfileBtn->getRect().mLeft; - S32 info_btn_width = self->mProfileBtn->getRect().mLeft - self->mInfoBtn->getRect().mLeft; - S32 permission_online_icon_width = self->mInfoBtn->getRect().mLeft - self->mPermissionOnlineIcon->getRect().mLeft; - S32 permissions_map_icon_width = self->mPermissionOnlineIcon->getRect().mLeft - self->mPermissionMapIcon->getRect().mLeft; - S32 permission_edit_mine_icon_width = self->mPermissionMapIcon->getRect().mLeft - self->mPermissionEditMineIcon->getRect().mLeft; - S32 permission_edit_theirs_icon_width = self->mPermissionEditMineIcon->getRect().mLeft - self->mPermissionEditTheirsIcon->getRect().mLeft; - S32 last_interaction_time_textbox_width = self->mPermissionEditTheirsIcon->getRect().mLeft - self->mLastInteractionTimeTextbox->getRect().mLeft; - - self->mChildWidthVec.push_back(output_monitor_width); - self->mChildWidthVec.push_back(profile_btn_width); - self->mChildWidthVec.push_back(info_btn_width); - self->mChildWidthVec.push_back(permission_online_icon_width); - self->mChildWidthVec.push_back(permissions_map_icon_width); - self->mChildWidthVec.push_back(permission_edit_mine_icon_width); - self->mChildWidthVec.push_back(permission_edit_theirs_icon_width); - self->mChildWidthVec.push_back(last_interaction_time_textbox_width); -} - -void LLPersonView::initChildVec() -{ - mChildVec.push_back(mOutputMonitorCtrl); - mChildVec.push_back(mProfileBtn); - mChildVec.push_back(mInfoBtn); - mChildVec.push_back(mPermissionOnlineIcon); - mChildVec.push_back(mPermissionMapIcon); - mChildVec.push_back(mPermissionEditMineIcon); - mChildVec.push_back(mPermissionEditTheirsIcon); - mChildVec.push_back(mLastInteractionTimeTextbox); -} - -void LLPersonView::updateChildren() -{ - mLabelPaddingRight = 0; - LLView * control; - S32 control_width; - LLRect control_rect; - - llassert(mChildWidthVec.size() == mChildVec.size()); - - for(S32 i = 0; i < mChildWidthVec.size(); ++i) - { - control = mChildVec[i]; - - if(!control->getVisible()) - { - continue; - } - - control_width = mChildWidthVec[i]; - mLabelPaddingRight += control_width; - - control_rect = control->getRect(); - control_rect.setLeftTopAndSize( - getLocalRect().getWidth() - mLabelPaddingRight, - control_rect.mTop, - control_rect.getWidth(), - control_rect.getHeight()); - - control->setShape(control_rect); - - } -} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h deleted file mode 100644 index 6f244c2794..0000000000 --- a/indra/newview/llpersontabview.h +++ /dev/null @@ -1,151 +0,0 @@ -/** -* @file llpersontabview.h -* @brief Header file for llpersontabview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLPERSONTABVIEW_H -#define LL_LLPERSONTABVIEW_H - -#include "llavatariconctrl.h" -#include "llbutton.h" -#include "llfolderviewitem.h" -#include "lloutputmonitorctrl.h" -#include "lltextbox.h" - -class LLPersonTabModel; - -class LLPersonTabView : public LLFolderViewFolder -{ - -public: - - struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params> - { - Params(); - }; - - LLPersonTabView(const LLPersonTabView::Params& p); - virtual ~LLPersonTabView(); - - S32 getLabelXPos(); - bool highlight; - - BOOL handleMouseDown( S32 x, S32 y, MASK mask ); - -protected: - void draw(); - void drawHighlight(); - -private: - - // Background images - LLPointer<LLUIImage> mImageHeader; - LLPointer<LLUIImage> mImageHeaderOver; - LLPointer<LLUIImage> mImageHeaderFocused; - -}; - -typedef std::vector<S32> ChildWidthVec; -typedef std::vector<LLView *> ChildVec; - -class LLPersonView : public LLFolderViewItem -{ - -public: - - struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params> - { - Params(); - Optional<LLIconCtrl::Params> facebook_icon; - Optional<LLAvatarIconCtrl::Params> avatar_icon; - Optional<LLTextBox::Params> last_interaction_time_textbox; - Optional<LLIconCtrl::Params> permission_edit_theirs_icon; - Optional<LLIconCtrl::Params> permission_edit_mine_icon; - Optional<LLIconCtrl::Params> permission_map_icon; - Optional<LLIconCtrl::Params> permission_online_icon; - Optional<LLButton::Params> info_btn; - Optional<LLButton::Params> profile_btn; - Optional<LLOutputMonitorCtrl::Params> output_monitor; - }; - - LLPersonView(const LLPersonView::Params& p); - virtual ~LLPersonView(); - - S32 getLabelXPos(); - void addToFolder(LLFolderViewFolder * person_folder_view); - void initFromParams(const LLPersonView::Params & params); - BOOL postBuild(); - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); - BOOL handleMouseDown( S32 x, S32 y, MASK mask); - -protected: - - void draw(); - void drawHighlight(); - void drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x); - -private: - - //Short-cut to tab model - LLPersonTabModel * mPersonTabModel; - - LLPointer<LLUIImage> mImageOver; - LLPointer<LLUIImage> mImageSelected; - LLIconCtrl * mFacebookIcon; - LLAvatarIconCtrl* mAvatarIcon; - LLTextBox * mLastInteractionTimeTextbox; - LLIconCtrl * mPermissionEditTheirsIcon; - LLIconCtrl * mPermissionEditMineIcon; - LLIconCtrl * mPermissionMapIcon; - LLIconCtrl * mPermissionOnlineIcon; - LLButton * mInfoBtn; - LLButton * mProfileBtn; - LLOutputMonitorCtrl * mOutputMonitorCtrl; - - typedef enum e_avatar_item_child { - ALIC_SPEAKER_INDICATOR, - ALIC_PROFILE_BUTTON, - ALIC_INFO_BUTTON, - ALIC_PERMISSION_ONLINE, - ALIC_PERMISSION_MAP, - ALIC_PERMISSION_EDIT_MINE, - ALIC_PERMISSION_EDIT_THEIRS, - ALIC_INTERACTION_TIME, - ALIC_COUNT, - } EAvatarListItemChildIndex; - - //Widths of controls are same for every instance so can be static - static ChildWidthVec mChildWidthVec; - //Control pointers are different for each instance so non-static - ChildVec mChildVec; - - static bool sChildrenWidthsInitialized; - static void initChildrenWidthVec(LLPersonView* self); - void initChildVec(); - void updateChildren(); -}; - -#endif // LL_LLPERSONTABVIEW_H - diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 76124148a0..1b394a3dca 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -650,105 +650,5 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M top="0" right="-1" /> </panel> - -<!-- ================================= FBC TEST TWO tab (Final, to be renamed) ========================== --> - - <panel - background_opaque="true" - background_visible="true" - bg_alpha_color="DkGray" - bg_opaque_color="DkGray" - follows="all" - height="383" - label="FBC TEST TWO" - layout="topleft" - left="0" - help_topic="people_fbctest_tab" - name="fbctesttwo_panel" - top="0"> - <panel - follows="left|top|right" - height="27" - label="bottom_panel" - layout="topleft" - left="0" - name="fbc_buttons_panel" - right="-1" - top="0"> - <filter_editor - follows="left|top|right" - height="23" - layout="topleft" - left="6" - label="Filter People" - max_length_chars="300" - name="fbc_filter_input" - text_color="Black" - text_pad_left="10" - top="4" - width="177" /> - <button - commit_callback.function="People.Gear" - follows="right" - height="25" - image_hover_unselected="Toolbar_Middle_Over" - image_overlay="OptionsMenu_Off" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - layout="topleft" - left_pad="8" - name="gear_btn" - tool_tip="Actions on selected person" - top="3" - width="31" /> - <menu_button - follows="right" - height="25" - image_hover_unselected="Toolbar_Middle_Over" - image_overlay="Conv_toolbar_sort" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - layout="topleft" - left_pad="2" - menu_filename="menu_people_friends_view.xml" - menu_position="bottomleft" - name="fbc_view_btn" - tool_tip="View/sort options" - top_delta="0" - width="31" /> - <button - follows="right" - height="25" - image_hover_unselected="Toolbar_Middle_Over" - image_overlay="AddItem_Off" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - layout="topleft" - left_pad="2" - name="fbc_add_btn" - tool_tip="Offer friendship to a resident" - top_delta="0" - width="31"> - <commit_callback - function="People.AddFriendWizard" /> - </button> - <dnd_button - follows="right" - height="25" - image_hover_unselected="Toolbar_Middle_Over" - image_overlay="TrashItem_Off" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - left_pad="2" - layout="topleft" - name="fbc_del_btn" - tool_tip="Remove selected person as a friend" - top_delta="0" - width="31"> - <commit_callback - function="People.DelFriend" /> - </dnd_button> - </panel> - </panel> </tab_container> </panel> |