summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterland.cpp
diff options
context:
space:
mode:
authorAndrew Dyukov <adyukov@productengine.com>2010-03-06 00:17:16 +0200
committerAndrew Dyukov <adyukov@productengine.com>2010-03-06 00:17:16 +0200
commit8ae52e2b90e9767787c14f0ac8a0bc6cc5f1df73 (patch)
tree0dc75ad729bbcad86f87a49330c11ee84336e382 /indra/newview/llfloaterland.cpp
parent870dcca7871a1903d688c3f6a8f2b30d7cf62b7e (diff)
Partially implemented nice-to have sub-task EXT-4706 (Add maturity icons to About Land).
- Added maturity icons to General and Covenant tabs. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llfloaterland.cpp')
-rw-r--r--indra/newview/llfloaterland.cpp43
1 files changed, 41 insertions, 2 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 26c6db9652..fa7d7e3a38 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -102,6 +102,10 @@ public:
virtual void changed() { LLFloaterLand::refreshAll(); }
};
+// fills target textbox with maturity info(icon and text)
+// names_floater - pointer to floater which contains strings with maturity icons filenames
+void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater);
+
//---------------------------------------------------------------------------
// LLFloaterLand
//---------------------------------------------------------------------------
@@ -554,7 +558,7 @@ void LLPanelLandGeneral::refresh()
if (regionp)
{
- mContentRating->setText(regionp->getSimAccessString());
+ FillMaturityTextBox(mContentRating, gFloaterView->getParentFloater(this));
mLandType->setText(regionp->getSimProductName());
}
@@ -2858,7 +2862,7 @@ void LLPanelLandCovenant::refresh()
LLTextBox* region_maturity = getChild<LLTextBox>("region_maturity_text");
if (region_maturity)
{
- region_maturity->setText(region->getSimAccessString());
+ FillMaturityTextBox(region_maturity, gFloaterView->getParentFloater(this));
}
LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause");
@@ -2939,3 +2943,38 @@ void LLPanelLandCovenant::updateEstateOwnerName(const std::string& name)
if (editor) editor->setText(name);
}
}
+
+// fills target textbox with maturity info(icon and text)
+// names_floater - pointer to floater which contains strings with maturity icons filenames
+void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater)
+{
+ LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
+ if (!region)
+ return;
+
+ LLStyle::Params style;
+
+ U8 sim_access = region->getSimAccess();
+
+ switch(sim_access)
+ {
+ case SIM_ACCESS_PG:
+ style.image(LLUI::getUIImage(names_floater->getString("maturity_icon_general")));
+ break;
+
+ case SIM_ACCESS_ADULT:
+ style.image(LLUI::getUIImage(names_floater->getString("maturity_icon_adult")));
+ break;
+
+ case SIM_ACCESS_MATURE:
+ style.image(LLUI::getUIImage(names_floater->getString("maturity_icon_moderate")));
+ break;
+
+ default:
+ break;
+ }
+
+ // any text may be here instead of "icon" except ""
+ target_textbox->setText(std::string("icon"),style);
+ target_textbox->appendText(LLViewerParcelMgr::getInstance()->getSelectionRegion()->getSimAccessString(), false);
+} \ No newline at end of file