summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-09-16 09:38:05 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-09-16 09:38:05 -0700
commitae623c8068145f968f09ccf9bbdd90e993ca4283 (patch)
tree29cffd02ee00b447c07e4cd40a2e0fa9b8cc30a3 /indra/newview
parente27ac0abf7bef6e61c2d81911cc0c693206ee401 (diff)
Set display name field now clamps to 31 unicode characters
Added ability to set max length in line editors by characters in addition to bytes left other widgets (comboboxes/spinners) using the bytes, but it can easily be changed over reviewed by Richard
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfolderview.cpp2
-rw-r--r--indra/newview/lllocationinputctrl.cpp2
-rw-r--r--indra/newview/lltoastalertpanel.cpp3
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml2
4 files changed, 6 insertions, 3 deletions
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 5d8e3f9ab9..21c6c98876 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -224,7 +224,7 @@ LLFolderView::LLFolderView(const Params& p)
params.name("ren");
params.rect(rect);
params.font(getLabelFontForStyle(LLFontGL::NORMAL));
- params.max_length_bytes(DB_INV_ITEM_NAME_STR_LEN);
+ params.max_length.bytes(DB_INV_ITEM_NAME_STR_LEN);
params.commit_callback.function(boost::bind(&LLFolderView::commitRename, this, _2));
params.prevalidate_callback(&LLTextValidate::validateASCIIPrintableNoPipe);
params.commit_on_focus_lost(true);
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index d714cae872..1527f8f4c9 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -224,7 +224,7 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
LLLineEditor::Params params = p.combo_editor;
params.rect(text_entry_rect);
params.default_text(LLStringUtil::null);
- params.max_length_bytes(p.max_chars);
+ params.max_length.bytes(p.max_chars);
params.keystroke_callback(boost::bind(&LLLocationInputCtrl::onTextEntry, this, _1));
params.commit_on_focus_lost(false);
params.follows.flags(FOLLOWS_ALL);
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index 2d0c360905..8b2f066d41 100644
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -76,6 +76,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
LLNotificationFormPtr form = mNotification->getForm();
std::string edit_text_name;
std::string edit_text_contents;
+ S32 edit_text_max_chars = 0;
bool is_password = false;
LLToastPanel::setBackgroundVisible(FALSE);
@@ -115,6 +116,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
{
edit_text_contents = (*it)["value"].asString();
edit_text_name = (*it)["name"].asString();
+ edit_text_max_chars = (*it)["max_length_chars"].asInteger();
}
else if (type == "password")
{
@@ -253,6 +255,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
mLineEditor->setName(edit_text_name);
mLineEditor->reshape(leditor_rect.getWidth(), leditor_rect.getHeight());
mLineEditor->setRect(leditor_rect);
+ mLineEditor->setMaxTextChars(edit_text_max_chars);
mLineEditor->setText(edit_text_contents);
// decrease limit of line editor of teleport offer dialog to avoid truncation of
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 281f367345..5bd28e5b91 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3197,7 +3197,7 @@ Press reset to make it the same as your username.
Change your display name?
<form name="form">
- <input name="display_name" type="text">
+ <input name="display_name" max_length_chars="31" type="text">
[DISPLAY_NAME]
</input>
<button