summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelclassified.cpp
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2009-05-04 17:43:26 +0000
committerAdam Moss <moss@lindenlab.com>2009-05-04 17:43:26 +0000
commitcc92525b0df952659102d2e5adcc4140fea7f371 (patch)
treeee1a9b63decb3667fb740a8c9b70bcfdbf9a054b /indra/newview/llpanelclassified.cpp
parent4bcbf3342284b19ff5fbda5a16a43a8cafb3baad (diff)
QAR-1476 Combo-merge to trunk: Viewer 1.23 RC0 and Simulator 1.26.3
svn merge -r118927:118939 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.0-merge-2-combo-QAR-1476 this is a composite of... svn merge -r115088:118182 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer_1-23 conflicts resolved: C doc/contributions.txt C indra/llaudio/audioengine.cpp C indra/newview/CMakeLists.txt C indra/newview/llfloaterlandholdings.cpp C indra/newview/llpaneldirbrowser.cpp C indra/newview/llpanelgrouplandmoney.cpp C indra/newview/llpreviewscript.cpp C indra/newview/llviewermenu.cpp C indra/newview/skins/default/xui/en-us/notifications.xml and... svn merge -r116937:118673 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.26 minor-to-trivial conflicts resolved: C indra/llcommon/llversionserver.h C indra/newsim/llrezdata.cpp C indra/newsim/llstate.cpp C indra/upgrade/schema_version/sequence/3/index_log_paypal.sql
Diffstat (limited to 'indra/newview/llpanelclassified.cpp')
-rw-r--r--indra/newview/llpanelclassified.cpp73
1 files changed, 66 insertions, 7 deletions
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index e6639a2da5..afaaea28f0 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -72,8 +72,9 @@
#include "llappviewer.h" // abortQuit()
const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$
+const S32 MATURE_UNDEFINED = -1;
const S32 MATURE_CONTENT = 1;
-const S32 NON_MATURE_CONTENT = 2;
+const S32 PG_CONTENT = 2;
const S32 DECLINE_TO_STATE = 0;
//static
@@ -290,7 +291,7 @@ BOOL LLPanelClassified::postBuild()
{
// Teens don't get to set mature flag. JC
mMatureCombo->setVisible(FALSE);
- mMatureCombo->setCurrentByIndex(NON_MATURE_CONTENT);
+ mMatureCombo->setCurrentByIndex(PG_CONTENT);
}
if (!mInFinder)
@@ -408,6 +409,9 @@ void LLPanelClassified::initNewClassified()
}
mUpdateBtn->setLabel(getString("publish_txt"));
+
+ // simulate clicking the "location" button
+ LLPanelClassified::onClickSet(this);
}
@@ -663,7 +667,7 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **
}
else
{
- self->mMatureCombo->setCurrentByIndex(NON_MATURE_CONTENT);
+ self->mMatureCombo->setCurrentByIndex(PG_CONTENT);
}
if (self->mAutoRenewCheck)
{
@@ -751,8 +755,22 @@ void LLPanelClassified::refresh()
//mPriceEditor->setEnabled(is_self);
mCategoryCombo->setEnabled(is_self);
- mMatureCombo->setEnabled(is_self);
-
+ if( is_self )
+ {
+ if( mMatureCombo->getCurrentIndex() == 0 )
+ {
+ // It's a new panel.
+ // PG regions must have PG classifieds. AO must have mature.
+ // Only Mature can be PG or Mature.
+
+ constrainAccessCombo();
+ }
+ }
+ else
+ {
+ mMatureCombo->setEnabled( FALSE );
+ }
+
if (mAutoRenewCheck)
{
mAutoRenewCheck->setEnabled(is_self);
@@ -813,7 +831,7 @@ bool LLPanelClassified::confirmMature(const LLSD& notification, const LLSD& resp
mMatureCombo->setCurrentByIndex(MATURE_CONTENT);
break;
case 1:
- mMatureCombo->setCurrentByIndex(NON_MATURE_CONTENT);
+ mMatureCombo->setCurrentByIndex(PG_CONTENT);
break;
default:
return false;
@@ -970,7 +988,13 @@ void LLPanelClassified::onClickSet(void* data)
self->mPosGlobal = gAgent.getPositionGlobal();
std::string location_text;
- location_text.assign("(will update after publish)");
+ std::string regionName = "(will update after publish)";
+ LLViewerRegion* pRegion = gAgent.getRegion();
+ if (pRegion)
+ {
+ regionName = pRegion->getName();
+ }
+ location_text.assign(regionName);
location_text.append(", ");
S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS;
@@ -982,6 +1006,8 @@ void LLPanelClassified::onClickSet(void* data)
self->mLocationEditor->setText(location_text);
self->mLocationChanged = true;
+
+ self->constrainAccessCombo();
// Set this to null so it updates on the next save.
self->mParcelID.setNull();
@@ -1110,3 +1136,36 @@ void LLFloaterPriceForListing::buttonCore(S32 button, void* data)
self->close();
}
}
+
+void LLPanelClassified::constrainAccessCombo()
+{
+ // Location changed.
+ // PG regions must have PG classifieds. AO must have mature.
+ // Only Mature can be PG or Mature.
+
+ bool pref_visible = TRUE;
+
+ S32 force_access = MATURE_UNDEFINED;
+ LLViewerRegion *regionp = gAgent.getRegion();
+
+ switch( regionp->getSimAccess() )
+ {
+ case SIM_ACCESS_PG:
+ force_access = PG_CONTENT;
+ break;
+ case SIM_ACCESS_ADULT:
+ force_access = MATURE_CONTENT;
+ break;
+ default:
+ // You are free to move about the cabin.
+ break;
+ }
+
+ if ( force_access != MATURE_UNDEFINED )
+ {
+ pref_visible = FALSE;
+ mMatureCombo->setCurrentByIndex(force_access);
+ }
+
+ mMatureCombo->setEnabled(pref_visible);
+}