summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepaneltaskinfo.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-10-03 19:46:29 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-10-03 19:55:49 +0300
commit878fb36a0bb632f5e541b132a7ded5eb047ff947 (patch)
tree9280a9ce33ddec5e186526077c7edcba2f6fe736 /indra/newview/llsidepaneltaskinfo.cpp
parentbcfd5d5279f1796abaf347d2276d2a0b9983f35e (diff)
parent2465470817957c8378e81ec1a7e32551fbac7b26 (diff)
Merge branch 'main' into DRTVWR-591-maint-X
# Conflicts: # indra/newview/app_settings/settings.xml # indra/newview/llinventorybridge.cpp # indra/newview/lltexturectrl.h # indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/newview/llsidepaneltaskinfo.cpp')
-rw-r--r--indra/newview/llsidepaneltaskinfo.cpp171
1 files changed, 91 insertions, 80 deletions
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp
index 525dd760ad..38d6aff383 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"
@@ -101,9 +102,11 @@ static std::string click_action_to_string_value(U8 click_action)
// 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);
}
@@ -111,13 +114,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");
@@ -172,12 +174,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;
}
@@ -227,12 +229,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);
@@ -279,6 +291,8 @@ void LLSidepanelTaskInfo::disablePermissions()
void LLSidepanelTaskInfo::refresh()
{
+ mIsDirty = false;
+
LLButton* btn_deed_to_group = mDeedBtn;
if (btn_deed_to_group)
{
@@ -632,23 +646,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;
@@ -656,18 +670,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;
@@ -886,33 +917,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();
}
@@ -1227,16 +1231,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);
@@ -1321,6 +1315,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())