HTTP links in group notices and extended group limit ready.

This commit is contained in:
Siana Gearz
2011-01-04 14:48:23 +01:00
parent 77fc0e82c8
commit e89db0b4b1
9 changed files with 30 additions and 6 deletions

View File

@@ -253,7 +253,7 @@ const U8 SIM_ACCESS_DOWN = 254;
const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
// group constants
const S32 MAX_AGENT_GROUPS = 25;
const S32 DEFAULT_MAX_AGENT_GROUPS = 25;
// attachment constants
const S32 MAX_AGENT_ATTACHMENTS = 38;

View File

@@ -3899,6 +3899,7 @@ void LLTextEditor::removeTextFromEnd(S32 num_chars)
{
if (num_chars <= 0) return;
num_chars = llclamp(num_chars, 0, getLength());
remove(getLength() - num_chars, num_chars, FALSE);
S32 len = getLength();

View File

@@ -205,6 +205,7 @@ public:
void setThumbColor( const LLColor4& color );
void setHighlightColor( const LLColor4& color );
void setShadowColor( const LLColor4& color );
LLColor4 getReadOnlyFgColor() { return mReadOnlyFgColor; }
// Hacky methods to make it into a word-wrapping, potentially scrolling,
// read-only text box.

View File

@@ -58,6 +58,7 @@
#include "lluictrlfactory.h"
#include "llviewerwindow.h"
#include "llimview.h"
#include "llstartup.h"
// static
std::map<const LLUUID, LLFloaterGroupPicker*> LLFloaterGroupPicker::sInstances;
@@ -202,7 +203,7 @@ void LLPanelGroups::reset()
group_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
}
childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count()));
childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS));
childSetTextArg("groupcount", "[MAX]", llformat("%d", gMaxAgentGroups));
const std::string none_text = getString("none");
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text);
@@ -214,7 +215,7 @@ BOOL LLPanelGroups::postBuild()
childSetCommitCallback("group list", onGroupList, this);
childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count()));
childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS));
childSetTextArg("groupcount", "[MAX]", llformat("%d", gMaxAgentGroups));
const std::string none_text = getString("none");
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text);
@@ -274,7 +275,7 @@ void LLPanelGroups::enableButtons()
childDisable("IM");
childDisable("Leave");
}
if(gAgent.mGroups.count() < MAX_AGENT_GROUPS)
if(gAgent.mGroups.count() < gMaxAgentGroups)
{
childEnable("Create");
}

View File

@@ -194,6 +194,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
// Sadly, our LLTextEditor can't handle both styled and unstyled text
// at the same time. Hence this space must be styled. JC
text->appendColoredText(std::string(" "),false,false,LLColor4::grey4);
text->setParseHTML(TRUE);
text->appendColoredText(std::string("\n\n") + message,false,false,LLColor4::grey4);
LLColor4 semi_transparent(1.0f,1.0f,1.0f,0.8f);

View File

@@ -247,6 +247,7 @@ BOOL LLPanelGroupNotices::postBuild()
// View
mViewSubject = getChild<LLLineEditor>("view_subject",recurse);
mViewMessage = getChild<LLTextEditor>("view_message",recurse);
mViewMessage->setParseHTML(TRUE);
mViewInventoryName = getChild<LLLineEditor>("view_inventory_name",recurse);
mViewInventoryName->setTabStop(FALSE);
@@ -524,7 +525,12 @@ void LLPanelGroupNotices::showNotice(const std::string& subject,
arrangeNoticeView(VIEW_PAST_NOTICE);
if(mViewSubject) mViewSubject->setText(subject);
if(mViewMessage) mViewMessage->setText(message);
if (mViewMessage) {
// We need to prune the highlights, and clear() is not doing it...
mViewMessage->removeTextFromEnd(mViewMessage->getMaxLength());
// Now we append the new text (setText() won't highlight URLs)
mViewMessage->appendColoredText(message, false, false, mViewMessage->getReadOnlyFgColor());
}
if (mInventoryOffer)
{

View File

@@ -226,6 +226,8 @@ std::string gInitialOutfitGender;
std::string SCREEN_HOME_FILENAME = "screen_home.bmp";
std::string SCREEN_LAST_FILENAME = "screen_last.bmp";
S32 gMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS;
//
// Imported globals
//
@@ -2459,6 +2461,17 @@ bool idle_startup()
}
}
std::string max_agent_groups = LLUserAuth::getInstance()->getResponse("max-agent-groups");
if (!max_agent_groups.empty())
{
gMaxAgentGroups = atoi(max_agent_groups.c_str());
LL_INFOS("LLStartup") << "gMaxAgentGroups read from login.cgi: " << gMaxAgentGroups << LL_ENDL;
}
else
{
gMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS;
}
std::string map_server_url = LLUserAuth::getInstance()->getResponse("map-server-url");
if(!map_server_url.empty())
{

View File

@@ -78,6 +78,7 @@ extern bool gAgentMovementCompleted;
extern LLPointer<LLImageGL> gStartImageGL;
extern std::string gInitialOutfit;
extern std::string gInitialOutfitGender; // "male" or "female"
extern S32 gMaxAgentGroups;
class LLStartUp
{

View File

@@ -666,7 +666,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
if(option == 0 && !group_id.isNull())
{
// check for promotion or demotion.
S32 max_groups = MAX_AGENT_GROUPS;
S32 max_groups = gMaxAgentGroups;
if(gAgent.isInGroup(group_id)) ++max_groups;
if(gAgent.mGroups.count() < max_groups)