diff options
Diffstat (limited to 'indra/newview/llpanelplaceinfo.cpp')
-rw-r--r-- | indra/newview/llpanelplaceinfo.cpp | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 40275be82f..a2d491c2cf 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -67,7 +67,10 @@ LLPanelPlaceInfo::LLPanelPlaceInfo() mRequestedID(), mPosRegion(), mLandmarkID(), - mMinHeight(0) + mMinHeight(0), + mScrollingPanel(NULL), + mInfoPanel(NULL), + mMediaPanel(NULL) {} LLPanelPlaceInfo::~LLPanelPlaceInfo() @@ -110,9 +113,10 @@ BOOL LLPanelPlaceInfo::postBuild() mMinHeight = scroll_container->getScrolledViewRect().getHeight(); mScrollingPanel = getChild<LLPanel>("scrolling_panel"); - - mInfoPanel = getChild<LLPanel>("info_panel", TRUE, FALSE); - mMediaPanel = getChild<LLMediaPanel>("media_panel", TRUE, FALSE); + mInfoPanel = getChild<LLPanel>("info_panel"); + mMediaPanel = getChild<LLMediaPanel>("media_panel"); + if (!(mMediaPanel && mInfoPanel && mScrollingPanel)) + return FALSE; return TRUE; } @@ -240,12 +244,20 @@ void LLPanelPlaceInfo::setInfoType(INFO_TYPE type) if (!mInfoPanel) return; + if (type != PLACE) + toggleMediaPanel(FALSE); + + bool is_landmark_info_type = type == LANDMARK; + LLPanel* landmark_info_panel = getChild<LLPanel>("landmark_info_panel"); + if (landmark_info_panel) + { + landmark_info_panel->setVisible(is_landmark_info_type); + } + switch(type) { case CREATE_LANDMARK: mCurrentTitle = getString("title_create_landmark"); - - toggleMediaPanel(FALSE); break; case PLACE: @@ -261,14 +273,10 @@ void LLPanelPlaceInfo::setInfoType(INFO_TYPE type) // a landmark or a teleport history item case LANDMARK: mCurrentTitle = getString("title_landmark"); - - toggleMediaPanel(FALSE); break; - + case TELEPORT_HISTORY: mCurrentTitle = getString("title_place"); - - toggleMediaPanel(FALSE); break; } } @@ -383,7 +391,7 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) if (mCurrentTitle != getString("title_landmark")) { - mTitleEditor->setText(parcel_data.name + "; " + name); + mTitleEditor->setText(parcel_data.name); mNotesEditor->setText(LLStringUtil::null); } } @@ -499,7 +507,7 @@ void LLPanelPlaceInfo::createLandmark(const LLUUID& folder_id) // If typed name is empty use the parcel name instead. if (name.empty()) { - name = mParcelName->getText() + "; " + mRegionName->getText(); + name = mParcelName->getText(); } LLStringUtil::replaceChar(desc, '\n', ' '); @@ -510,7 +518,7 @@ void LLPanelPlaceInfo::createLandmark(const LLUUID& folder_id) void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent) { - if (mMinHeight > 0) + if (mMinHeight > 0 && mScrollingPanel != NULL) { mScrollingPanel->reshape(mScrollingPanel->getRect().getWidth(), mMinHeight); } |