summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelinventory.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-04 13:18:29 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-04 13:18:29 -0500
commit7383cfe14bd1522d921b96c6ab0804f888f8c5c0 (patch)
treebacaef1f8a091385c413babfe28647b70b45a6d0 /indra/newview/llsidepanelinventory.cpp
parent99b90378069f91e49d2db0a58932545f480bc4f7 (diff)
EXT-2216 : Task properties sidepanel
Guts of task properteis sidepanel created. --HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llsidepanelinventory.cpp')
-rw-r--r--indra/newview/llsidepanelinventory.cpp59
1 files changed, 38 insertions, 21 deletions
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 2ea84efd30..9b67bc701d 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -38,6 +38,7 @@
#include "llinventorypanel.h"
#include "llpanelmaininventory.h"
#include "llsidepaneliteminfo.h"
+#include "llsidepaneltaskinfo.h"
#include "lltabcontainer.h"
static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_inventory");
@@ -89,6 +90,13 @@ BOOL LLSidepanelInventory::postBuild()
LLButton* back_btn = mItemPanel->getChild<LLButton>("back_btn");
back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this));
}
+
+ // UI elements from task panel
+ {
+ mTaskPanel = getChild<LLSidepanelTaskInfo>("sidepanel__task_panel");
+ LLButton* back_btn = mTaskPanel->getChild<LLButton>("back_btn");
+ back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this));
+ }
return TRUE;
}
@@ -103,14 +111,16 @@ void LLSidepanelInventory::onOpen(const LLSD& key)
if (key.has("id"))
{
mItemPanel->setItemID(key["id"].asUUID());
+ if (key.has("object"))
+ {
+ mItemPanel->setObjectID(key["object"].asUUID());
+ }
+ showItemInfoPanel();
}
-
- if (key.has("object"))
+ if (key.has("task"))
{
- mItemPanel->setObjectID(key["object"].asUUID());
+ showTaskInfoPanel();
}
-
- toggleItemInfoPanel(TRUE);
}
void LLSidepanelInventory::onInfoButtonClicked()
@@ -120,7 +130,7 @@ void LLSidepanelInventory::onInfoButtonClicked()
{
mItemPanel->reset();
mItemPanel->setItemID(item->getUUID());
- toggleItemInfoPanel(TRUE);
+ showItemInfoPanel();
}
}
@@ -161,8 +171,7 @@ void LLSidepanelInventory::onOverflowButtonClicked()
void LLSidepanelInventory::onBackButtonClicked()
{
- toggleItemInfoPanel(FALSE);
- updateVerbs();
+ showInventoryPanel();
}
void LLSidepanelInventory::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
@@ -170,21 +179,29 @@ void LLSidepanelInventory::onSelectionChange(const std::deque<LLFolderViewItem*>
updateVerbs();
}
-void LLSidepanelInventory::toggleItemInfoPanel(BOOL visible)
+void LLSidepanelInventory::showItemInfoPanel()
{
- mItemPanel->setVisible(visible);
- mInventoryPanel->setVisible(!visible);
+ mItemPanel->setVisible(TRUE);
+ mTaskPanel->setVisible(FALSE);
+ mInventoryPanel->setVisible(FALSE);
- if (visible)
- {
- mItemPanel->dirty();
- mItemPanel->setEditMode(FALSE);
- /*
- LLRect rect = getRect();
- LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mInventoryPanel->getRect().mBottom);
- mItemPanel->reshape(new_rect.getWidth(),new_rect.getHeight());
- */
- }
+ mItemPanel->dirty();
+ mItemPanel->setEditMode(FALSE);
+}
+
+void LLSidepanelInventory::showTaskInfoPanel()
+{
+ mItemPanel->setVisible(FALSE);
+ mTaskPanel->setVisible(TRUE);
+ mInventoryPanel->setVisible(FALSE);
+}
+
+void LLSidepanelInventory::showInventoryPanel()
+{
+ mItemPanel->setVisible(FALSE);
+ mTaskPanel->setVisible(FALSE);
+ mInventoryPanel->setVisible(TRUE);
+ updateVerbs();
}
void LLSidepanelInventory::updateVerbs()