Update to LLTombstone/LLHandle/LLRootHandle/LLHandleProvider.

This commit is contained in:
Shyotl
2012-11-13 17:55:52 -06:00
parent 3eebedc4c3
commit fe15371047
12 changed files with 130 additions and 69 deletions

View File

@@ -971,7 +971,7 @@ void LLFastTimerView::draw()
gGL.color4f(col[0], col[1], col[2], alpha);
gGL.begin(LLRender::TRIANGLE_STRIP);
for (U32 j = llmax(0, LLFastTimer::NamedTimer::HISTORY_NUM - LLFastTimer::getLastFrameIndex());
j < LLFastTimer::NamedTimer::HISTORY_NUM;
j < (U32)LLFastTimer::NamedTimer::HISTORY_NUM;
j++)
{
U64 ticks = idp->getHistoricalCount(j);

View File

@@ -263,7 +263,7 @@ LLInvFVBridge::LLInvFVBridge(LLInventoryPanel* inventory,
mInvType(LLInventoryType::IT_NONE),
mIsLink(FALSE)
{
mInventoryPanel = inventory->getHandle();
mInventoryPanel = inventory->getInventoryPanelHandle();
const LLInventoryObject* obj = getInventoryObject();
mIsLink = obj && obj->getIsLinkType();
}
@@ -973,7 +973,7 @@ LLInventoryObject* LLInvFVBridge::getInventoryObject() const
LLInventoryModel* LLInvFVBridge::getInventoryModel() const
{
LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
LLInventoryPanel* panel = mInventoryPanel.get();
return panel ? panel->getModel() : NULL;
}
@@ -1937,7 +1937,7 @@ BOOL LLFolderBridge::isItemRemovable() const
return FALSE;
}
LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
LLInventoryPanel* panel = mInventoryPanel.get();
LLFolderViewFolder* folderp = dynamic_cast<LLFolderViewFolder*>(panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL);
if (folderp)
{
@@ -3200,7 +3200,7 @@ void LLFolderBridge::buildContextMenuBaseOptions(U32 flags)
// Not sure what the right thing is to do here.
if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT))
{
LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
LLInventoryPanel* panel = mInventoryPanel.get();
if(panel && !panel->getFilterWorn())
if (!isInboxFolder() && !isOutboxFolder()) // don't allow creation in inbox or outbox
{
@@ -3481,7 +3481,7 @@ void LLFolderBridge::createNewCategory(void* user_data)
{
LLFolderBridge* bridge = (LLFolderBridge*)user_data;
if(!bridge) return;
LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(bridge->mInventoryPanel.get());
LLInventoryPanel* panel = bridge->mInventoryPanel.get();
if (!panel) return;
LLInventoryModel* model = panel->getModel();
if(!model) return;
@@ -3675,7 +3675,7 @@ void LLFolderBridge::dropToFavorites(LLInventoryItem* inv_item)
// use callback to rearrange favorite landmarks after adding
// to have new one placed before target (on which it was dropped). See EXT-4312.
LLPointer<AddFavoriteLandmarkCallback> cb = new AddFavoriteLandmarkCallback();
LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
LLInventoryPanel* panel = mInventoryPanel.get();
LLFolderViewItem* drag_over_item = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL;
if (drag_over_item && drag_over_item->getListener())
{
@@ -3724,6 +3724,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
if(!isAgentInventory()) return FALSE; // cannot drag into library
if (!isAgentAvatarValid()) return FALSE;
LLInventoryPanel* destination_panel = mInventoryPanel.get();
if (!destination_panel) return false;
const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false);
const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
@@ -3855,6 +3858,15 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
}
}
LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
// Check whether the item being dragged from active inventory panel
if (accept && active_panel)
{
LLFolderView* active_folder_view = active_panel->getRootFolder();
if (!active_folder_view) return false;
}
if(accept && drop)
{
if (inv_item->getType() == LLAssetType::AT_GESTURE
@@ -3864,14 +3876,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
}
// If an item is being dragged between windows, unselect everything in the active window
// so that we don't follow the selection to its new location (which is very annoying).
LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
if (active_panel)
if (active_panel && (destination_panel != active_panel))
{
LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
if (active_panel && (panel != active_panel))
{
active_panel->unSelectAll();
}
}
// FAVORITES folder
@@ -4034,6 +4041,15 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
accept = can_move_to_landmarks(inv_item);
}
LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
// Check whether the item being dragged from the library
if (accept && active_panel)
{
LLFolderView* active_folder_view = active_panel->getRootFolder();
if (!active_folder_view) return false;
}
if (accept && drop)
{
// FAVORITES folder
@@ -4436,7 +4452,7 @@ LLCallingCardBridge::~LLCallingCardBridge()
void LLCallingCardBridge::refreshFolderViewItem()
{
LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
LLInventoryPanel* panel = mInventoryPanel.get();
LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL;
if (itemp)
{

View File

@@ -160,7 +160,7 @@ protected:
BOOL restamp);
void removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*>& batch);
protected:
LLHandle<LLPanel> mInventoryPanel;
LLHandle<LLInventoryPanel> mInventoryPanel;
LLFolderView* mRoot;
const LLUUID mUUID; // item id
LLInventoryType::EType mInvType;

View File

@@ -129,6 +129,8 @@ public:
LLScrollableContainerView* getScrollableContainer() { return mScroller; }
void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
LLHandle<LLInventoryPanel> getInventoryPanelHandle() const { return getDerivedHandle<LLInventoryPanel>(); }
// DEBUG ONLY:
static void dumpSelectionInformation(void* user_data);

View File

@@ -78,8 +78,6 @@ LLPanelMediaHUD::LLPanelMediaHUD(viewer_media_t media_impl)
mFadeTimer.stop();
mCurrentZoom = ZOOM_NONE;
mScrollState = SCROLL_NONE;
mPanelHandle.bind(this);
}
LLPanelMediaHUD::~LLPanelMediaHUD()
{

View File

@@ -55,7 +55,8 @@ public:
void nextZoomLevel();
void resetZoomLevel() { mCurrentZoom = ZOOM_NONE; }
LLHandle<LLPanelMediaHUD> getHandle() const { return mPanelHandle; }
LLHandle<LLPanelMediaHUD> getHandle() const { return getDerivedHandle<LLPanelMediaHUD>(); }
void setMediaImpl(viewer_media_t media_impl) { mMediaImpl = media_impl; }
@@ -105,7 +106,6 @@ private:
F32 mMouseInactiveTime;
F32 mControlFadeTime;
viewer_media_t mMediaImpl;
LLRootHandle<LLPanelMediaHUD> mPanelHandle;
};
#endif // LL_PANELMEDIAHUD_H