aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterproperties.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llfloaterproperties.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llfloaterproperties.cpp')
-rw-r--r--linden/indra/newview/llfloaterproperties.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/linden/indra/newview/llfloaterproperties.cpp b/linden/indra/newview/llfloaterproperties.cpp
index 3519520..0d2cd5f 100644
--- a/linden/indra/newview/llfloaterproperties.cpp
+++ b/linden/indra/newview/llfloaterproperties.cpp
@@ -56,7 +56,7 @@
56#include "llviewerregion.h" 56#include "llviewerregion.h"
57#include "llviewercontrol.h" 57#include "llviewercontrol.h"
58 58
59#include "llvieweruictrlfactory.h" 59#include "lluictrlfactory.h"
60 60
61 61
62//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -65,7 +65,7 @@
65// helper class to watch the inventory. 65// helper class to watch the inventory.
66//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67 67
68class LLPropertiesObserver : public LLInventoryObserver 68class LLPropertiesObserver : public LLInventoryObserver, public LLSingleton<LLPropertiesObserver>
69{ 69{
70public: 70public:
71 LLPropertiesObserver() {} 71 LLPropertiesObserver() {}
@@ -73,7 +73,6 @@ public:
73 virtual void changed(U32 mask); 73 virtual void changed(U32 mask);
74}; 74};
75 75
76LLPropertiesObserver* gPropertiesObserver = NULL;
77void LLPropertiesObserver::changed(U32 mask) 76void LLPropertiesObserver::changed(U32 mask)
78{ 77{
79 // if there's a change we're interested in. 78 // if there's a change we're interested in.
@@ -144,13 +143,13 @@ LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect&
144 mObjectID(object_id), 143 mObjectID(object_id),
145 mDirty(TRUE) 144 mDirty(TRUE)
146{ 145{
147 gUICtrlFactory->buildFloater(this,"floater_inventory_item_properties.xml"); 146 LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml");
148 147
149 // hack to make sure these floaters are observing the inventory. 148 // hack to make sure these floaters are observing the inventory.
150 if(!gPropertiesObserver) 149 if(!gInventory.containsObserver(LLPropertiesObserver::getInstance()))
151 { 150 {
152 gPropertiesObserver = new LLPropertiesObserver; 151 // Note: this is where gPropertiesObserver used to be constructed.
153 gInventory.addObserver(gPropertiesObserver); 152 gInventory.addObserver(LLPropertiesObserver::getInstance());
154 } 153 }
155 // add the object to the static structure 154 // add the object to the static structure
156 LLUUID key = mItemID ^ mObjectID; 155 LLUUID key = mItemID ^ mObjectID;
@@ -473,7 +472,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
473 { 472 {
474 childSetValue("CheckShareWithGroup",LLSD((BOOL)TRUE)); 473 childSetValue("CheckShareWithGroup",LLSD((BOOL)TRUE));
475 474
476 LLCheckBoxCtrl* ctl = LLUICtrlFactory::getCheckBoxByName(this,"CheckShareWithGroup"); 475 LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
477 if(ctl) 476 if(ctl)
478 { 477 {
479 ctl->setTentative(FALSE); 478 ctl->setTentative(FALSE);
@@ -482,7 +481,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
482 else if (!is_group_copy && !is_group_modify && !is_group_move) 481 else if (!is_group_copy && !is_group_modify && !is_group_move)
483 { 482 {
484 childSetValue("CheckShareWithGroup",LLSD((BOOL)FALSE)); 483 childSetValue("CheckShareWithGroup",LLSD((BOOL)FALSE));
485 LLCheckBoxCtrl* ctl = LLUICtrlFactory::getCheckBoxByName(this,"CheckShareWithGroup"); 484 LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
486 if(ctl) 485 if(ctl)
487 { 486 {
488 ctl->setTentative(FALSE); 487 ctl->setTentative(FALSE);
@@ -490,7 +489,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
490 } 489 }
491 else 490 else
492 { 491 {
493 LLCheckBoxCtrl* ctl = LLUICtrlFactory::getCheckBoxByName(this,"CheckShareWithGroup"); 492 LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
494 if(ctl) 493 if(ctl)
495 { 494 {
496 ctl->setTentative(TRUE); 495 ctl->setTentative(TRUE);
@@ -543,7 +542,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
543 childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY))); 542 childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY)));
544 childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); 543 childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER)));
545 544
546 LLRadioGroup* radioSaleType = LLUICtrlFactory::getRadioGroupByName(this,"RadioSaleType"); 545 LLRadioGroup* radioSaleType = getChild<LLRadioGroup>("RadioSaleType");
547 if (is_for_sale) 546 if (is_for_sale)
548 { 547 {
549 radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1); 548 radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1);
@@ -605,7 +604,7 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data)
605 { 604 {
606 return; 605 return;
607 } 606 }
608 LLLineEditor* labelItemName = LLUICtrlFactory::getLineEditorByName(self,"LabelItemName"); 607 LLLineEditor* labelItemName = self->getChild<LLLineEditor>("LabelItemName");
609 608
610 if(labelItemName&& 609 if(labelItemName&&
611 (item->getName() != labelItemName->getText()) && 610 (item->getName() != labelItemName->getText()) &&
@@ -642,7 +641,7 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data)
642 LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem(); 641 LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem();
643 if(!item) return; 642 if(!item) return;
644 643
645 LLLineEditor* labelItemDesc = LLUICtrlFactory::getLineEditorByName(self,"LabelItemDesc"); 644 LLLineEditor* labelItemDesc = self->getChild<LLLineEditor>("LabelItemDesc");
646 if(!labelItemDesc) 645 if(!labelItemDesc)
647 { 646 {
648 return; 647 return;
@@ -684,7 +683,7 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
684 LLPermissions perm(item->getPermissions()); 683 LLPermissions perm(item->getPermissions());
685 684
686 685
687 LLCheckBoxCtrl* CheckShareWithGroup = LLUICtrlFactory::getCheckBoxByName(self,"CheckShareWithGroup"); 686 LLCheckBoxCtrl* CheckShareWithGroup = self->getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
688 687
689 if(CheckShareWithGroup) 688 if(CheckShareWithGroup)
690 { 689 {
@@ -692,26 +691,26 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data)
692 CheckShareWithGroup->get(), 691 CheckShareWithGroup->get(),
693 PERM_MODIFY | PERM_MOVE | PERM_COPY); 692 PERM_MODIFY | PERM_MOVE | PERM_COPY);
694 } 693 }
695 LLCheckBoxCtrl* CheckEveryoneCopy = LLUICtrlFactory::getCheckBoxByName(self,"CheckEveryoneCopy"); 694 LLCheckBoxCtrl* CheckEveryoneCopy = self->getChild<LLCheckBoxCtrl>("CheckEveryoneCopy");
696 if(CheckEveryoneCopy) 695 if(CheckEveryoneCopy)
697 { 696 {
698 perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(), 697 perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(),
699 CheckEveryoneCopy->get(), PERM_COPY); 698 CheckEveryoneCopy->get(), PERM_COPY);
700 } 699 }
701 700
702 LLCheckBoxCtrl* CheckNextOwnerModify = LLUICtrlFactory::getCheckBoxByName(self,"CheckNextOwnerModify"); 701 LLCheckBoxCtrl* CheckNextOwnerModify = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerModify");
703 if(CheckNextOwnerModify) 702 if(CheckNextOwnerModify)
704 { 703 {
705 perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), 704 perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
706 CheckNextOwnerModify->get(), PERM_MODIFY); 705 CheckNextOwnerModify->get(), PERM_MODIFY);
707 } 706 }
708 LLCheckBoxCtrl* CheckNextOwnerCopy = LLUICtrlFactory::getCheckBoxByName(self,"CheckNextOwnerCopy"); 707 LLCheckBoxCtrl* CheckNextOwnerCopy = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy");
709 if(CheckNextOwnerCopy) 708 if(CheckNextOwnerCopy)
710 { 709 {
711 perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), 710 perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
712 CheckNextOwnerCopy->get(), PERM_COPY); 711 CheckNextOwnerCopy->get(), PERM_COPY);
713 } 712 }
714 LLCheckBoxCtrl* CheckNextOwnerTransfer = LLUICtrlFactory::getCheckBoxByName(self,"CheckNextOwnerTransfer"); 713 LLCheckBoxCtrl* CheckNextOwnerTransfer = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer");
715 if(CheckNextOwnerTransfer) 714 if(CheckNextOwnerTransfer)
716 { 715 {
717 perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), 716 perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(),
@@ -805,7 +804,7 @@ void LLFloaterProperties::updateSaleInfo()
805 // turn on sale info 804 // turn on sale info
806 LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; 805 LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY;
807 806
808 LLRadioGroup* RadioSaleType = LLUICtrlFactory::getRadioGroupByName(this,"RadioSaleType"); 807 LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("RadioSaleType");
809 if(RadioSaleType) 808 if(RadioSaleType)
810 { 809 {
811 switch (RadioSaleType->getSelectedIndex()) 810 switch (RadioSaleType->getSelectedIndex())
@@ -832,7 +831,7 @@ void LLFloaterProperties::updateSaleInfo()
832 sale_type = LLSaleInfo::FS_ORIGINAL; 831 sale_type = LLSaleInfo::FS_ORIGINAL;
833 } 832 }
834 833
835 LLLineEditor* EditPrice = LLUICtrlFactory::getLineEditorByName(this,"EditPrice"); 834 LLLineEditor* EditPrice = getChild<LLLineEditor>("EditPrice");
836 835
837 S32 price = -1; 836 S32 price = -1;
838 if(EditPrice) 837 if(EditPrice)