From cd276a208b51f840178b6ff49711ba6e78940185 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 17 Dec 2009 21:16:54 -0500 Subject: EXT-1607 : Trash and Gear buttons are enabled when nothing is selected UI wasn't being updated when nothing is selected. --- indra/newview/llpanellandmarks.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'indra/newview/llpanellandmarks.cpp') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 35cd3edc81..e16bac2098 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -233,11 +233,6 @@ void LLLandmarksPanel::onSelectionChange(LLInventorySubTreePanel* inventory_list deselectOtherThan(inventory_list); mCurrentSelectedList = inventory_list; } - - LLFolderViewItem* current_item = inventory_list->getRootFolder()->getCurSelectedItem(); - if (!current_item) - return; - updateVerbs(); } @@ -246,6 +241,7 @@ void LLLandmarksPanel::onSelectorButtonClicked() // TODO: mantipov: update getting of selected item // TODO: bind to "i" button LLFolderViewItem* cur_item = mFavoritesInventoryPanel->getRootFolder()->getCurSelectedItem(); + if (!cur_item) return; LLFolderViewEventListener* listenerp = cur_item->getListener(); if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) @@ -334,6 +330,7 @@ void LLLandmarksPanel::processParcelInfo(const LLParcelData& parcel_data) if(isLandmarkSelected()) { LLFolderViewItem* cur_item = getCurSelectedItem(); + if (!cur_item) return; LLUUID id = cur_item->getListener()->getUUID(); LLInventoryItem* inv_item = mCurrentSelectedList->getModel()->getItem(id); doActionOnCurSelectedLandmark(boost::bind( @@ -761,7 +758,7 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata) { LLFolderViewItem* cur_item = getCurSelectedItem(); if(!cur_item) - return ; + return; std::string command_name = userdata.asString(); if("more_info" == command_name) { @@ -865,18 +862,18 @@ bool LLLandmarksPanel::canSelectedBeModified(const std::string& command_name) co // then ask LLFolderView permissions if (can_be_modified) { - LLFolderViewItem* selected = getCurSelectedItem(); + LLFolderViewItem* selected = getCurSelectedItem(); if ("cut" == command_name) { can_be_modified = mCurrentSelectedList->getRootFolder()->canCut(); } else if ("rename" == command_name) { - can_be_modified = selected? selected->getListener()->isItemRenameable() : false; + can_be_modified = selected ? selected->getListener()->isItemRenameable() : false; } else if ("delete" == command_name) { - can_be_modified = selected? selected->getListener()->isItemRemovable(): false; + can_be_modified = selected ? selected->getListener()->isItemRemovable(): false; } else if("paste" == command_name) { -- cgit v1.2.3