diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 6e148fbf5a..bc63dfd493 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -1210,7 +1210,7 @@ LLSD LLInventoryCategory::asLLSD() const return sd; } -LLSD LLInventoryCategory::asAISLLSD() const +LLSD LLInventoryCategory::asAISCreateCatLLSD() const { LLSD sd = LLSD(); sd[INV_FOLDER_ID_LABEL_WS] = mUUID; @@ -1222,10 +1222,6 @@ LLSD LLInventoryCategory::asAISLLSD() const { sd[INV_THUMBNAIL_LABEL] = LLSD().with(INV_ASSET_ID_LABEL, mThumbnailUUID); } - else - { - sd[INV_THUMBNAIL_LABEL] = LLSD(); - } return sd; } diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index 516cfc6a24..6d4535af27 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -253,7 +253,7 @@ public: LLFolderType::EType getPreferredType() const; void setPreferredType(LLFolderType::EType type); LLSD asLLSD() const; - LLSD asAISLLSD() const; + LLSD asAISCreateCatLLSD() const; bool fromLLSD(const LLSD& sd); //-------------------------------------------------------------------- diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 23fe70a3fa..0f1f207b87 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1119,7 +1119,7 @@ void LLInventoryModel::createNewCategory(const LLUUID& parent_id, new_inventory["categories"] = LLSD::emptyArray(); LLViewerInventoryCategory cat(LLUUID::null, parent_id, preferred_type, name, gAgent.getID()); cat.setThumbnailUUID(thumbnail_id); - LLSD cat_sd = cat.asAISLLSD(); + LLSD cat_sd = cat.asAISCreateCatLLSD(); new_inventory["categories"].append(cat_sd); AISAPI::CreateInventory( parent_id, diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index bac5ba795b..94282607d2 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -81,6 +81,7 @@ static LLPanelInjector 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)); @@ -152,12 +153,12 @@ BOOL LLSidepanelTaskInfo::postBuild() mDALabelClickAction = getChildView("label click action"); mDAComboClickAction = getChild("clickaction"); mDAPathfindingAttributes = getChild("pathfinding_attributes_value"); - mDAB = getChildView("B:"); - mDAO = getChildView("O:"); - mDAG = getChildView("G:"); - mDAE = getChildView("E:"); - mDAN = getChildView("N:"); - mDAF = getChildView("F:"); + mDAB = getChild("B:"); + mDAO = getChild("O:"); + mDAG = getChild("G:"); + mDAE = getChild("E:"); + mDAN = getChild("N:"); + mDAF = getChild("F:"); return TRUE; } @@ -207,12 +208,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); @@ -640,31 +651,30 @@ void LLSidepanelTaskInfo::refresh() if (gSavedSettings.getBOOL("DebugPermissions") ) { // remove misleading X for export when not in OpenSim - bool isOpenSim {false}; + bool isOpenSim {false}; #ifdef OPENSIM - if( LLGridManager::instance().isInOpenSim() ) - { - isOpenSim = true; - } + if( LLGridManager::instance().isInOpenSim() ) + { + isOpenSim = true; + } #endif -// - if (valid_base_perms) - { - getChild("B:")->setValue("B: " + mask_to_string(base_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim - getChildView("B:")->setVisible( TRUE); - - getChild("O:")->setValue("O: " + mask_to_string(owner_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim - getChildView("O:")->setVisible( TRUE); - - getChild("G:")->setValue("G: " + mask_to_string(group_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim - getChildView("G:")->setVisible( TRUE); - - getChild("E:")->setValue("E: " + mask_to_string(everyone_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim - getChildView("E:")->setVisible( TRUE); - - getChild("N:")->setValue("N: " + mask_to_string(next_owner_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim - getChildView("N:")->setVisible( TRUE); - } + if (valid_base_perms) + { + mDAB->setValue("B: " + mask_to_string(base_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim + mDAB->setVisible( TRUE); + + mDAO->setValue("O: " + mask_to_string(owner_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim + mDAO->setVisible( TRUE); + + mDAG->setValue("G: " + mask_to_string(group_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim + mDAG->setVisible( TRUE); + + mDAE->setValue("E: " + mask_to_string(everyone_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim + mDAE->setVisible( TRUE); + + mDAN->setValue("N: " + mask_to_string(next_owner_mask_on, isOpenSim)); // remove misleading X for export when not in OpenSim + mDAN->setVisible( TRUE); + } U32 flag_mask = 0x0; if (objectp->permMove()) flag_mask |= PERM_MOVE; @@ -672,18 +682,35 @@ void LLSidepanelTaskInfo::refresh() if (objectp->permCopy()) flag_mask |= PERM_COPY; if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; - getChild("F:")->setValue("F:" + mask_to_string(flag_mask, isOpenSim)); // remove misleading X for export when not in OpenSim - 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, isOpenSim)); // remove misleading X for export when not in OpenSim + 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; diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index fbecf6f79f..852d36293b 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -125,6 +125,10 @@ protected: private: LLPointer mObject; LLObjectSelectionHandle mObjectSelection; + + // mVisibleDebugPermissions doesn't nessesarily matche state + // of viewes and is primarily for floater resize + bool mVisibleDebugPermissions; static LLSidepanelTaskInfo* sActivePanel; private: @@ -152,12 +156,12 @@ private: LLView* mDALabelClickAction; LLComboBox* mDAComboClickAction; LLTextBase* mDAPathfindingAttributes; - LLView* mDAB; - LLView* mDAO; - LLView* mDAG; - LLView* mDAE; - LLView* mDAN; - LLView* mDAF; + LLUICtrl* mDAB; + LLUICtrl* mDAO; + LLUICtrl* mDAG; + LLUICtrl* mDAE; + LLUICtrl* mDAN; + LLUICtrl* mDAF; }; diff --git a/indra/newview/skins/default/xui/en/floater_task_properties.xml b/indra/newview/skins/default/xui/en/floater_task_properties.xml index 9d7885c30a..ce72d42107 100644 --- a/indra/newview/skins/default/xui/en/floater_task_properties.xml +++ b/indra/newview/skins/default/xui/en/floater_task_properties.xml @@ -1,7 +1,7 @@