merge from viewer-release

master
Tofu Linden 2010-07-28 10:37:06 +01:00
commit 77c3a65db6
23 changed files with 132 additions and 54 deletions

View File

@ -141,6 +141,8 @@ public:
const LLAccordionCtrlTab* getSelectedTab() const { return mSelectedTab; }
bool getFitParent() const {return mFitParent;}
private:
void initNoTabsWidget(const LLTextBox::Params& tb_params);
void updateNoTabsHelpTextVisibility();

View File

@ -33,6 +33,7 @@
#include "linden_common.h"
#include "llaccordionctrltab.h"
#include "llaccordionctrl.h"
#include "lllocalcliprect.h"
#include "llscrollbar.h"
@ -710,7 +711,7 @@ S32 LLAccordionCtrlTab::notifyParent(const LLSD& info)
setRect(panel_rect);
}
//LLAccordionCtrl should rearrange accodion tab if one of accordion change its size
//LLAccordionCtrl should rearrange accordion tab if one of accordion change its size
if (getParent()) // A parent may not be set if tabs are added dynamically.
getParent()->notifyParent(info);
return 1;
@ -721,6 +722,27 @@ S32 LLAccordionCtrlTab::notifyParent(const LLSD& info)
return 1;
}
}
else if (info.has("scrollToShowRect"))
{
LLAccordionCtrl* parent = dynamic_cast<LLAccordionCtrl*>(getParent());
if (parent && parent->getFitParent())
{
// EXT-8285 ('No attachments worn' text appears at the bottom of blank 'Attachments' accordion)
// The problem was in passing message "scrollToShowRect" IN LLAccordionCtrlTab::notifyParent
// FROM child LLScrollContainer TO parent LLAccordionCtrl with "it_parent" set to true.
// It is wrong notification for parent accordion which leads to recursive call of adjustContainerPanel
// As the result of recursive call of adjustContainerPanel we got LLAccordionCtrlTab
// that reshaped and re-sized with different rectangles.
// LLAccordionCtrl has own scrollContainer and LLAccordionCtrlTab has own scrollContainer
// both should handle own scroll container's event.
// So, if parent accordion "fit_parent" accordion tab should handle its scroll container events itself.
return 1;
}
}
return LLUICtrl::notifyParent(info);
}

View File

@ -1078,25 +1078,6 @@ void LLFlatListView::setNoItemsCommentVisible(bool visible) const
{
if (mNoItemsCommentTextbox)
{
if (visible)
{
/*
// *NOTE: MA 2010-02-04
// Deprecated after params of the comment text box were moved into widget (flat_list_view.xml)
// can be removed later if nothing happened.
// We have to update child rect here because of issues with rect after reshaping while creating LLTextbox
// It is possible to have invalid LLRect if Flat List is in LLAccordionTab
LLRect comment_rect = getLocalRect();
// To see comment correctly (EXT - 3244) in mNoItemsCommentTextbox we must get border width
// of LLFlatListView (@see getBorderWidth()) and stretch mNoItemsCommentTextbox to this width
// But getBorderWidth() returns 0 if LLFlatListView not visible. So we have to get border width
// from 'scroll_border'
LLViewBorder* scroll_border = getChild<LLViewBorder>("scroll border");
comment_rect.stretch(-scroll_border->getBorderWidth());
mNoItemsCommentTextbox->setRect(comment_rect);
*/
}
mSelectedItemsBorder->setVisible(!visible);
mNoItemsCommentTextbox->setVisible(visible);
}

View File

@ -983,6 +983,10 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up
LLNotificationsUtil::add("CannotWearTrash");
return false;
}
else if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), LLAppearanceMgr::instance().getCOF())) // EXT-84911
{
return false;
}
switch (item_to_wear->getType())
{

View File

@ -1874,13 +1874,18 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
}
// Successively filter out invalid options
selected_items_t::iterator item_itor;
U32 flags = FIRST_SELECTED_ITEM;
for (item_itor = mSelectedItems.begin(); item_itor != mSelectedItems.end(); ++item_itor)
for (selected_items_t::iterator item_itor = mSelectedItems.begin();
item_itor != mSelectedItems.end();
++item_itor)
{
(*item_itor)->buildContextMenu(*menu, flags);
LLFolderViewItem* selected_item = (*item_itor);
selected_item->buildContextMenu(*menu, flags);
flags = 0x0;
}
addNoOptions(menu);
menu->updateParent(LLMenuGL::sMenuContainer);
LLMenuGL::showPopup(this, menu, x, y);
@ -1889,7 +1894,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
}
else
{
if(menu && menu->getVisible())
if (menu && menu->getVisible())
{
menu->setVisible(FALSE);
}
@ -1898,6 +1903,37 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
return handled;
}
// Add "--no options--" if the menu is completely blank.
BOOL LLFolderView::addNoOptions(LLMenuGL* menu) const
{
const std::string nooptions_str = "--no options--";
LLView *nooptions_item = NULL;
const LLView::child_list_t *list = menu->getChildList();
for (LLView::child_list_t::const_iterator itor = list->begin();
itor != list->end();
++itor)
{
LLView *menu_item = (*itor);
if (menu_item->getVisible())
{
return FALSE;
}
std::string name = menu_item->getName();
if (menu_item->getName() == nooptions_str)
{
nooptions_item = menu_item;
}
}
if (nooptions_item)
{
nooptions_item->setVisible(TRUE);
nooptions_item->setEnabled(FALSE);
return TRUE;
}
return FALSE;
}
BOOL LLFolderView::handleHover( S32 x, S32 y, MASK mask )
{
return LLView::handleHover( x, y, mask );

View File

@ -292,6 +292,8 @@ protected:
bool selectFirstItem();
bool selectLastItem();
BOOL addNoOptions(LLMenuGL* menu) const;
protected:
LLHandle<LLView> mPopupMenuHandle;

View File

@ -952,6 +952,8 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid)
BOOL LLInvFVBridge::canShare() const
{
if (!isAgentInventory()) return FALSE;
const LLInventoryModel* model = getInventoryModel();
if (!model) return FALSE;
@ -963,9 +965,10 @@ BOOL LLInvFVBridge::canShare() const
return (BOOL)LLGiveInventory::isInventoryGiveAcceptable(item);
}
// All categories can be given.
const LLViewerInventoryCategory* cat = model->getCategory(mUUID);
return (cat != NULL);
// Categories can be given.
if (model->getCategory(mUUID)) return TRUE;
return FALSE;
}
// +=================================================+
@ -2612,12 +2615,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
mDisabledItems.push_back(std::string("Share"));
}
if (mItems.empty())
{
mItems.push_back(std::string("--no options--"));
mDisabledItems.push_back(std::string("--no options--"));
}
hide_context_entries(menu, mItems, mDisabledItems);
// Add menu items that are dependent on the contents of the folder.

View File

@ -250,6 +250,18 @@ BOOL get_can_item_be_worn(const LLUUID& id)
const LLViewerInventoryItem* item = gInventory.getItem(id);
if (!item)
return FALSE;
if (LLAppearanceMgr::isLinkInCOF(item->getLinkedUUID()))
{
// an item having links in COF (i.e. a worn item)
return FALSE;
}
if (gInventory.isObjectDescendentOf(id, LLAppearanceMgr::instance().getCOF()))
{
// a non-link object in COF (should not normally happen)
return FALSE;
}
const LLUUID trash_id = gInventory.findCategoryUUIDForType(
LLFolderType::FT_TRASH);

View File

@ -1005,11 +1005,6 @@ bool LLOutfitsList::canWearSelected()
{
const LLUUID& id = *it;
if (LLAppearanceMgr::isLinkInCOF(id))
{
return false;
}
// Check whether the item is worn.
if (!get_can_item_be_worn(id))
{

View File

@ -51,6 +51,7 @@
#include "lltabcontainer.h"
#include "lltextbox.h"
#include "lltexteditor.h"
#include "lltrans.h"
#include "llviewertexturelist.h"
#include "llviewerwindow.h"
#include "llfocusmgr.h"
@ -587,7 +588,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
row["columns"][1]["column"] = "action";
row["columns"][1]["type"] = "text";
row["columns"][1]["value"] = action_set->mActionSetData->mName;
row["columns"][1]["value"] = LLTrans::getString(action_set->mActionSetData->mName);
row["columns"][1]["font"]["name"] = "SANSSERIF_SMALL";

View File

@ -750,8 +750,6 @@ void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
std::vector<std::string> items;
std::vector<std::string> disabled_items;
items.push_back(std::string("--no options--"));
disabled_items.push_back(std::string("--no options--"));
hide_context_entries(menu, items, disabled_items);
}

View File

@ -779,9 +779,7 @@ void LLPanelOutfitEdit::updatePlusButton()
}
// If any of the selected items are not wearable (due to already being worn OR being of the wrong type), disable the add button.
uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(& get_can_item_be_worn, _1)
// since item can be not worn but in wearing process at that time - we need to check is link to item presents in COF
|| boost::bind(&LLAppearanceMgr::isLinkInCOF, _1));
uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(&get_can_item_be_worn, _1));
bool can_add = ( unwearable_item == selected_items.end() );
mPlusBtn->setEnabled(can_add);

View File

@ -33,10 +33,13 @@
#include "llsidepanelinventory.h"
#include "llagent.h"
#include "llappearancemgr.h"
#include "llavataractions.h"
#include "llbutton.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llinventorypanel.h"
#include "lloutfitobserver.h"
#include "llpanelmaininventory.h"
#include "llsidepaneliteminfo.h"
#include "llsidepaneltaskinfo.h"
@ -98,6 +101,8 @@ BOOL LLSidepanelInventory::postBuild()
my_inventory_panel->addHideFolderType(LLFolderType::FT_LANDMARK);
my_inventory_panel->addHideFolderType(LLFolderType::FT_FAVORITE);
*/
LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLSidepanelInventory::updateVerbs, this));
}
// UI elements from item panel
@ -283,7 +288,7 @@ void LLSidepanelInventory::updateVerbs()
case LLInventoryType::IT_OBJECT:
case LLInventoryType::IT_ATTACHMENT:
mWearBtn->setVisible(TRUE);
mWearBtn->setEnabled(TRUE);
mWearBtn->setEnabled(get_can_item_be_worn(item->getLinkedUUID()));
mShopBtn->setVisible(FALSE);
break;
case LLInventoryType::IT_SOUND:

View File

@ -23,7 +23,8 @@
</panel.string>
<text name="title" value="Profil for genstand"/>
<text name="origin" value="(Beholdning)"/>
<panel label="">
<panel label=""
name="item_profile">
<text name="LabelItemNameTitle">
Navn:
</text>

View File

@ -23,7 +23,8 @@
</panel.string>
<text name="title" value="Objektprofil"/>
<text name="origin" value="(Inventar)"/>
<panel label="">
<panel label=""
name="item_profile">
<text name="LabelItemNameTitle">
Name:
</text>

View File

@ -80,10 +80,11 @@
<panel
follows="all"
height="493"
help_topic=""
label=""
layout="topleft"
left="9"
help_topic=""
name="item_profile"
top="45"
width="313"
background_visible="true"

View File

@ -3239,4 +3239,20 @@ Abuse Report</string>
<!-- currency formatting -->
<string name="LocalEstimateUSD">US$ [AMOUNT]</string>
<!-- Group Profile roles and powers -->
<string name="Membership">Membership</string>
<string name="Roles">Roles</string>
<string name="Group Identity">Group Identity</string>
<string name="Parcel Management">Parcel Management</string>
<string name="Parcel Identity">Parcel Identity</string>
<string name="Parcel Settings">Parcel Settings</string>
<string name="Parcel Powers">Parcel Powers</string>
<string name="Parcel Access">Parcel Access</string>
<string name="Parcel Content">Parcel Content</string>
<string name="Object Management">Object Management</string>
<string name="Accounting">Accounting</string>
<string name="Notices">Notices</string>
<string name="Chat">Chat</string>
</strings>

View File

@ -23,7 +23,8 @@
</panel.string>
<text name="title" value="Perfil del elemento"/>
<text name="origin" value="(Inventario)"/>
<panel label="">
<panel label=""
name="item_profile">
<text name="LabelItemNameTitle">
Nombre:
</text>

View File

@ -23,7 +23,8 @@
</panel.string>
<text name="title" value="Profil de l&apos;article"/>
<text name="origin" value="(inventaire)"/>
<panel label="">
<panel label=""
name="item_profile">
<text name="LabelItemNameTitle">
Nom :
</text>

View File

@ -23,7 +23,8 @@
</panel.string>
<text name="title" value="Profilo articolo"/>
<text name="origin" value="(Inventario)"/>
<panel label="">
<panel label=""
name="item_profile">
<text name="LabelItemNameTitle">
Nome:
</text>

View File

@ -23,7 +23,8 @@
</panel.string>
<text name="title" value="アイテムのプロフィール"/>
<text name="origin" value="(持ち物)"/>
<panel label="">
<panel label=""
name="item_profile">
<text name="LabelItemNameTitle">
名前:
</text>

View File

@ -23,7 +23,8 @@
</panel.string>
<text name="title" value="Profil obiektu"/>
<text name="origin" value="(Szafa)"/>
<panel label="">
<panel label=""
name="item_profile">
<text name="LabelItemNameTitle">
Nazwa:
</text>

View File

@ -23,7 +23,8 @@
</panel.string>
<text name="title" value="Perfil do item"/>
<text name="origin" value="(Inventário)"/>
<panel label="">
<panel label=""
name="item_profile">
<text name="LabelItemNameTitle">
Nome:
</text>