From a904e887bdee8656694551697e860a06bbfe9b6c Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Wed, 27 Jan 2010 19:00:12 +0200 Subject: Fixed normal bug (EXT-4700) Creating a landmark brings up the Landmark sidepanel info twice. - Disabled "Close" and "Back" buttons to prevent closing "Create Landmark" panel until created landmark is loaded. --HG-- branch : product-engine --- indra/newview/llpanelplaces.cpp | 26 ++++++++++++++++++-------- indra/newview/llpanelplaces.h | 2 ++ indra/newview/llviewermessage.cpp | 5 +++-- 3 files changed, 23 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 7272a8a652..29cfbbe606 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -272,11 +272,11 @@ BOOL LLPanelPlaces::postBuild() if (!mPlaceProfile || !mLandmarkInfo) return FALSE; - LLButton* back_btn = mPlaceProfile->getChild("back_btn"); - back_btn->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this)); + mPlaceProfileBackBtn = mPlaceProfile->getChild("back_btn"); + mPlaceProfileBackBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this)); - back_btn = mLandmarkInfo->getChild("back_btn"); - back_btn->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this)); + mLandmarkInfoBackBtn = mLandmarkInfo->getChild("back_btn"); + mLandmarkInfoBackBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this)); LLLineEditor* title_editor = mLandmarkInfo->getChild("title_editor"); title_editor->setKeystrokeCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this), NULL); @@ -327,9 +327,12 @@ void LLPanelPlaces::onOpen(const LLSD& key) mLandmarkInfo->displayParcelInfo(LLUUID(), mPosGlobal); - // Disable Save button because there is no item to save yet. - // The button will be enabled in onLandmarkLoaded callback. + // Disabling "Save", "Close" and "Back" buttons to prevent closing "Create Landmark" + // panel before created landmark is loaded. + // These buttons will be enabled when created landmark is added to inventory. mSaveBtn->setEnabled(FALSE); + mCloseBtn->setEnabled(FALSE); + mLandmarkInfoBackBtn->setEnabled(FALSE); } else if (mPlaceInfoType == LANDMARK_INFO_TYPE) { @@ -437,6 +440,8 @@ void LLPanelPlaces::setItem(LLInventoryItem* item) mEditBtn->setEnabled(is_landmark_editable); mSaveBtn->setEnabled(is_landmark_editable); + mCloseBtn->setEnabled(TRUE); + mLandmarkInfoBackBtn->setEnabled(TRUE); if (is_landmark_editable) { @@ -488,8 +493,6 @@ void LLPanelPlaces::onLandmarkLoaded(LLLandmark* landmark) landmark->getGlobalPos(mPosGlobal); mLandmarkInfo->displayParcelInfo(region_id, mPosGlobal); - mSaveBtn->setEnabled(TRUE); - updateVerbs(); } @@ -1030,6 +1033,13 @@ void LLPanelPlaces::updateVerbs() { mTeleportBtn->setEnabled(have_3d_pos); } + + // Do not enable landmark info Back button when we are waiting + // for newly created landmark to load. + if (!is_create_landmark_visible) + { + mLandmarkInfoBackBtn->setEnabled(TRUE); + } } else { diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index a098974659..5de78b1595 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -115,6 +115,8 @@ private: LLToggleableMenu* mPlaceMenu; LLToggleableMenu* mLandmarkMenu; + LLButton* mPlaceProfileBackBtn; + LLButton* mLandmarkInfoBackBtn; LLButton* mTeleportBtn; LLButton* mShowOnMapBtn; LLButton* mEditBtn; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d6ce356c4b..36710e7532 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -906,7 +906,7 @@ void open_inventory_offer(const std::vector& items, const std::string& f if ("inventory_handler" == from_name) { //we have to filter inventory_handler messages to avoid notification displaying - LLSideTray::getInstance()->showPanel("panel_places", + LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "landmark").with("id", item->getUUID())); } else if("group_offer" == from_name) @@ -925,8 +925,9 @@ void open_inventory_offer(const std::vector& items, const std::string& f args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown"); LLNotificationsUtil::add("LandmarkCreated", args); // Created landmark is passed to Places panel to allow its editing. In fact panel should be already displayed. + // If the panel is closed we don't reopen it until created landmark is loaded. //TODO*:: dserduk(7/12/09) remove LLPanelPlaces dependency from here - LLPanelPlaces *places_panel = dynamic_cast(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); + LLPanelPlaces *places_panel = dynamic_cast(LLSideTray::getInstance()->getPanel("panel_places")); if (places_panel) { // we are creating a landmark -- cgit v1.2.3