summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-11-20 13:27:17 -0800
committerJames Cook <james@lindenlab.com>2009-11-20 13:27:17 -0800
commitad02019d71741ce571599cdeef900430384b82dd (patch)
treee3d8d39885297be5e9c46c7460d4e3c1b7b28626 /indra/newview
parentf4913d55b035cfa7dd476dc6e880ba49a3046fb0 (diff)
Use "Select/Close" as button labels for avatar picker if choosing people repeatedly.
Used by group member invitations, for example, where the "OK/Cancel" labels don't make much sense. Reviewed with Richard.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloateravatarpicker.cpp34
-rw-r--r--indra/newview/skins/default/xui/en/floater_avatar_picker.xml10
2 files changed, 30 insertions, 14 deletions
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 8ac7f3fd7e..07bb6f832b 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -42,6 +42,7 @@
#include "llworld.h"
// Linden libraries
+#include "llbutton.h"
#include "lllineeditor.h"
#include "llscrolllistctrl.h"
#include "llscrolllistitem.h"
@@ -56,7 +57,8 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback,
BOOL closeOnSelect)
{
// *TODO: Use a key to allow this not to be an effective singleton
- LLFloaterAvatarPicker* floater = LLFloaterReg::showTypedInstance<LLFloaterAvatarPicker>("avatar_picker");
+ LLFloaterAvatarPicker* floater =
+ LLFloaterReg::showTypedInstance<LLFloaterAvatarPicker>("avatar_picker");
floater->mCallback = callback;
floater->mCallbackUserdata = userdata;
@@ -64,6 +66,15 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback,
floater->mNearMeListComplete = FALSE;
floater->mCloseOnSelect = closeOnSelect;
+ if (!closeOnSelect)
+ {
+ // Use Select/Close
+ std::string select_string = floater->getString("Select");
+ std::string close_string = floater->getString("Close");
+ floater->getChild<LLButton>("ok_btn")->setLabel(select_string);
+ floater->getChild<LLButton>("cancel_btn")->setLabel(close_string);
+ }
+
return floater;
}
@@ -102,10 +113,9 @@ BOOL LLFloaterAvatarPicker::postBuild()
friends->setDoubleClickCallback(onBtnSelect, this);
childSetCommitCallback("Friends", onList, this);
- childSetAction("Select", onBtnSelect, this);
- childDisable("Select");
-
- childSetAction("Cancel", onBtnClose, this);
+ childSetAction("ok_btn", onBtnSelect, this);
+ childDisable("ok_btn");
+ childSetAction("cancel_btn", onBtnClose, this);
childSetFocus("Edit");
@@ -132,7 +142,7 @@ BOOL LLFloaterAvatarPicker::postBuild()
void LLFloaterAvatarPicker::onTabChanged()
{
- childSetEnabled("Select", visibleItemsSelected());
+ childSetEnabled("ok_btn", visibleItemsSelected());
}
// Destroys the object
@@ -234,7 +244,7 @@ void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata)
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
if (self)
{
- self->childSetEnabled("Select", self->visibleItemsSelected());
+ self->childSetEnabled("ok_btn", self->visibleItemsSelected());
}
}
@@ -270,13 +280,13 @@ void LLFloaterAvatarPicker::populateNearMe()
if (empty)
{
childDisable("NearMe");
- childDisable("Select");
+ childDisable("ok_btn");
near_me_scroller->setCommentText(getString("no_one_near"));
}
else
{
childEnable("NearMe");
- childEnable("Select");
+ childEnable("ok_btn");
near_me_scroller->selectFirstItem();
onList(near_me_scroller, this);
near_me_scroller->setFocus(TRUE);
@@ -357,7 +367,7 @@ void LLFloaterAvatarPicker::find()
getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems();
getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching"));
- childSetEnabled("Select", FALSE);
+ childSetEnabled("ok_btn", FALSE);
mNumResultsReturned = 0;
}
@@ -414,7 +424,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
map["[TEXT]"] = floater->childGetText("Edit");
avatar_name = floater->getString("not_found", map);
search_results->setEnabled(FALSE);
- floater->childDisable("Select");
+ floater->childDisable("ok_btn");
}
else
{
@@ -430,7 +440,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
if (found_one)
{
- floater->childEnable("Select");
+ floater->childEnable("ok_btn");
search_results->selectFirstItem();
floater->onList(search_results, floater);
search_results->setFocus(TRUE);
diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
index 3a1499eaaa..953bd08dd4 100644
--- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
+++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
@@ -26,6 +26,12 @@
name="searching">
Searching...
</floater.string>
+ <!-- For multiple person selection, use "Select" and "Close"
+ instead of "OK" and "Cancel" because "Cancel" still keeps the ones
+ you have already selected. The code will show the appropriate
+ set of buttons. -->
+ <string name="Select">Select</string>
+ <string name="Close">Close</string>
<tab_container
follows="all"
height="300"
@@ -205,7 +211,7 @@
height="23"
label="OK"
label_selected="OK"
- name="Select"
+ name="ok_btn"
top_pad="3"
left="46"
width="100" />
@@ -214,7 +220,7 @@
height="23"
label="Cancel"
label_selected="Cancel"
- name="Cancel"
+ name="cancel_btn"
width="100"
left_pad="5" />
</floater>