From 80d71f004c312f894c0129b5ff75ae8489e1f3f8 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 16 Feb 2015 12:29:45 +0100 Subject: [PATCH] Use refactored FSScrollListCtrl to get rid of FSAreaSearchListCtrl, FSAvatarSearchListCtrl, FSBlockListCtrl and FSContactsFriendsCtrl to reduce code duplication --- indra/newview/CMakeLists.txt | 8 --- indra/newview/fsareasearch.cpp | 6 +- indra/newview/fsareasearch.h | 6 +- indra/newview/fsareasearchlistctrl.cpp | 69 ------------------ indra/newview/fsareasearchlistctrl.h | 52 -------------- indra/newview/fsavatarsearchlistctrl.cpp | 69 ------------------ indra/newview/fsavatarsearchlistctrl.h | 52 -------------- indra/newview/fsblocklistctrl.cpp | 69 ------------------ indra/newview/fsblocklistctrl.h | 52 -------------- indra/newview/fscontactsfriendsctrl.cpp | 70 ------------------- indra/newview/fscontactsfriendsctrl.h | 52 -------------- indra/newview/fsfloatercontacts.cpp | 4 +- indra/newview/fsfloatercontacts.h | 4 +- indra/newview/fsfloatersearch.cpp | 4 +- indra/newview/fsfloatersearch.h | 4 +- indra/newview/fspanelblocklist.cpp | 4 +- indra/newview/fspanelblocklist.h | 4 +- indra/newview/fsscrolllistctrl.cpp | 2 + indra/newview/llfloateravatarpicker.cpp | 10 +-- .../xui/en/panel_fs_contacts_friends.xml | 24 +++---- .../default/xui/da/floater_avatar_picker.xml | 8 +-- .../default/xui/de/floater_avatar_picker.xml | 12 ++-- .../default/xui/de/floater_fs_area_search.xml | 24 +++---- .../xui/de/panel_fs_block_list_sidetray.xml | 8 +-- .../xui/de/panel_fs_contacts_friends.xml | 22 +++--- .../xui/de/panel_fs_search_legacy_people.xml | 4 +- .../default/xui/en/floater_avatar_picker.xml | 14 ++-- .../default/xui/en/floater_fs_area_search.xml | 24 +++---- .../xui/en/panel_fs_block_list_sidetray.xml | 10 +-- .../xui/en/panel_fs_contacts_friends.xml | 24 +++---- .../xui/en/panel_fs_search_legacy_people.xml | 4 +- .../default/xui/es/floater_avatar_picker.xml | 8 +-- .../default/xui/es/floater_fs_area_search.xml | 16 ++--- .../xui/es/panel_fs_contacts_friends.xml | 20 +++--- .../xui/es/panel_fs_search_legacy_people.xml | 4 +- .../default/xui/fr/floater_avatar_picker.xml | 8 +-- .../default/xui/it/floater_avatar_picker.xml | 8 +-- .../xui/it/panel_fs_contacts_friends.xml | 20 +++--- .../default/xui/ja/floater_avatar_picker.xml | 8 +-- .../default/xui/ja/floater_fs_area_search.xml | 18 ++--- .../xui/ja/panel_fs_contacts_friends.xml | 22 +++--- .../xui/ja/panel_fs_search_legacy_people.xml | 4 +- .../default/xui/pl/floater_avatar_picker.xml | 12 ++-- .../default/xui/pl/floater_fs_area_search.xml | 24 +++---- .../xui/pl/panel_fs_block_list_sidetray.xml | 8 +-- .../xui/pl/panel_fs_contacts_friends.xml | 22 +++--- .../xui/pl/panel_fs_search_legacy_people.xml | 4 +- .../default/xui/pt/floater_avatar_picker.xml | 8 +-- .../default/xui/ru/floater_avatar_picker.xml | 8 +-- .../xui/ru/panel_fs_contacts_friends.xml | 22 +++--- .../default/xui/tr/floater_avatar_picker.xml | 8 +-- .../default/xui/zh/floater_avatar_picker.xml | 8 +-- .../xui/en/panel_fs_contacts_friends.xml | 24 +++---- .../xui/en/panel_fs_contacts_friends.xml | 24 +++---- .../xui/en/panel_fs_search_legacy_people.xml | 4 +- .../xui/pl/panel_fs_search_legacy_people.xml | 4 +- .../xui/de/panel_fs_block_list_sidetray.xml | 8 +-- .../xui/de/panel_fs_contacts_friends.xml | 22 +++--- .../xui/en/panel_fs_block_list_sidetray.xml | 10 +-- .../xui/en/panel_fs_contacts_friends.xml | 24 +++---- .../xui/pl/panel_fs_block_list_sidetray.xml | 8 +-- 61 files changed, 308 insertions(+), 799 deletions(-) delete mode 100644 indra/newview/fsareasearchlistctrl.cpp delete mode 100644 indra/newview/fsareasearchlistctrl.h delete mode 100644 indra/newview/fsavatarsearchlistctrl.cpp delete mode 100644 indra/newview/fsavatarsearchlistctrl.h delete mode 100644 indra/newview/fsblocklistctrl.cpp delete mode 100644 indra/newview/fsblocklistctrl.h delete mode 100644 indra/newview/fscontactsfriendsctrl.cpp delete mode 100644 indra/newview/fscontactsfriendsctrl.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b962b3486f..df447aa2eb 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -133,16 +133,12 @@ set(viewer_SOURCE_FILES exopostprocess.cpp floatermedialists.cpp fsareasearch.cpp - fsareasearchlistctrl.cpp fsareasearchmenu.cpp - fsavatarsearchlistctrl.cpp fsavatarsearchmenu.cpp - fsblocklistctrl.cpp fsblocklistmenu.cpp fschathistory.cpp fscommon.cpp fsconsoleutils.cpp - fscontactsfriendsctrl.cpp fscontactsfriendsmenu.cpp fsdata.cpp fsdroptarget.cpp @@ -864,16 +860,12 @@ set(viewer_HEADER_FILES exopostprocess.h floatermedialists.h fsareasearch.h - fsareasearchlistctrl.h fsareasearchmenu.h - fsavatarsearchlistctrl.h fsavatarsearchmenu.h - fsblocklistctrl.h fsblocklistmenu.h fschathistory.h fscommon.h fsconsoleutils.h - fscontactsfriendsctrl.h fscontactsfriendsmenu.h fsdata.h fsdroptarget.h diff --git a/indra/newview/fsareasearch.cpp b/indra/newview/fsareasearch.cpp index 38a0a56e7a..39ec1a4c78 100644 --- a/indra/newview/fsareasearch.cpp +++ b/indra/newview/fsareasearch.cpp @@ -60,8 +60,8 @@ #include "llviewerjoystick.h" // For disabling/re-enabling when requested to look at an object. #include "llmoveview.h" // For LLPanelStandStopFlying::clearStandStopFlyingMode #include "rlvhandler.h" -#include "fsareasearchlistctrl.h" #include "fsareasearchmenu.h" +#include "fsscrolllistctrl.h" // max number of objects that can be (de-)selected in a single packet. const S32 MAX_OBJECTS_PER_PACKET = 255; @@ -1031,7 +1031,7 @@ void FSAreaSearch::updateObjectCosts(const LLUUID& object_id, F32 object_cost, F return; } - FSAreaSearchListCtrl* result_list = mPanelList->getResultList(); + FSScrollListCtrl* result_list = mPanelList->getResultList(); if (result_list) { LLScrollListItem* list_row = result_list->getItem(LLSD(object_id)); @@ -1278,7 +1278,7 @@ FSPanelAreaSearchList::FSPanelAreaSearchList(FSAreaSearch* pointer) BOOL FSPanelAreaSearchList::postBuild() { - mResultList = getChild("result_list"); + mResultList = getChild("result_list"); mResultList->setDoubleClickCallback(boost::bind(&FSPanelAreaSearchList::onDoubleClick, this)); mResultList->sortByColumn("name", TRUE); mResultList->setContextMenu(&gFSAreaSearchMenu); diff --git a/indra/newview/fsareasearch.h b/indra/newview/fsareasearch.h index f8070c6235..030683104a 100644 --- a/indra/newview/fsareasearch.h +++ b/indra/newview/fsareasearch.h @@ -47,12 +47,12 @@ class LLContextMenu; class LLSpinCtrl; class LLComboBox; -class FSAreaSearchListCtrl; class FSPanelAreaSearchList; class FSPanelAreaSearchFind; class FSPanelAreaSearchFilter; class FSPanelAreaSearchAdvanced; class FSPanelAreaSearchOptions; +class FSScrollListCtrl; struct FSObjectProperties { @@ -275,7 +275,7 @@ public: void updateName(LLUUID id, std::string name); void touchObject(LLViewerObject* objectp); - FSAreaSearchListCtrl* getResultList() { return mResultList; } + FSScrollListCtrl* getResultList() { return mResultList; } void updateResultListColumns(); void setAgentLastPosition(LLVector3d d) { mAgentLastPosition = d; } @@ -299,7 +299,7 @@ private: FSAreaSearch* mFSAreaSearch; LLButton* mRefreshButton; - FSAreaSearchListCtrl* mResultList; + FSScrollListCtrl* mResultList; LLCheckBoxCtrl* mCheckboxBeacons; LLTextBox* mCounterText; diff --git a/indra/newview/fsareasearchlistctrl.cpp b/indra/newview/fsareasearchlistctrl.cpp deleted file mode 100644 index ffe7fe0449..0000000000 --- a/indra/newview/fsareasearchlistctrl.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file fsareasearchlistctrl.cpp - * @brief A area search-specific implementation of scrolllist - * - * $LicenseInfo:firstyear=2014&license=viewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (c) 2014 Ansariel Hiller - * - * 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 - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "fsareasearchlistctrl.h" -#include "llscrolllistitem.h" - -static LLDefaultChildRegistry::Register r("area_search_list"); - -FSAreaSearchListCtrl::FSAreaSearchListCtrl(const Params& p) -: FSScrollListCtrl(p) -{ -} - -BOOL FSAreaSearchListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ - BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); - if (mContextMenu) - { - std::vector selected_items = getAllSelected(); - if (selected_items.size() > 1) - { - uuid_vec_t selected_uuids; - for (std::vector::iterator it = selected_items.begin(); it != selected_items.end(); ++it) - { - selected_uuids.push_back((*it)->getUUID()); - } - mContextMenu->show(this, selected_uuids, x, y); - } - else - { - LLScrollListItem* hit_item = hitItem(x, y); - if (hit_item) - { - LLUUID val = hit_item->getValue(); - selectByID(val); - uuid_vec_t selected_uuids; - selected_uuids.push_back(val); - mContextMenu->show(this, selected_uuids, x, y); - } - } - } - return handled; -} diff --git a/indra/newview/fsareasearchlistctrl.h b/indra/newview/fsareasearchlistctrl.h deleted file mode 100644 index f84aafaee1..0000000000 --- a/indra/newview/fsareasearchlistctrl.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file fsareasearchlistctrl.h - * @brief A area search-specific implementation of scrolllist - * - * $LicenseInfo:firstyear=2014&license=viewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (c) 2014 Ansariel Hiller - * - * 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 - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#ifndef FS_AREASEARCHLISTCTRL_H -#define FS_AREASEARCHLISTCTRL_H - -#include "fsscrolllistctrl.h" - -class FSAreaSearchListCtrl - : public FSScrollListCtrl, public LLInstanceTracker -{ -public: - - struct Params : public LLInitParam::Block - { - Params() - {} - }; - - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - -protected: - FSAreaSearchListCtrl(const Params&); - virtual ~FSAreaSearchListCtrl() {} - friend class LLUICtrlFactory; -}; - -#endif // FS_AREASEARCHLISTCTRL_H diff --git a/indra/newview/fsavatarsearchlistctrl.cpp b/indra/newview/fsavatarsearchlistctrl.cpp deleted file mode 100644 index 23de2ebefe..0000000000 --- a/indra/newview/fsavatarsearchlistctrl.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file fsavatarsearchlistctrl.cpp - * @brief A avatar search-specific implementation of scrolllist - * - * $LicenseInfo:firstyear=2014&license=viewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (c) 2014 Ansariel Hiller - * - * 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 - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "fsavatarsearchlistctrl.h" -#include "llscrolllistitem.h" - -static LLDefaultChildRegistry::Register r("fs_avatar_search_list"); - -FSAvatarSearchListCtrl::FSAvatarSearchListCtrl(const Params& p) -: FSScrollListCtrl(p) -{ -} - -BOOL FSAvatarSearchListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ - BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); - if (mContextMenu) - { - std::vector selected_items = getAllSelected(); - if (selected_items.size() > 1) - { - uuid_vec_t selected_uuids; - for (std::vector::iterator it = selected_items.begin(); it != selected_items.end(); ++it) - { - selected_uuids.push_back((*it)->getUUID()); - } - mContextMenu->show(this, selected_uuids, x, y); - } - else - { - LLScrollListItem* hit_item = hitItem(x, y); - if (hit_item) - { - LLUUID val = hit_item->getValue(); - selectByID(val); - uuid_vec_t selected_uuids; - selected_uuids.push_back(val); - mContextMenu->show(this, selected_uuids, x, y); - } - } - } - return handled; -} diff --git a/indra/newview/fsavatarsearchlistctrl.h b/indra/newview/fsavatarsearchlistctrl.h deleted file mode 100644 index 41778ce8b4..0000000000 --- a/indra/newview/fsavatarsearchlistctrl.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file fsavatarsearchlistctrl.h - * @brief A avatar search-specific implementation of scrolllist - * - * $LicenseInfo:firstyear=2014&license=viewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (c) 2014 Ansariel Hiller - * - * 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 - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#ifndef FS_AVATARSEARCHLISTCTRL_H -#define FS_AVATARSEARCHLISTCTRL_H - -#include "fsscrolllistctrl.h" - -class FSAvatarSearchListCtrl - : public FSScrollListCtrl, public LLInstanceTracker -{ -public: - - struct Params : public LLInitParam::Block - { - Params() - {} - }; - - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - -protected: - FSAvatarSearchListCtrl(const Params&); - virtual ~FSAvatarSearchListCtrl() {} - friend class LLUICtrlFactory; -}; - -#endif // FS_AVATARSEARCHLISTCTRL_H diff --git a/indra/newview/fsblocklistctrl.cpp b/indra/newview/fsblocklistctrl.cpp deleted file mode 100644 index deace789da..0000000000 --- a/indra/newview/fsblocklistctrl.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file fsblocklistctrl.cpp - * @brief A block list-specific implementation of scrolllist - * - * $LicenseInfo:firstyear=2014&license=viewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (c) 2014 Ansariel Hiller - * - * 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 - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "fsblocklistctrl.h" -#include "llscrolllistitem.h" - -static LLDefaultChildRegistry::Register r("fs_block_list"); - -FSBlockListCtrl::FSBlockListCtrl(const Params& p) -: FSScrollListCtrl(p) -{ -} - -BOOL FSBlockListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ - BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); - if (mContextMenu) - { - std::vector selected_items = getAllSelected(); - if (selected_items.size() > 1) - { - uuid_vec_t selected_uuids; - for (std::vector::iterator it = selected_items.begin(); it != selected_items.end(); ++it) - { - selected_uuids.push_back((*it)->getUUID()); - } - mContextMenu->show(this, selected_uuids, x, y); - } - else - { - LLScrollListItem* hit_item = hitItem(x, y); - if (hit_item) - { - LLUUID val = hit_item->getValue(); - selectByID(val); - uuid_vec_t selected_uuids; - selected_uuids.push_back(val); - mContextMenu->show(this, selected_uuids, x, y); - } - } - } - return handled; -} diff --git a/indra/newview/fsblocklistctrl.h b/indra/newview/fsblocklistctrl.h deleted file mode 100644 index 146de75e35..0000000000 --- a/indra/newview/fsblocklistctrl.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file fsblocklistctrl.h - * @brief A block list-specific implementation of scrolllist - * - * $LicenseInfo:firstyear=2014&license=viewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (c) 2014 Ansariel Hiller - * - * 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 - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#ifndef FS_BLOCKLISTCTRL_H -#define FS_BLOCKLISTCTRL_H - -#include "fsscrolllistctrl.h" - -class FSBlockListCtrl - : public FSScrollListCtrl, public LLInstanceTracker -{ -public: - - struct Params : public LLInitParam::Block - { - Params() - {} - }; - - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - -protected: - FSBlockListCtrl(const Params&); - virtual ~FSBlockListCtrl() {} - friend class LLUICtrlFactory; -}; - -#endif // FS_BLOCKLISTCTRL_H diff --git a/indra/newview/fscontactsfriendsctrl.cpp b/indra/newview/fscontactsfriendsctrl.cpp deleted file mode 100644 index f7f8880c21..0000000000 --- a/indra/newview/fscontactsfriendsctrl.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file fscontactsfriendsctrl.cpp - * @brief A friend list specific implementation of scrolllist - * - * $LicenseInfo:firstyear=2014&license=viewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (c) 2014 Ansariel Hiller @ Second Life - * - * 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 - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "fscontactsfriendsctrl.h" -#include "llscrolllistitem.h" - -static LLDefaultChildRegistry::Register r("friend_list"); - -FSContactsFriendsCtrl::FSContactsFriendsCtrl(const Params& p) -: FSScrollListCtrl(p) -{ -} - -BOOL FSContactsFriendsCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ - BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); - - if (mContextMenu) - { - std::vector selected_items = getAllSelected(); - if (selected_items.size() > 1) - { - uuid_vec_t selected_uuids; - for (std::vector::iterator it = selected_items.begin(); it != selected_items.end(); ++it) - { - selected_uuids.push_back((*it)->getUUID()); - } - mContextMenu->show(this, selected_uuids, x, y); - } - else - { - LLScrollListItem* hit_item = hitItem(x, y); - if (hit_item) - { - selectByID(hit_item->getValue()); - LLUUID av = hit_item->getValue(); - uuid_vec_t selected_uuids; - selected_uuids.push_back(av); - mContextMenu->show(this, selected_uuids, x, y); - } - } - } - return handled; -} diff --git a/indra/newview/fscontactsfriendsctrl.h b/indra/newview/fscontactsfriendsctrl.h deleted file mode 100644 index 372ed66c22..0000000000 --- a/indra/newview/fscontactsfriendsctrl.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file fscontactsfriendsctrl.h - * @brief A friend list specific implementation of scrolllist - * - * $LicenseInfo:firstyear=2014&license=viewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (c) 2014 Ansariel Hiller @ Second Life - * - * 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 - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#ifndef FS_CONTACTSFRIENDSTCTRL_H -#define FS_CONTACTSFRIENDSTCTRL_H - -#include "fsscrolllistctrl.h" - -class FSContactsFriendsCtrl -: public FSScrollListCtrl, public LLInstanceTracker -{ -public: - - struct Params : public LLInitParam::Block - { - Params() - {} - }; - - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - -protected: - FSContactsFriendsCtrl(const Params&); - virtual ~FSContactsFriendsCtrl() {} - friend class LLUICtrlFactory; -}; - -#endif // FS_CONTACTSFRIENDSTCTRL_H diff --git a/indra/newview/fsfloatercontacts.cpp b/indra/newview/fsfloatercontacts.cpp index 3992ad980d..5b17acf573 100644 --- a/indra/newview/fsfloatercontacts.cpp +++ b/indra/newview/fsfloatercontacts.cpp @@ -30,9 +30,9 @@ #include "fsfloatercontacts.h" #include "fscommon.h" -#include "fscontactsfriendsctrl.h" #include "fscontactsfriendsmenu.h" #include "fsfloaterimcontainer.h" +#include "fsscrolllistctrl.h" #include "llagent.h" #include "llavataractions.h" #include "llcallingcard.h" // for LLAvatarTracker @@ -127,7 +127,7 @@ BOOL FSFloaterContacts::postBuild() mFriendsTab = getChild(FRIENDS_TAB_NAME); mFriendListFontName = mFriendsTab->getString("FontName"); - mFriendsList = mFriendsTab->getChild("friend_list"); + mFriendsList = mFriendsTab->getChild("friend_list"); mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT); mFriendsList->setCommitOnSelectionChange(TRUE); mFriendsList->setCommitCallback(boost::bind(&FSFloaterContacts::onSelectName, this)); diff --git a/indra/newview/fsfloatercontacts.h b/indra/newview/fsfloatercontacts.h index 6364329470..4a8d23fcee 100644 --- a/indra/newview/fsfloatercontacts.h +++ b/indra/newview/fsfloatercontacts.h @@ -34,7 +34,7 @@ #include "llscrolllistcolumn.h" #include "rlvhandler.h" -class FSContactsFriendsCtrl; +class FSScrollListCtrl; class LLAvatarList; class LLAvatarTracker; class LLFriendObserver; @@ -70,7 +70,7 @@ public: void onDisplayNameChanged(); LLPanel* mFriendsTab; - FSContactsFriendsCtrl* mFriendsList; + FSScrollListCtrl* mFriendsList; LLPanel* mGroupsTab; LLGroupList* mGroupList; diff --git a/indra/newview/fsfloatersearch.cpp b/indra/newview/fsfloatersearch.cpp index aa38409945..e201db82ab 100644 --- a/indra/newview/fsfloatersearch.cpp +++ b/indra/newview/fsfloatersearch.cpp @@ -28,8 +28,8 @@ #include "llviewerprecompiledheaders.h" #include "fsfloatersearch.h" -#include "fsavatarsearchlistctrl.h" #include "fsavatarsearchmenu.h" +#include "fsscrolllistctrl.h" #include "lfsimfeaturehandler.h" #include "llagent.h" #include "llavatarname.h" @@ -731,7 +731,7 @@ FSPanelSearchPeople::~FSPanelSearchPeople() BOOL FSPanelSearchPeople::postBuild() { mSearchComboBox = findChild("people_edit"); - mSearchResults = findChild("search_results_people"); + mSearchResults = findChild("search_results_people"); if (mSearchComboBox) { mSearchComboBox->setCommitCallback(boost::bind(&FSPanelSearchPeople::onBtnFind, this)); diff --git a/indra/newview/fsfloatersearch.h b/indra/newview/fsfloatersearch.h index e0563e8e0e..9798f7c524 100644 --- a/indra/newview/fsfloatersearch.h +++ b/indra/newview/fsfloatersearch.h @@ -48,8 +48,8 @@ class LLGroupMgrObserver; class LLSearchEditor; class LLSearchComboBox; class FSFloaterSearch; -class FSAvatarSearchListCtrl; class FSPanelProfile; +class FSScrollListCtrl; struct SearchQuery : public LLInitParam::Block { @@ -108,7 +108,7 @@ private: FSFloaterSearch* mParent; LLSearchComboBox* mSearchComboBox; - FSAvatarSearchListCtrl* mSearchResults; + FSScrollListCtrl* mSearchResults; }; class FSPanelSearchGroups : public FSSearchPanelBase diff --git a/indra/newview/fspanelblocklist.cpp b/indra/newview/fspanelblocklist.cpp index ce1a0d0469..60b250ef0e 100644 --- a/indra/newview/fspanelblocklist.cpp +++ b/indra/newview/fspanelblocklist.cpp @@ -31,8 +31,8 @@ #include "fspanelblocklist.h" -#include "fsblocklistctrl.h" #include "fsblocklistmenu.h" +#include "fsscrolllistctrl.h" #include "llavataractions.h" #include "llavatarname.h" #include "llfiltereditor.h" @@ -85,7 +85,7 @@ FSPanelBlockList::~FSPanelBlockList() BOOL FSPanelBlockList::postBuild() { - mBlockedList = getChild("block_list"); + mBlockedList = getChild("block_list"); mBlockedList->setCommitOnSelectionChange(TRUE); mBlockedList->setCommitCallback(boost::bind(&FSPanelBlockList::onSelectionChanged, this)); mBlockedList->setDoubleClickCallback(boost::bind(&FSPanelBlockList::showProfile, this)); diff --git a/indra/newview/fspanelblocklist.h b/indra/newview/fspanelblocklist.h index 4113f5f096..0816ffba8e 100644 --- a/indra/newview/fspanelblocklist.h +++ b/indra/newview/fspanelblocklist.h @@ -35,7 +35,7 @@ #include "llfloater.h" class LLAvatarName; -class FSBlockListCtrl; +class FSScrollListCtrl; class FSPanelBlockList : public LLPanel, public LLMuteListObserver @@ -93,7 +93,7 @@ private: void callbackBlockByName(const std::string& text); private: - FSBlockListCtrl* mBlockedList; + FSScrollListCtrl* mBlockedList; LLHandle mAvatarPicker; LLHandle mObjectPicker; std::string mFilterSubString; diff --git a/indra/newview/fsscrolllistctrl.cpp b/indra/newview/fsscrolllistctrl.cpp index aba6288797..3c888aa879 100644 --- a/indra/newview/fsscrolllistctrl.cpp +++ b/indra/newview/fsscrolllistctrl.cpp @@ -29,6 +29,8 @@ #include "fsscrolllistctrl.h" +static LLDefaultChildRegistry::Register r("fs_scroll_list"); + FSScrollListCtrl::FSScrollListCtrl(const Params& p) : LLScrollListCtrl(p), mContextMenu(NULL), diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index fc03ce7661..5ba5b413ac 100755 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -59,8 +59,8 @@ //#include "llsdserialize.h" -#include "fsavatarsearchlistctrl.h" #include "fsavatarsearchmenu.h" +#include "fsscrolllistctrl.h" //put it back as a member once the legacy path is out? static std::map sAvatarNameMap; @@ -137,7 +137,7 @@ BOOL LLFloaterAvatarPicker::postBuild() // FIRE-5096: Add context menu for result lists //LLScrollListCtrl* searchresults = getChild("SearchResults"); - FSAvatarSearchListCtrl* searchresults = getChild("SearchResults"); + FSScrollListCtrl* searchresults = getChild("SearchResults"); searchresults->setContextMenu(&gFSAvatarSearchMenu); // searchresults->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); @@ -146,7 +146,7 @@ BOOL LLFloaterAvatarPicker::postBuild() // FIRE-5096: Add context menu for result lists //LLScrollListCtrl* nearme = getChild("NearMe"); - FSAvatarSearchListCtrl* nearme = getChild("NearMe"); + FSScrollListCtrl* nearme = getChild("NearMe"); nearme->setContextMenu(&gFSAvatarSearchMenu); // nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); @@ -154,7 +154,7 @@ BOOL LLFloaterAvatarPicker::postBuild() // FIRE-5096: Add context menu for result lists //LLScrollListCtrl* friends = getChild("Friends"); - FSAvatarSearchListCtrl* friends = getChild("Friends"); + FSScrollListCtrl* friends = getChild("Friends"); friends->setContextMenu(&gFSAvatarSearchMenu); // friends->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); @@ -183,7 +183,7 @@ BOOL LLFloaterAvatarPicker::postBuild() childSetAction("FindUUID", boost::bind(&LLFloaterAvatarPicker::onBtnFindUUID, this)); getChildView("FindUUID")->setEnabled(FALSE); - FSAvatarSearchListCtrl* searchresultsuuid = getChild("SearchResultsUUID"); + FSScrollListCtrl* searchresultsuuid = getChild("SearchResultsUUID"); searchresultsuuid->setContextMenu(&gFSAvatarSearchMenu); searchresultsuuid->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); searchresultsuuid->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this)); diff --git a/indra/newview/skins/ansastorm/xui/en/panel_fs_contacts_friends.xml b/indra/newview/skins/ansastorm/xui/en/panel_fs_contacts_friends.xml index 612484fa11..26e108ba17 100644 --- a/indra/newview/skins/ansastorm/xui/en/panel_fs_contacts_friends.xml +++ b/indra/newview/skins/ansastorm/xui/en/panel_fs_contacts_friends.xml @@ -26,7 +26,7 @@ top="-10" width="240" /> --> - - - - - - - - - - - - + - - - + - - +