diff options
-rw-r--r-- | indra/newview/llpanellandmarks.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llpanellandmarks.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelplaces.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpanelplaces.h | 2 | ||||
-rw-r--r-- | indra/newview/llpanelplacestab.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llpanelplacestab.h | 2 | ||||
-rw-r--r-- | indra/newview/llpanelteleporthistory.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llpanelteleporthistory.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_places.xml | 9 |
9 files changed, 59 insertions, 4 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 8d8c996374..a1cdbdad59 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -280,6 +280,17 @@ void LLLandmarksPanel::onShowOnMap() doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doShowOnMap, this, _1)); } +//virtual +void LLLandmarksPanel::onShowProfile() +{ + LLFolderViewItem* cur_item = getCurSelectedItem(); + + if(!cur_item) + return; + + cur_item->getListener()->performAction(mCurrentSelectedList->getModel(),"about"); +} + // virtual void LLLandmarksPanel::onTeleport() { @@ -306,6 +317,7 @@ void LLLandmarksPanel::updateVerbs() bool landmark_selected = isLandmarkSelected(); mTeleportBtn->setEnabled(landmark_selected && isActionEnabled("teleport")); mShowOnMapBtn->setEnabled(landmark_selected && isActionEnabled("show_on_map")); + mShowProfile->setEnabled(landmark_selected && isActionEnabled("more_info")); // TODO: mantipov: Uncomment when mShareBtn is supported // Share button should be enabled when neither a folder nor a landmark is selected @@ -977,13 +989,10 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const void LLLandmarksPanel::onCustomAction(const LLSD& userdata) { - LLFolderViewItem* cur_item = getCurSelectedItem(); - if(!cur_item) - return; std::string command_name = userdata.asString(); if("more_info" == command_name) { - cur_item->getListener()->performAction(mCurrentSelectedList->getModel(),"about"); + onShowProfile(); } else if ("teleport" == command_name) { diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index c9217a4b2f..da5d683cfc 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -57,6 +57,7 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onSearchEdit(const std::string& string); /*virtual*/ void onShowOnMap(); + /*virtual*/ void onShowProfile(); /*virtual*/ void onTeleport(); /*virtual*/ void updateVerbs(); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 54455afa4f..17784c31e3 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -252,6 +252,9 @@ BOOL LLPanelPlaces::postBuild() mOverflowBtn = getChild<LLButton>("overflow_btn"); mOverflowBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onOverflowButtonClicked, this)); + mPlaceInfoBtn = getChild<LLButton>("profile_btn"); + mPlaceInfoBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onProfileButtonClicked, this)); + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; registrar.add("Places.OverflowMenu.Action", boost::bind(&LLPanelPlaces::onOverflowMenuItemClicked, this, _2)); LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; @@ -745,6 +748,14 @@ void LLPanelPlaces::onOverflowButtonClicked() LLMenuGL::showPopup(this, menu, rect.mRight, rect.mTop); } +void LLPanelPlaces::onProfileButtonClicked() +{ + if (!mActivePanel) + return; + + mActivePanel->onShowProfile(); +} + bool LLPanelPlaces::onOverflowMenuItemEnable(const LLSD& param) { std::string value = param.asString(); @@ -1060,8 +1071,11 @@ void LLPanelPlaces::updateVerbs() mSaveBtn->setVisible(isLandmarkEditModeOn); mCancelBtn->setVisible(isLandmarkEditModeOn); mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn); + mPlaceInfoBtn->setVisible(mPlaceInfoType != LANDMARK_INFO_TYPE && mPlaceInfoType != TELEPORT_HISTORY_INFO_TYPE + && !is_create_landmark_visible && !isLandmarkEditModeOn); mShowOnMapBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn && have_3d_pos); + mPlaceInfoBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn && have_3d_pos); if (is_place_info_visible) { diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 97cf43d222..7a77fc9300 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -98,6 +98,7 @@ private: bool onOverflowMenuItemEnable(const LLSD& param); void onCreateLandmarkButtonClicked(const LLUUID& folder_id); void onBackButtonClicked(); + void onProfileButtonClicked(); void toggleMediaPanel(); void togglePickPanel(BOOL visible); @@ -128,6 +129,7 @@ private: LLButton* mCancelBtn; LLButton* mCloseBtn; LLButton* mOverflowBtn; + LLButton* mPlaceInfoBtn; LLPlacesInventoryObserver* mInventoryObserver; LLPlacesParcelObserver* mParcelObserver; diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp index 9806b8c64d..42cf3b03a3 100644 --- a/indra/newview/llpanelplacestab.cpp +++ b/indra/newview/llpanelplacestab.cpp @@ -56,6 +56,7 @@ void LLPanelPlacesTab::setPanelPlacesButtons(LLPanelPlaces* panel) { mTeleportBtn = panel->getChild<LLButton>("teleport_btn"); mShowOnMapBtn = panel->getChild<LLButton>("map_btn"); + mShowProfile = panel->getChild<LLButton>("profile_btn"); } void LLPanelPlacesTab::onRegionResponse(const LLVector3d& landmark_global_pos, diff --git a/indra/newview/llpanelplacestab.h b/indra/newview/llpanelplacestab.h index ce77a42259..f4e93a7658 100644 --- a/indra/newview/llpanelplacestab.h +++ b/indra/newview/llpanelplacestab.h @@ -45,6 +45,7 @@ public: virtual void onSearchEdit(const std::string& string) = 0; virtual void updateVerbs() = 0; // Updates buttons at the bottom of Places panel virtual void onShowOnMap() = 0; + virtual void onShowProfile() = 0; virtual void onTeleport() = 0; bool isTabVisible(); // Check if parent TabContainer is visible. @@ -62,6 +63,7 @@ public: protected: LLButton* mTeleportBtn; LLButton* mShowOnMapBtn; + LLButton* mShowProfile; // Search string for filtering landmarks and teleport history locations static std::string sFilterSubString; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 0a34531eee..c0b2244038 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -496,6 +496,20 @@ void LLTeleportHistoryPanel::onShowOnMap() } } +//virtual +void LLTeleportHistoryPanel::onShowProfile() +{ + if (!mLastSelectedFlatlList) + return; + + LLTeleportHistoryFlatItem* itemp = dynamic_cast<LLTeleportHistoryFlatItem *> (mLastSelectedFlatlList->getSelectedItem()); + + if(!itemp) + return; + + LLTeleportHistoryFlatItem::showPlaceInfoPanel(itemp->getIndex()); +} + // virtual void LLTeleportHistoryPanel::onTeleport() { @@ -544,6 +558,7 @@ void LLTeleportHistoryPanel::updateVerbs() { mTeleportBtn->setEnabled(false); mShowOnMapBtn->setEnabled(false); + mShowProfile->setEnabled(false); return; } @@ -551,6 +566,7 @@ void LLTeleportHistoryPanel::updateVerbs() mTeleportBtn->setEnabled(NULL != itemp); mShowOnMapBtn->setEnabled(NULL != itemp); + mShowProfile->setEnabled(NULL != itemp); } void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, LLDate& tab_date) diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index 5e2ccc0c93..a456ca506f 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -73,6 +73,7 @@ public: /*virtual*/ void onSearchEdit(const std::string& string); /*virtual*/ void onShowOnMap(); + /*virtual*/ void onShowProfile(); /*virtual*/ void onTeleport(); ///*virtual*/ void onCopySLURL(); /*virtual*/ void updateVerbs(); diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index 5d1d1ab951..a7a0efcdb3 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -134,5 +134,14 @@ background_visible="true" right="-10" top="1" width="60" /> + <button + follows="bottom|left" + height="23" + label="Profile" + layout="topleft" + name="profile_btn" + right="-1" + top="1" + width="111" /> </panel> </panel> |