diff options
Diffstat (limited to 'indra/newview/llpanelpicks.cpp')
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 61 |
1 files changed, 10 insertions, 51 deletions
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 10b90b08d7..cc6e88a9d2 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -32,12 +32,15 @@ #include "llviewerprecompiledheaders.h" +#include "llpanelpicks.h" + #include "llagent.h" #include "llagentpicksinfo.h" #include "llavatarconstants.h" #include "llflatlistview.h" #include "llfloaterreg.h" #include "llfloaterworldmap.h" +#include "llnotificationsutil.h" #include "lltexturectrl.h" #include "lltoggleablemenu.h" #include "llviewergenericmessage.h" // send_generic_message @@ -47,7 +50,6 @@ #include "llaccordionctrl.h" #include "llaccordionctrltab.h" -#include "llpanelpicks.h" #include "llavatarpropertiesprocessor.h" #include "llpanelavatar.h" #include "llpanelprofile.h" @@ -59,7 +61,6 @@ static const std::string XML_BTN_DELETE = "trash_btn"; static const std::string XML_BTN_INFO = "info_btn"; static const std::string XML_BTN_TELEPORT = "teleport_btn"; static const std::string XML_BTN_SHOW_ON_MAP = "show_on_map_btn"; -static const std::string XML_BTN_OVERFLOW = "overflow_btn"; static const std::string PICK_ID("pick_id"); static const std::string PICK_CREATOR_ID("pick_creator_id"); @@ -111,7 +112,6 @@ LLPanelPicks::LLPanelPicks() mClassifiedsList(NULL), mPanelPickInfo(NULL), mPanelPickEdit(NULL), - mOverflowMenu(NULL), mPlusMenu(NULL), mPicksAccTab(NULL), mClassifiedsAccTab(NULL), @@ -271,7 +271,6 @@ BOOL LLPanelPicks::postBuild() childSetAction(XML_BTN_TELEPORT, boost::bind(&LLPanelPicks::onClickTeleport, this)); childSetAction(XML_BTN_SHOW_ON_MAP, boost::bind(&LLPanelPicks::onClickMap, this)); childSetAction(XML_BTN_INFO, boost::bind(&LLPanelPicks::onClickInfo, this)); - childSetAction(XML_BTN_OVERFLOW, boost::bind(&LLPanelPicks::onOverflowButtonClicked, this)); mPicksAccTab = getChild<LLAccordionCtrlTab>("tab_picks"); mPicksAccTab->setDropDownStateChangedCallback(boost::bind(&LLPanelPicks::onAccordionStateChanged, this, mPicksAccTab)); @@ -289,10 +288,6 @@ BOOL LLPanelPicks::postBuild() registar.add("Pick.Delete", boost::bind(&LLPanelPicks::onClickDelete, this)); mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_picks.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar overflow_registar; - overflow_registar.add("PicksList.Overflow", boost::bind(&LLPanelPicks::onOverflowMenuItemClicked, this, _2)); - mOverflowMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_picks_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar plus_registar; plus_registar.add("Picks.Plus.Action", boost::bind(&LLPanelPicks::onPlusMenuItemClicked, this, _2)); mPlusMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_picks_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); @@ -300,24 +295,6 @@ BOOL LLPanelPicks::postBuild() return TRUE; } -void LLPanelPicks::onOverflowMenuItemClicked(const LLSD& param) -{ - std::string value = param.asString(); - - if("info" == value) - { - onClickInfo(); - } - else if("teleport" == value) - { - onClickTeleport(); - } - else if("map" == value) - { - onClickMap(); - } -} - void LLPanelPicks::onPlusMenuItemClicked(const LLSD& param) { std::string value = param.asString(); @@ -346,23 +323,6 @@ void LLPanelPicks::onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab) updateButtons(); } -void LLPanelPicks::onOverflowButtonClicked() -{ - if (!mOverflowMenu->toggleVisibility()) - return; - - LLView* btn = getChild<LLView>(XML_BTN_OVERFLOW); - - if (mOverflowMenu->getButtonRect().isEmpty()) - { - mOverflowMenu->setButtonRect(btn); - } - mOverflowMenu->updateParent(LLMenuGL::sMenuContainer); - - LLRect rect = btn->getRect(); - LLMenuGL::showPopup(this, mOverflowMenu, rect.mRight, rect.mTop); -} - void LLPanelPicks::onOpen(const LLSD& key) { const LLUUID id(key.asUUID()); @@ -431,7 +391,7 @@ void LLPanelPicks::onClickDelete() { LLSD args; args["PICK"] = value[PICK_NAME]; - LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeletePick, this, _1, _2)); + LLNotificationsUtil::add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeletePick, this, _1, _2)); return; } @@ -440,14 +400,14 @@ void LLPanelPicks::onClickDelete() { LLSD args; args["NAME"] = value[CLASSIFIED_NAME]; - LLNotifications::instance().add("DeleteClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeleteClassified, this, _1, _2)); + LLNotificationsUtil::add("DeleteClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeleteClassified, this, _1, _2)); return; } } bool LLPanelPicks::callbackDeletePick(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLSD pick_value = mPicksList->getSelectedValue(); if (0 == option) @@ -461,7 +421,7 @@ bool LLPanelPicks::callbackDeletePick(const LLSD& notification, const LLSD& resp bool LLPanelPicks::callbackDeleteClassified(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLSD value = mClassifiedsList->getSelectedValue(); if (0 == option) @@ -475,7 +435,7 @@ bool LLPanelPicks::callbackDeleteClassified(const LLSD& notification, const LLSD bool LLPanelPicks::callbackTeleport( const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { @@ -540,7 +500,7 @@ void LLPanelPicks::onDoubleClickPickItem(LLUICtrl* item) LLSD args; args["PICK"] = pick_value[PICK_NAME]; - LLNotifications::instance().add("TeleportToPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); + LLNotificationsUtil::add("TeleportToPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); } void LLPanelPicks::onDoubleClickClassifiedItem(LLUICtrl* item) @@ -550,7 +510,7 @@ void LLPanelPicks::onDoubleClickClassifiedItem(LLUICtrl* item) LLSD args; args["CLASSIFIED"] = value[CLASSIFIED_NAME]; - LLNotifications::instance().add("TeleportToClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); + LLNotificationsUtil::add("TeleportToClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); } void LLPanelPicks::updateButtons() @@ -566,7 +526,6 @@ void LLPanelPicks::updateButtons() childSetEnabled(XML_BTN_INFO, has_selected); childSetEnabled(XML_BTN_TELEPORT, has_selected); childSetEnabled(XML_BTN_SHOW_ON_MAP, has_selected); - childSetEnabled(XML_BTN_OVERFLOW, has_selected); } void LLPanelPicks::setProfilePanel(LLPanelProfile* profile_panel) |