diff options
Diffstat (limited to 'indra/newview/llsidepaneltaskinfo.cpp')
-rw-r--r-- | indra/newview/llsidepaneltaskinfo.cpp | 171 |
1 files changed, 91 insertions, 80 deletions
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 225751ab92..1d6b3cd80c 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -42,6 +42,7 @@ #include "llresmgr.h" #include "lltextbox.h" #include "llbutton.h" +#include "llcallbacklist.h" #include "llcheckboxctrl.h" #include "llviewerobject.h" #include "llselectmgr.h" @@ -75,9 +76,11 @@ static LLPanelInjector<LLSidepanelTaskInfo> t_task_info("sidepanel_task_info"); // Default constructor LLSidepanelTaskInfo::LLSidepanelTaskInfo() + : mVisibleDebugPermissions(true) // space was allocated by default { setMouseOpaque(FALSE); LLSelectMgr::instance().mUpdateSignal.connect(boost::bind(&LLSidepanelTaskInfo::refreshAll, this)); + gIdleCallbacks.addFunction(&LLSidepanelTaskInfo::onIdle, (void*)this); } @@ -85,13 +88,12 @@ LLSidepanelTaskInfo::~LLSidepanelTaskInfo() { if (sActivePanel == this) sActivePanel = NULL; + gIdleCallbacks.deleteFunction(&LLSidepanelTaskInfo::onIdle, (void*)this); } // virtual BOOL LLSidepanelTaskInfo::postBuild() { - LLSidepanelInventorySubpanel::postBuild(); - mOpenBtn = getChild<LLButton>("open_btn"); mOpenBtn->setClickedCallback(boost::bind(&LLSidepanelTaskInfo::onOpenButtonClicked, this)); mPayBtn = getChild<LLButton>("pay_btn"); @@ -146,12 +148,12 @@ BOOL LLSidepanelTaskInfo::postBuild() mDALabelClickAction = getChildView("label click action"); mDAComboClickAction = getChild<LLComboBox>("clickaction"); mDAPathfindingAttributes = getChild<LLTextBase>("pathfinding_attributes_value"); - mDAB = getChildView("B:"); - mDAO = getChildView("O:"); - mDAG = getChildView("G:"); - mDAE = getChildView("E:"); - mDAN = getChildView("N:"); - mDAF = getChildView("F:"); + mDAB = getChild<LLUICtrl>("B:"); + mDAO = getChild<LLUICtrl>("O:"); + mDAG = getChild<LLUICtrl>("G:"); + mDAE = getChild<LLUICtrl>("E:"); + mDAN = getChild<LLUICtrl>("N:"); + mDAF = getChild<LLUICtrl>("F:"); return TRUE; } @@ -201,12 +203,22 @@ void LLSidepanelTaskInfo::disableAll() disablePermissions(); - mDAB->setVisible(FALSE); - mDAO->setVisible(FALSE); - mDAG->setVisible(FALSE); - mDAE->setVisible(FALSE); - mDAN->setVisible(FALSE); - mDAF->setVisible(FALSE); + if (mVisibleDebugPermissions) + { + mDAB->setVisible(FALSE); + mDAO->setVisible(FALSE); + mDAG->setVisible(FALSE); + mDAE->setVisible(FALSE); + mDAN->setVisible(FALSE); + mDAF->setVisible(FALSE); + + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + LLRect parent_rect = parent_floater->getRect(); + LLRect debug_rect = mDAB->getRect(); + // use double the debug rect for padding (since it isn't trivial to extract top_pad) + parent_floater->reshape(parent_rect.getWidth(), parent_rect.getHeight() - (debug_rect.getHeight() * 2)); + mVisibleDebugPermissions = false; + } mOpenBtn->setEnabled(FALSE); mPayBtn->setEnabled(FALSE); @@ -253,6 +265,8 @@ void LLSidepanelTaskInfo::disablePermissions() void LLSidepanelTaskInfo::refresh() { + mIsDirty = false; + LLButton* btn_deed_to_group = mDeedBtn; if (btn_deed_to_group) { @@ -606,23 +620,23 @@ void LLSidepanelTaskInfo::refresh() if (gSavedSettings.getBOOL("DebugPermissions") ) { - if (valid_base_perms) - { - getChild<LLUICtrl>("B:")->setValue("B: " + mask_to_string(base_mask_on)); - getChildView("B:")->setVisible( TRUE); - - getChild<LLUICtrl>("O:")->setValue("O: " + mask_to_string(owner_mask_on)); - getChildView("O:")->setVisible( TRUE); - - getChild<LLUICtrl>("G:")->setValue("G: " + mask_to_string(group_mask_on)); - getChildView("G:")->setVisible( TRUE); - - getChild<LLUICtrl>("E:")->setValue("E: " + mask_to_string(everyone_mask_on)); - getChildView("E:")->setVisible( TRUE); - - getChild<LLUICtrl>("N:")->setValue("N: " + mask_to_string(next_owner_mask_on)); - getChildView("N:")->setVisible( TRUE); - } + if (valid_base_perms) + { + mDAB->setValue("B: " + mask_to_string(base_mask_on)); + mDAB->setVisible( TRUE); + + mDAO->setValue("O: " + mask_to_string(owner_mask_on)); + mDAO->setVisible( TRUE); + + mDAG->setValue("G: " + mask_to_string(group_mask_on)); + mDAG->setVisible( TRUE); + + mDAE->setValue("E: " + mask_to_string(everyone_mask_on)); + mDAE->setVisible( TRUE); + + mDAN->setValue("N: " + mask_to_string(next_owner_mask_on)); + mDAN->setVisible( TRUE); + } U32 flag_mask = 0x0; if (objectp->permMove()) flag_mask |= PERM_MOVE; @@ -630,18 +644,35 @@ void LLSidepanelTaskInfo::refresh() if (objectp->permCopy()) flag_mask |= PERM_COPY; if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; - getChild<LLUICtrl>("F:")->setValue("F:" + mask_to_string(flag_mask)); - getChildView("F:")->setVisible( TRUE); - } - else - { - getChildView("B:")->setVisible( FALSE); - getChildView("O:")->setVisible( FALSE); - getChildView("G:")->setVisible( FALSE); - getChildView("E:")->setVisible( FALSE); - getChildView("N:")->setVisible( FALSE); - getChildView("F:")->setVisible( FALSE); - } + mDAF->setValue("F:" + mask_to_string(flag_mask)); + mDAF->setVisible(TRUE); + + if (!mVisibleDebugPermissions) + { + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + LLRect parent_rect = parent_floater->getRect(); + LLRect debug_rect = mDAB->getRect(); + // use double the debug rect for padding (since it isn't trivial to extract top_pad) + parent_floater->reshape(parent_rect.getWidth(), parent_rect.getHeight() + (debug_rect.getHeight() * 2)); + mVisibleDebugPermissions = true; + } + } + else if (mVisibleDebugPermissions) + { + mDAB->setVisible(FALSE); + mDAO->setVisible(FALSE); + mDAG->setVisible(FALSE); + mDAE->setVisible(FALSE); + mDAN->setVisible(FALSE); + mDAF->setVisible(FALSE); + + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + LLRect parent_rect = parent_floater->getRect(); + LLRect debug_rect = mDAB->getRect(); + // use double the debug rect for padding (since it isn't trivial to extract top_pad) + parent_floater->reshape(parent_rect.getWidth(), parent_rect.getHeight() - (debug_rect.getHeight() * 2)); + mVisibleDebugPermissions = false; + } BOOL has_change_perm_ability = FALSE; BOOL has_change_sale_ability = FALSE; @@ -864,33 +895,6 @@ void LLSidepanelTaskInfo::refresh() getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume); getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume); - if (!getIsEditing()) - { - const std::string no_item_names[] = - { - "Object Name", - "Object Description", - "button set group", - "checkbox share with group", - "button deed", - "checkbox allow everyone move", - "checkbox allow everyone copy", - "checkbox for sale", - "sale type", - "Edit Cost", - "checkbox next owner can modify", - "checkbox next owner can copy", - "checkbox next owner can transfer", - "clickaction", - "search_check", - "perm_modify", - "Group Name", - }; - for (size_t t=0; t<LL_ARRAY_SIZE(no_item_names); ++t) - { - getChildView(no_item_names[t])->setEnabled( FALSE); - } - } updateVerbs(); } @@ -1203,16 +1207,6 @@ void LLSidepanelTaskInfo::onCommitIncludeInSearch(LLUICtrl* ctrl, void* data) // virtual void LLSidepanelTaskInfo::updateVerbs() { - LLSidepanelInventorySubpanel::updateVerbs(); - - /* - mOpenBtn->setVisible(!getIsEditing()); - mPayBtn->setVisible(!getIsEditing()); - mBuyBtn->setVisible(!getIsEditing()); - //const LLViewerObject *obj = getFirstSelectedObject(); - //mEditBtn->setEnabled(obj && obj->permModify()); - */ - LLSafeHandle<LLObjectSelection> object_selection = LLSelectMgr::getInstance()->getSelection(); const BOOL any_selected = (object_selection->getNumNodes() > 0); @@ -1297,6 +1291,23 @@ LLSidepanelTaskInfo* LLSidepanelTaskInfo::getActivePanel() return sActivePanel; } +void LLSidepanelTaskInfo::dirty() +{ + mIsDirty = true; +} + +// static +void LLSidepanelTaskInfo::onIdle( void* user_data ) +{ + LLSidepanelTaskInfo* self = reinterpret_cast<LLSidepanelTaskInfo*>(user_data); + + if( self->mIsDirty ) + { + self->refresh(); + self->mIsDirty = false; + } +} + LLViewerObject* LLSidepanelTaskInfo::getObject() { if (!mObject->isDead()) |