aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelpermissions.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llpanelpermissions.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/newview/llpanelpermissions.cpp')
-rw-r--r--linden/indra/newview/llpanelpermissions.cpp57
1 files changed, 31 insertions, 26 deletions
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()
147 BtnDeedToGroup->setLabelUnselected(deedText); 147 BtnDeedToGroup->setLabelUnselected(deedText);
148 } 148 }
149 BOOL root_selected = TRUE; 149 BOOL root_selected = TRUE;
150 LLSelectNode* nodep = gSelectMgr->getFirstRootNode(); 150 LLSelectNode* nodep = gSelectMgr->getSelection()->getFirstRootNode();
151 S32 object_count = gSelectMgr->getRootObjectCount(); 151 S32 object_count = gSelectMgr->getSelection()->getRootObjectCount();
152 if(!nodep || 0 == object_count) 152 if(!nodep || 0 == object_count)
153 { 153 {
154 nodep = gSelectMgr->getFirstNode(); 154 nodep = gSelectMgr->getSelection()->getFirstNode();
155 object_count = gSelectMgr->getObjectCount(); 155 object_count = gSelectMgr->getSelection()->getObjectCount();
156 root_selected = FALSE; 156 root_selected = FALSE;
157 } 157 }
158 158
159 //BOOL attachment_selected = gSelectMgr->selectionIsAttachment(); 159 //BOOL attachment_selected = gSelectMgr->getSelection()->isAttachment();
160 //attachment_selected = false; 160 //attachment_selected = false;
161 LLViewerObject* objectp = NULL; 161 LLViewerObject* objectp = NULL;
162 if(nodep) objectp = nodep->getObject(); 162 if(nodep) objectp = nodep->getObject();
@@ -249,7 +249,7 @@ void LLPanelPermissions::refresh()
249 BOOL is_one_object = (object_count == 1); 249 BOOL is_one_object = (object_count == 1);
250 250
251 // BUG: fails if a root and non-root are both single-selected. 251 // BUG: fails if a root and non-root are both single-selected.
252 BOOL is_perm_modify = (gSelectMgr->getFirstRootNode() 252 BOOL is_perm_modify = (gSelectMgr->getSelection()->getFirstRootNode()
253 && gSelectMgr->selectGetRootsModify()) 253 && gSelectMgr->selectGetRootsModify())
254 || gSelectMgr->selectGetModify(); 254 || gSelectMgr->selectGetModify();
255 const LLView* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); 255 const LLView* keyboard_focus_view = gFocusMgr.getKeyboardFocus();
@@ -373,8 +373,8 @@ void LLPanelPermissions::refresh()
373 373
374 374
375 // Pre-compute object info string 375 // Pre-compute object info string
376 S32 prim_count = gSelectMgr->getObjectCount(); 376 S32 prim_count = gSelectMgr->getSelection()->getObjectCount();
377 S32 obj_count = gSelectMgr->getRootObjectCount(); 377 S32 obj_count = gSelectMgr->getSelection()->getRootObjectCount();
378 378
379 LLString object_info_string; 379 LLString object_info_string;
380 if (1 == obj_count) 380 if (1 == obj_count)
@@ -383,8 +383,8 @@ void LLPanelPermissions::refresh()
383 } 383 }
384 else 384 else
385 { 385 {
386 char buffer[MAX_STRING]; 386 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
387 sprintf(buffer, "%d Objects, ", obj_count); 387 snprintf(buffer, MAX_STRING, "%d Objects, ", obj_count); /*Flawfinder: ignore*/
388 object_info_string.assign(buffer); 388 object_info_string.assign(buffer);
389 } 389 }
390 if (1 == prim_count) 390 if (1 == prim_count)
@@ -393,8 +393,8 @@ void LLPanelPermissions::refresh()
393 } 393 }
394 else 394 else
395 { 395 {
396 char buffer[MAX_STRING]; 396 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
397 sprintf(buffer, "%d Primitives", prim_count); 397 snprintf(buffer, MAX_STRING, "%d Primitives", prim_count); /*Flawfinder: ignore*/
398 object_info_string.append(buffer); 398 object_info_string.append(buffer);
399 } 399 }
400 childSetText("prim info",object_info_string); 400 childSetText("prim info",object_info_string);
@@ -496,36 +496,36 @@ void LLPanelPermissions::refresh()
496 496
497 if( gSavedSettings.getBOOL("DebugPermissions") ) 497 if( gSavedSettings.getBOOL("DebugPermissions") )
498 { 498 {
499 char perm_string[10]; 499 char perm_string[10]; /*Flawfinder: ignore*/
500 if (valid_base_perms) 500 if (valid_base_perms)
501 { 501 {
502 502
503 strcpy(perm_string, "B: "); 503 strcpy(perm_string, "B: "); /*Flawfinder: ignore*/
504 mask_to_string(base_mask_on, perm_string+3); 504 mask_to_string(base_mask_on, perm_string+3);
505 childSetText("B:",perm_string); 505 childSetText("B:",perm_string);
506 childSetVisible("B:",true); 506 childSetVisible("B:",true);
507 507
508 strcpy(perm_string, "O: "); 508 strcpy(perm_string, "O: "); /*Flawfinder: ignore*/
509 mask_to_string(owner_mask_on, perm_string+3); 509 mask_to_string(owner_mask_on, perm_string+3);
510 childSetText("O:",perm_string); 510 childSetText("O:",perm_string);
511 childSetVisible("O:",true); 511 childSetVisible("O:",true);
512 512
513 strcpy(perm_string, "G: "); 513 strcpy(perm_string, "G: "); /*Flawfinder: ignore*/
514 mask_to_string(group_mask_on, perm_string+3); 514 mask_to_string(group_mask_on, perm_string+3);
515 childSetText("G:",perm_string); 515 childSetText("G:",perm_string);
516 childSetVisible("G:",true); 516 childSetVisible("G:",true);
517 517
518 strcpy(perm_string, "E: "); 518 strcpy(perm_string, "E: "); /*Flawfinder: ignore*/
519 mask_to_string(everyone_mask_on, perm_string+3); 519 mask_to_string(everyone_mask_on, perm_string+3);
520 childSetText("E:",perm_string); 520 childSetText("E:",perm_string);
521 childSetVisible("E:",true); 521 childSetVisible("E:",true);
522 522
523 strcpy(perm_string, "N: "); 523 strcpy(perm_string, "N: "); /*Flawfinder: ignore*/
524 mask_to_string(next_owner_mask_on, perm_string+3); 524 mask_to_string(next_owner_mask_on, perm_string+3);
525 childSetText("N:",perm_string); 525 childSetText("N:",perm_string);
526 childSetVisible("N:",true); 526 childSetVisible("N:",true);
527 } 527 }
528 strcpy(perm_string, "F: "); 528 strcpy(perm_string, "F: "); /*Flawfinder: ignore*/
529 U32 flag_mask = 0x0; 529 U32 flag_mask = 0x0;
530 if (objectp->permMove()) 530 if (objectp->permMove())
531 flag_mask |= PERM_MOVE; 531 flag_mask |= PERM_MOVE;
@@ -729,6 +729,11 @@ void LLPanelPermissions::refresh()
729 { 729 {
730 RadioSaleType->setSelectedIndex((S32)sale_type - 1); 730 RadioSaleType->setSelectedIndex((S32)sale_type - 1);
731 } 731 }
732 else
733 {
734 // default option is sell copy, determined to be safest
735 RadioSaleType->setSelectedIndex((S32)LLSaleInfo::FS_COPY - 1);
736 }
732 737
733 if (is_for_sale) 738 if (is_for_sale)
734 { 739 {
@@ -847,7 +852,7 @@ void LLPanelPermissions::onClickDeedToGroup(void* data)
847// static 852// static
848void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm) 853void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm)
849{ 854{
850 LLViewerObject* object = gSelectMgr->getFirstRootObject(); 855 LLViewerObject* object = gSelectMgr->getSelection()->getFirstRootObject();
851 if(!object) return; 856 if(!object) return;
852 857
853 // Checkbox will have toggled itself 858 // Checkbox will have toggled itself
@@ -855,7 +860,7 @@ void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32
855 LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl; 860 LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl;
856 BOOL new_state = check->get(); 861 BOOL new_state = check->get();
857 862
858 gSelectMgr->setObjectPermissions(field, new_state, perm); 863 gSelectMgr->selectionSetObjectPermissions(field, new_state, perm);
859} 864}
860 865
861// static 866// static
@@ -906,8 +911,8 @@ void LLPanelPermissions::onCommitName(LLUICtrl*, void* data)
906 LLLineEditor* tb = gUICtrlFactory->getLineEditorByName(self,"Object Name"); 911 LLLineEditor* tb = gUICtrlFactory->getLineEditorByName(self,"Object Name");
907 if(tb) 912 if(tb)
908 { 913 {
909 gSelectMgr->setObjectName(tb->getText()); 914 gSelectMgr->selectionSetObjectName(tb->getText());
910// gSelectMgr->setObjectName(self->mLabelObjectName->getText()); 915// gSelectMgr->selectionSetObjectName(self->mLabelObjectName->getText());
911 } 916 }
912} 917}
913 918
@@ -920,7 +925,7 @@ void LLPanelPermissions::onCommitDesc(LLUICtrl*, void* data)
920 LLLineEditor* le = gUICtrlFactory->getLineEditorByName(self,"Object Description"); 925 LLLineEditor* le = gUICtrlFactory->getLineEditorByName(self,"Object Description");
921 if(le) 926 if(le)
922 { 927 {
923 gSelectMgr->setObjectDescription(le->getText()); 928 gSelectMgr->selectionSetObjectDescription(le->getText());
924 } 929 }
925} 930}
926 931
@@ -982,7 +987,7 @@ void LLPanelPermissions::setAllSaleInfo()
982 } 987 }
983 988
984 LLSaleInfo sale_info(sale_type, price); 989 LLSaleInfo sale_info(sale_type, price);
985 gSelectMgr->setObjectSaleInfo(sale_info); 990 gSelectMgr->selectionSetObjectSaleInfo(sale_info);
986 991
987 // If turned off for-sale, make sure click-action buy is turned 992 // If turned off for-sale, make sure click-action buy is turned
988 // off as well 993 // off as well
@@ -1036,7 +1041,7 @@ void LLPanelPermissions::onCommitClickAction(LLUICtrl* ctrl, void*)
1036 { 1041 {
1037 // Verify object has script with money() handler 1042 // Verify object has script with money() handler
1038 LLSelectionPayable payable; 1043 LLSelectionPayable payable;
1039 bool can_pay = gSelectMgr->applyToObjects(&payable); 1044 bool can_pay = gSelectMgr->getSelection()->applyToObjects(&payable);
1040 if (!can_pay) 1045 if (!can_pay)
1041 { 1046 {
1042 // Warn, but do it anyway. 1047 // Warn, but do it anyway.