From 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:50 -0500 Subject: Second Life viewer sources 1.14.0.0 --- linden/indra/newview/llpanelpermissions.cpp | 57 ++++++++++++++++------------- 1 file changed, 31 insertions(+), 26 deletions(-) (limited to 'linden/indra/newview/llpanelpermissions.cpp') diff --git a/linden/indra/newview/llpanelpermissions.cpp b/linden/indra/newview/llpanelpermissions.cpp index 84509a9..8512342 100644 --- a/linden/indra/newview/llpanelpermissions.cpp +++ b/linden/indra/newview/llpanelpermissions.cpp @@ -147,16 +147,16 @@ void LLPanelPermissions::refresh() BtnDeedToGroup->setLabelUnselected(deedText); } BOOL root_selected = TRUE; - LLSelectNode* nodep = gSelectMgr->getFirstRootNode(); - S32 object_count = gSelectMgr->getRootObjectCount(); + LLSelectNode* nodep = gSelectMgr->getSelection()->getFirstRootNode(); + S32 object_count = gSelectMgr->getSelection()->getRootObjectCount(); if(!nodep || 0 == object_count) { - nodep = gSelectMgr->getFirstNode(); - object_count = gSelectMgr->getObjectCount(); + nodep = gSelectMgr->getSelection()->getFirstNode(); + object_count = gSelectMgr->getSelection()->getObjectCount(); root_selected = FALSE; } - //BOOL attachment_selected = gSelectMgr->selectionIsAttachment(); + //BOOL attachment_selected = gSelectMgr->getSelection()->isAttachment(); //attachment_selected = false; LLViewerObject* objectp = NULL; if(nodep) objectp = nodep->getObject(); @@ -249,7 +249,7 @@ void LLPanelPermissions::refresh() BOOL is_one_object = (object_count == 1); // BUG: fails if a root and non-root are both single-selected. - BOOL is_perm_modify = (gSelectMgr->getFirstRootNode() + BOOL is_perm_modify = (gSelectMgr->getSelection()->getFirstRootNode() && gSelectMgr->selectGetRootsModify()) || gSelectMgr->selectGetModify(); const LLView* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); @@ -373,8 +373,8 @@ void LLPanelPermissions::refresh() // Pre-compute object info string - S32 prim_count = gSelectMgr->getObjectCount(); - S32 obj_count = gSelectMgr->getRootObjectCount(); + S32 prim_count = gSelectMgr->getSelection()->getObjectCount(); + S32 obj_count = gSelectMgr->getSelection()->getRootObjectCount(); LLString object_info_string; if (1 == obj_count) @@ -383,8 +383,8 @@ void LLPanelPermissions::refresh() } else { - char buffer[MAX_STRING]; - sprintf(buffer, "%d Objects, ", obj_count); + char buffer[MAX_STRING]; /*Flawfinder: ignore*/ + snprintf(buffer, MAX_STRING, "%d Objects, ", obj_count); /*Flawfinder: ignore*/ object_info_string.assign(buffer); } if (1 == prim_count) @@ -393,8 +393,8 @@ void LLPanelPermissions::refresh() } else { - char buffer[MAX_STRING]; - sprintf(buffer, "%d Primitives", prim_count); + char buffer[MAX_STRING]; /*Flawfinder: ignore*/ + snprintf(buffer, MAX_STRING, "%d Primitives", prim_count); /*Flawfinder: ignore*/ object_info_string.append(buffer); } childSetText("prim info",object_info_string); @@ -496,36 +496,36 @@ void LLPanelPermissions::refresh() if( gSavedSettings.getBOOL("DebugPermissions") ) { - char perm_string[10]; + char perm_string[10]; /*Flawfinder: ignore*/ if (valid_base_perms) { - strcpy(perm_string, "B: "); + strcpy(perm_string, "B: "); /*Flawfinder: ignore*/ mask_to_string(base_mask_on, perm_string+3); childSetText("B:",perm_string); childSetVisible("B:",true); - strcpy(perm_string, "O: "); + strcpy(perm_string, "O: "); /*Flawfinder: ignore*/ mask_to_string(owner_mask_on, perm_string+3); childSetText("O:",perm_string); childSetVisible("O:",true); - strcpy(perm_string, "G: "); + strcpy(perm_string, "G: "); /*Flawfinder: ignore*/ mask_to_string(group_mask_on, perm_string+3); childSetText("G:",perm_string); childSetVisible("G:",true); - strcpy(perm_string, "E: "); + strcpy(perm_string, "E: "); /*Flawfinder: ignore*/ mask_to_string(everyone_mask_on, perm_string+3); childSetText("E:",perm_string); childSetVisible("E:",true); - strcpy(perm_string, "N: "); + strcpy(perm_string, "N: "); /*Flawfinder: ignore*/ mask_to_string(next_owner_mask_on, perm_string+3); childSetText("N:",perm_string); childSetVisible("N:",true); } - strcpy(perm_string, "F: "); + strcpy(perm_string, "F: "); /*Flawfinder: ignore*/ U32 flag_mask = 0x0; if (objectp->permMove()) flag_mask |= PERM_MOVE; @@ -729,6 +729,11 @@ void LLPanelPermissions::refresh() { RadioSaleType->setSelectedIndex((S32)sale_type - 1); } + else + { + // default option is sell copy, determined to be safest + RadioSaleType->setSelectedIndex((S32)LLSaleInfo::FS_COPY - 1); + } if (is_for_sale) { @@ -847,7 +852,7 @@ void LLPanelPermissions::onClickDeedToGroup(void* data) // static void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm) { - LLViewerObject* object = gSelectMgr->getFirstRootObject(); + LLViewerObject* object = gSelectMgr->getSelection()->getFirstRootObject(); if(!object) return; // Checkbox will have toggled itself @@ -855,7 +860,7 @@ void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl; BOOL new_state = check->get(); - gSelectMgr->setObjectPermissions(field, new_state, perm); + gSelectMgr->selectionSetObjectPermissions(field, new_state, perm); } // static @@ -906,8 +911,8 @@ void LLPanelPermissions::onCommitName(LLUICtrl*, void* data) LLLineEditor* tb = gUICtrlFactory->getLineEditorByName(self,"Object Name"); if(tb) { - gSelectMgr->setObjectName(tb->getText()); -// gSelectMgr->setObjectName(self->mLabelObjectName->getText()); + gSelectMgr->selectionSetObjectName(tb->getText()); +// gSelectMgr->selectionSetObjectName(self->mLabelObjectName->getText()); } } @@ -920,7 +925,7 @@ void LLPanelPermissions::onCommitDesc(LLUICtrl*, void* data) LLLineEditor* le = gUICtrlFactory->getLineEditorByName(self,"Object Description"); if(le) { - gSelectMgr->setObjectDescription(le->getText()); + gSelectMgr->selectionSetObjectDescription(le->getText()); } } @@ -982,7 +987,7 @@ void LLPanelPermissions::setAllSaleInfo() } LLSaleInfo sale_info(sale_type, price); - gSelectMgr->setObjectSaleInfo(sale_info); + gSelectMgr->selectionSetObjectSaleInfo(sale_info); // If turned off for-sale, make sure click-action buy is turned // off as well @@ -1036,7 +1041,7 @@ void LLPanelPermissions::onCommitClickAction(LLUICtrl* ctrl, void*) { // Verify object has script with money() handler LLSelectionPayable payable; - bool can_pay = gSelectMgr->applyToObjects(&payable); + bool can_pay = gSelectMgr->getSelection()->applyToObjects(&payable); if (!can_pay) { // Warn, but do it anyway. -- cgit v1.1