merge from PE's viewer-trunk

meow-7.2.2
Tofu Linden 2010-08-20 12:17:51 -07:00
commit f726660430
7 changed files with 100 additions and 26 deletions

View File

@ -669,6 +669,14 @@ BOOL LLFlatListView::handleKeyHere(KEY key, MASK mask)
}
break;
}
case KEY_ESCAPE:
{
if (mask == MASK_NONE)
{
setFocus(FALSE); // pass focus to the game area (EXT-8357)
}
break;
}
default:
break;
}

View File

@ -1021,19 +1021,6 @@ void LLIMModel::sendMessage(const std::string& utf8_text,
if (is_not_group_id)
{
#if 0
//use this code to add only online members
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id);
LLSpeakerMgr::speaker_list_t speaker_list;
speaker_mgr->getSpeakerList(&speaker_list, true);
for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++)
{
const LLPointer<LLSpeaker>& speakerp = *it;
LLRecentPeople::instance().add(speakerp->mID);
}
#else
LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(im_session_id);
if( session == 0)//??? shouldn't really happen
{
@ -1048,16 +1035,20 @@ void LLIMModel::sendMessage(const std::string& utf8_text,
// Concrete participants will be added into this list once they sent message in chat.
if (IM_SESSION_INVITE == dialog) return;
// implemented adding of all participants of an outgoing to Recent People List. See EXT-5694.
for(uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();
it!=session->mInitialTargetIDs.end();++it)
// Add only online members to recent (EXT-8658)
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id);
LLSpeakerMgr::speaker_list_t speaker_list;
if(speaker_mgr != NULL)
{
const LLUUID id = *it;
speaker_mgr->getSpeakerList(&speaker_list, true);
}
for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++)
{
const LLPointer<LLSpeaker>& speakerp = *it;
LLRecentPeople::instance().add(id);
LLRecentPeople::instance().add(speakerp->mID);
}
}
#endif
}

View File

@ -87,9 +87,58 @@ protected:
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("Wearing.Edit", boost::bind(&edit_outfit));
functor_t take_off = boost::bind(&LLAppearanceMgr::removeItemFromAvatar, LLAppearanceMgr::getInstance(), _1);
return createFromFile("menu_wearing_tab.xml");
registrar.add("Wearing.Edit", boost::bind(&edit_outfit));
registrar.add("Wearing.TakeOff", boost::bind(handleMultiple, take_off, mUUIDs));
registrar.add("Wearing.Detach", boost::bind(handleMultiple, take_off, mUUIDs));
LLContextMenu* menu = createFromFile("menu_wearing_tab.xml");
updateMenuItemsVisibility(menu);
return menu;
}
void updateMenuItemsVisibility(LLContextMenu* menu)
{
bool bp_selected = false; // true if body parts selected
bool clothes_selected = false;
bool attachments_selected = false;
// See what types of wearables are selected.
for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it)
{
LLViewerInventoryItem* item = gInventory.getItem(*it);
if (!item)
{
llwarns << "Invalid item" << llendl;
continue;
}
LLAssetType::EType type = item->getType();
if (type == LLAssetType::AT_CLOTHING)
{
clothes_selected = true;
}
else if (type == LLAssetType::AT_BODYPART)
{
bp_selected = true;
}
else if (type == LLAssetType::AT_OBJECT)
{
attachments_selected = true;
}
}
// Enable/disable some menu items depending on the selection.
bool allow_detach = !bp_selected && !clothes_selected && attachments_selected;
bool allow_take_off = !bp_selected && clothes_selected && !attachments_selected;
menu->setItemVisible("take_off", allow_take_off);
menu->setItemVisible("detach", allow_detach);
menu->setItemVisible("edit_outfit_separator", allow_take_off || allow_detach);
}
};

View File

@ -636,6 +636,7 @@ LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p)
setRightMouseDownCallback(boost::bind(&LLWearableItemsList::onRightClick, this, _2, _3));
}
mWornIndicationEnabled = p.worn_indication_enabled;
setNoItemsCommentText(LLTrans::getString("LoadingData"));
}
// virtual
@ -677,6 +678,11 @@ void LLWearableItemsList::updateList(const LLUUID& category_id)
LLInventoryModel::EXCLUDE_TRASH,
collector);
if(item_array.empty() && gInventory.isCategoryComplete(category_id))
{
setNoItemsCommentText(LLTrans::getString("EmptyOutfitText"));
}
refreshList(item_array);
}

View File

@ -2,6 +2,24 @@
<context_menu
layout="topleft"
name="Wearing">
<menu_item_call
label="Take Off"
layout="topleft"
name="take_off">
<on_click
function="Wearing.TakeOff" />
</menu_item_call>
<menu_item_call
label="Detach"
layout="topleft"
name="detach">
<on_click
function="Wearing.Detach"
parameter="detach"/>
</menu_item_call>
<menu_item_separator
layout="topleft"
name="edit_outfit_separator" />
<menu_item_call
label="Edit Outfit"
layout="topleft"

View File

@ -36,7 +36,7 @@
enabled="true"
follows="right|top"
height="18"
image_name="Parcel_VoiceNo_Light"
image_name="Parcel_VoiceNo_Dark"
name="voice_icon"
top="1"
visible="false"
@ -45,7 +45,7 @@
<icon
follows="right|top"
height="18"
image_name="Parcel_FlyNo_Light"
image_name="Parcel_FlyNo_Dark"
name="fly_icon"
top="1"
visible="false"
@ -54,7 +54,7 @@
<icon
follows="right|top"
height="18"
image_name="Parcel_PushNo_Light"
image_name="Parcel_PushNo_Dark"
name="push_icon"
top="1"
visible="false"
@ -63,7 +63,7 @@
<icon
follows="right|top"
height="18"
image_name="Parcel_BuildNo_Light"
image_name="Parcel_BuildNo_Dark"
name="build_icon"
top="1"
visible="false"
@ -72,7 +72,7 @@
<icon
follows="right|top"
height="18"
image_name="Parcel_ScriptsNo_Light"
image_name="Parcel_ScriptsNo_Dark"
name="scripts_icon"
top="1"
visible="false"

View File

@ -3265,4 +3265,6 @@ Abuse Report</string>
<string name="DeleteItems">Delete selected items?</string>
<string name="DeleteItem">Delete selected item?</string>
<string name="EmptyOutfitText">There are no items in this outfit</string>
</strings>