summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellandmarks.cpp
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2009-11-09 15:59:29 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2009-11-09 15:59:29 +0200
commit1b0732183e4437ce673b13c8092f8122db884587 (patch)
treedc913dbaab1699bb27854d9f22531aa2a6f86e28 /indra/newview/llpanellandmarks.cpp
parent148a29ea1ec97922180ca8f0f6ced9a4a9e05c07 (diff)
parent21c51025da7f9128a1b425a5e88331ae0e3fe4d4 (diff)
Merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpanellandmarks.cpp')
-rw-r--r--indra/newview/llpanellandmarks.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 34c146826f..ce1a7f98df 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -47,6 +47,7 @@
#include "lldndbutton.h"
#include "llfloaterworldmap.h"
#include "llfolderviewitem.h"
+#include "llinventorypanel.h"
#include "llinventorysubtreepanel.h"
#include "lllandmarkactions.h"
#include "llplacesinventorybridge.h"
@@ -100,6 +101,8 @@ BOOL LLLandmarksPanel::postBuild()
initLandmarksInventroyPanel();
initMyInventroyPanel();
initLibraryInventroyPanel();
+ getChild<LLAccordionCtrlTab>("tab_favorites")->setDisplayChildren(true);
+ getChild<LLAccordionCtrlTab>("tab_landmarks")->setDisplayChildren(true);
gIdleCallbacks.addFunction(LLLandmarksPanel::doIdle, this);
return TRUE;
@@ -264,7 +267,7 @@ LLLandmark* LLLandmarksPanel::getCurSelectedLandmark() const
return NULL;
}
-LLFolderViewItem* LLLandmarksPanel::getCurSelectedItem () const
+LLFolderViewItem* LLLandmarksPanel::getCurSelectedItem() const
{
return mCurrentSelectedList ? mCurrentSelectedList->getRootFolder()->getCurSelectedItem() : NULL;
}
@@ -421,6 +424,7 @@ void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLIn
mAccordionTabs.push_back(accordion_tab);
accordion_tab->setDropDownStateChangedCallback(
boost::bind(&LLLandmarksPanel::onAccordionExpandedCollapsed, this, _2, inventory_list));
+ accordion_tab->setDisplayChildren(false);
}
void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLInventorySubTreePanel* inventory_list)
@@ -495,6 +499,7 @@ void LLLandmarksPanel::updateListCommands()
// keep Options & Add Landmark buttons always enabled
mListCommands->childSetEnabled(ADD_FOLDER_BUTTON_NAME, add_folder_enabled);
mListCommands->childSetEnabled(TRASH_BUTTON_NAME, trash_enabled);
+ mListCommands->childSetEnabled(OPTIONS_BUTTON_NAME,getCurSelectedItem() != NULL);
}
void LLLandmarksPanel::onActionsButtonClick()
@@ -585,7 +590,7 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const
menu_create_inventory_item(mCurrentSelectedList->getRootFolder(),
dynamic_cast<LLFolderBridge*> (folder_bridge), LLSD(
"category"), gInventory.findCategoryUUIDForType(
- LLAssetType::AT_LANDMARK));
+ LLFolderType::FT_LANDMARK));
}
}
}
@@ -617,21 +622,19 @@ void LLLandmarksPanel::onClipboardAction(const LLSD& userdata) const
void LLLandmarksPanel::onFoldingAction(const LLSD& userdata)
{
- LLFolderView* landmarks_folder = mLandmarksInventoryPanel->getRootFolder();
- LLFolderView* fav_folder = mFavoritesInventoryPanel->getRootFolder();
+ if(!mCurrentSelectedList) return;
+
+ LLFolderView* root_folder = mCurrentSelectedList->getRootFolder();
std::string command_name = userdata.asString();
if ("expand_all" == command_name)
{
- landmarks_folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN);
- fav_folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN);
- landmarks_folder->arrangeAll();
- fav_folder->arrangeAll();
+ root_folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN);
+ root_folder->arrangeAll();
}
else if ("collapse_all" == command_name)
{
- landmarks_folder->closeAllFolders();
- fav_folder->closeAllFolders();
+ root_folder->closeAllFolders();
}
else if ( "sort_by_date" == command_name)
{
@@ -642,9 +645,6 @@ void LLLandmarksPanel::onFoldingAction(const LLSD& userdata)
}
else
{
- if(!mCurrentSelectedList) return;
-
- LLFolderView* root_folder = mCurrentSelectedList->getRootFolder();
root_folder->doToSelected(&gInventory, userdata);
}
}
@@ -830,17 +830,18 @@ bool LLLandmarksPanel::canSelectedBeModified(const std::string& command_name) co
// then ask LLFolderView permissions
if (can_be_modified)
{
+ LLFolderViewItem* selected = getCurSelectedItem();
if ("cut" == command_name)
{
can_be_modified = mCurrentSelectedList->getRootFolder()->canCut();
}
else if ("rename" == command_name)
{
- can_be_modified = getCurSelectedItem()->getListener()->isItemRenameable();
+ can_be_modified = selected? selected->getListener()->isItemRenameable() : false;
}
else if ("delete" == command_name)
{
- can_be_modified = getCurSelectedItem()->getListener()->isItemRemovable();
+ can_be_modified = selected? selected->getListener()->isItemRemovable(): false;
}
else if("paste" == command_name)
{