From c58055f30d8ccd594b216f01c56641393b330c14 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 13 Apr 2011 17:59:04 -0700 Subject: Ugly workaround for LLStyle issue when parsing textboxes for html while editing them. This might be fixed in Viewer 2? If not, sadness. Also, added html parsing for picks and classified ads while I was there --- linden/indra/newview/llpanelavatar.cpp | 27 +++++++++++++++++---------- linden/indra/newview/llpanelclassified.cpp | 10 +++++++++- linden/indra/newview/llpanelgroupgeneral.cpp | 14 +++++++++----- linden/indra/newview/llpanelpick.cpp | 10 +++++++++- 4 files changed, 44 insertions(+), 17 deletions(-) diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index 612d9a5..c261a18 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp @@ -1992,11 +1992,15 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) LLTextEditor* about_field = self->mPanelSecondLife->getChild("about"); if (about_field) { - about_field->setParseHTML(TRUE); - about_field->appendColoredText(about_text, false, false, - (self->mAllowEdit && (self->mAvatarID == agent_id)) ? - gColors.getColor("TextFgColor") : - gColors.getColor("TextFgReadOnlyColor")); + if (self->mAllowEdit && (self->mAvatarID == agent_id)) + { + about_field->setText(about_text); + } + else + { + about_field->setParseHTML(TRUE); + about_field->appendColoredText(about_text, false, false, gColors.getColor("TextFgReadOnlyColor")); + } } self->mPanelSecondLife->setPartnerID(partner_id); @@ -2007,11 +2011,14 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) about_field = self->mPanelFirstLife->getChild("about"); if (about_field) { - about_field->setParseHTML(TRUE); - about_field->appendColoredText(fl_about_text, false, false, - (self->mAllowEdit && (self->mAvatarID == agent_id)) ? - gColors.getColor("TextFgColor") : - gColors.getColor("TextFgReadOnlyColor")); + if (self->mAllowEdit && (self->mAvatarID == agent_id)) + { + } + else + { + about_field->setParseHTML(TRUE); + about_field->appendColoredText(fl_about_text, false, false, gColors.getColor("TextFgReadOnlyColor")); + } } LLTextureCtrl* image_ctrl = self->mPanelFirstLife->getChild("img"); diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp index 99b6cf6..b2504dc 100644 --- a/linden/indra/newview/llpanelclassified.cpp +++ b/linden/indra/newview/llpanelclassified.cpp @@ -660,7 +660,15 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** // Update UI controls self->mNameEditor->setText(name); - self->mDescEditor->setText(desc); + if (self->mCreatorID == gAgent.getID()) + { + self->mDescEditor->setText(desc); + } + else + { + self->mDescEditor->setParseHTML(TRUE); + self->mDescEditor->appendColoredText(desc, false, false, gColors.getColor("TextFgReadOnlyColor")); + } self->mSnapshotCtrl->setImageAssetID(snapshot_id); self->mLocationEditor->setText(location_text); self->mLocationChanged = false; diff --git a/linden/indra/newview/llpanelgroupgeneral.cpp b/linden/indra/newview/llpanelgroupgeneral.cpp index 9aa70f7..8e61c60 100644 --- a/linden/indra/newview/llpanelgroupgeneral.cpp +++ b/linden/indra/newview/llpanelgroupgeneral.cpp @@ -814,11 +814,15 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if (mEditCharter) { - mEditCharter->setParseHTML(TRUE); - mEditCharter->appendColoredText(gdatap->mCharter, false, false, - (mAllowEdit && can_change_ident) ? - gColors.getColor("TextFgColor") : - gColors.getColor("TextFgReadOnlyColor")); + if (mAllowEdit && can_change_ident) + { + mEditCharter->setText(gdatap->mCharter); + } + else + { + mEditCharter->setParseHTML(TRUE); + mEditCharter->appendColoredText(gdatap->mCharter, false, false, gColors.getColor("TextFgReadOnlyColor")); + } mEditCharter->resetDirty(); } diff --git a/linden/indra/newview/llpanelpick.cpp b/linden/indra/newview/llpanelpick.cpp index 3417b17..bf5d7f4 100644 --- a/linden/indra/newview/llpanelpick.cpp +++ b/linden/indra/newview/llpanelpick.cpp @@ -360,7 +360,15 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **) // Update UI controls self->mNameEditor->setText(std::string(name)); - self->mDescEditor->setText(std::string(desc)); + if (self->mCreatorID == gAgent.getID()) + { + self->mDescEditor->setText(std::string(desc)); + } + else + { + self->mDescEditor->setParseHTML(TRUE); + self->mDescEditor->appendColoredText(std::string(desc), false, false, gColors.getColor("TextFgReadOnlyColor")); + } self->mSnapshotCtrl->setImageAssetID(snapshot_id); self->mLocationEditor->setText(location_text); self->mEnabledCheck->set(enabled); -- cgit v1.1