Merge remote-tracking branch 'Liru/master'

This commit is contained in:
Damian Zhaoying
2014-10-02 03:58:38 -03:00
20 changed files with 164 additions and 69 deletions

View File

@@ -171,7 +171,9 @@ void AIArchetype::toXML(std::ostream& os, int indentation) const
{
tag.attribute("name", LLWearableType::getTypeName(mType));
}
if (!mMetaData.mPath.empty())
// mMetaData.mPath can be empty even exporting from the Appearance editor:
// when the asset is in the "My Inventory" root.
if (!mMetaData.mPath.empty() || !mMetaData.mName.empty()) // Is this not an old-style linden_genepool?
{
tag.child(mMetaData);
}

View File

@@ -226,7 +226,7 @@ void LLPrefsAscentChat::refreshValues()
mSecondsInLog = gSavedSettings.getBOOL("SecondsInLog");
std::string format = gSavedSettings.getString("ShortTimeFormat");
if (format.find("%p") == -1)
if (format.find("%p") == std::string::npos)
{
mTimeFormat = 0;
}
@@ -236,7 +236,7 @@ void LLPrefsAscentChat::refreshValues()
}
format = gSavedSettings.getString("ShortDateFormat");
if (format.find("%m/%d/%") != -1)
if (format.find("%m/%d/%") != std::string::npos)
{
mDateFormat = 2;
}

View File

@@ -507,10 +507,10 @@ public:
gVFS->getData(data->assetid, data->type, buffer, 0, size);
std::string script((char*)buffer);
BOOL domono = FALSE;//Phox- this needs to be fixed when the preproc is added = JCLSLPreprocessor::mono_directive(script);
*//*if(script.find("//mono\n") != -1)
*//*if(script.find("//mono\n") != std::string::npos)
{
domono = TRUE;
}else if(script.find("//lsl2\n") != -1)
}else if(script.find("//lsl2\n") != std::string::npos)
{
domono = FALSE;
}*//*

View File

@@ -221,10 +221,10 @@ void JCFloaterAreaSearch::results()
LLStringUtil::toLower(object_desc);
LLStringUtil::toLower(object_owner);
LLStringUtil::toLower(object_group);
if ((mFilterStrings[LIST_OBJECT_NAME].empty() || object_name.find(mFilterStrings[LIST_OBJECT_NAME]) != -1) &&
(mFilterStrings[LIST_OBJECT_DESC].empty() || object_desc.find(mFilterStrings[LIST_OBJECT_DESC]) != -1) &&
(mFilterStrings[LIST_OBJECT_OWNER].empty() || object_owner.find(mFilterStrings[LIST_OBJECT_OWNER]) != -1) &&
(mFilterStrings[LIST_OBJECT_GROUP].empty() || object_group.find(mFilterStrings[LIST_OBJECT_GROUP]) != -1))
if ((mFilterStrings[LIST_OBJECT_NAME].empty() || object_name.find(mFilterStrings[LIST_OBJECT_NAME]) != std::string::npos) &&
(mFilterStrings[LIST_OBJECT_DESC].empty() || object_desc.find(mFilterStrings[LIST_OBJECT_DESC]) != std::string::npos) &&
(mFilterStrings[LIST_OBJECT_OWNER].empty() || object_owner.find(mFilterStrings[LIST_OBJECT_OWNER]) != std::string::npos) &&
(mFilterStrings[LIST_OBJECT_GROUP].empty() || object_group.find(mFilterStrings[LIST_OBJECT_GROUP]) != std::string::npos))
{
//llinfos << "pass" << llendl;
LLSD element;

View File

@@ -37,6 +37,9 @@
#include "lldroptarget.h"
#include <boost/signals2/shared_connection_block.hpp>
#include "llbutton.h"
#include "llinventorymodel.h"
#include "llstartup.h"
#include "lltextbox.h"
@@ -46,8 +49,9 @@
static LLRegisterWidget<LLDropTarget> r("drop_target");
static std::string currently_set_to(const LLViewerInventoryItem* item)
std::string currently_set_to(const LLInventoryItem* item)
{
if (!item) return LLTrans::getString("CurrentlyNotSet");
LLStringUtil::format_map_t args;
args["[ITEM]"] = item->getName();
return LLTrans::getString("CurrentlySetTo", args);
@@ -55,26 +59,32 @@ static std::string currently_set_to(const LLViewerInventoryItem* item)
LLDropTarget::LLDropTarget(const LLDropTarget::Params& p)
: LLView(p)
, mReset(NULL)
{
setToolTip(std::string(p.tool_tip));
mText = new LLTextBox("drop_text", p.rect, p.label);
mText = new LLTextBox("drop_text", LLRect(), p.label);
addChild(mText);
setControlName(p.control_name, NULL);
mText->setOrigin(0, 0);
mText->setFollows(FOLLOWS_NONE);
mText->setMouseOpaque(false);
mText->setHAlign(LLFontGL::HCENTER);
mText->setVPad(1);
mBorder = new LLViewBorder("drop_border", p.rect, LLViewBorder::BEVEL_IN);
mBorder = new LLViewBorder("drop_border", LLRect(), LLViewBorder::BEVEL_IN);
addChild(mBorder);
mBorder->setMouseOpaque(false);
if (p.fill_parent) fillParent(getParent());
if (!p.border_visible) mBorder->setBorderWidth(0);
if (p.show_reset)
{
addChild(mReset = new LLButton("reset", LLRect(), "icn_clear_lineeditor.tga", "icn_clear_lineeditor.tga", "", boost::bind(&LLDropTarget::setValue, this, _2)));
}
// Now set the rects of the children
p.fill_parent ? fillParent(getParent()) : setChildRects(p.rect);
}
LLDropTarget::~LLDropTarget()
@@ -84,7 +94,7 @@ LLDropTarget::~LLDropTarget()
// static
LLView* LLDropTarget::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory* factory)
{
LLDropTarget* target = new LLDropTarget();
LLDropTarget* target = new LLDropTarget;
target->initFromXML(node, parent);
return target;
}
@@ -95,9 +105,17 @@ void LLDropTarget::initFromXML(LLXMLNodePtr node, LLView* parent)
LLView::initFromXML(node, parent);
const LLRect& rect = getRect();
const LLRect child_rect(0, rect.getHeight(), rect.getWidth(), 0);
mText->setRect(child_rect);
mBorder->setRect(child_rect);
if (node->hasAttribute("show_reset"))
{
bool show;
node->getAttribute_bool("show_reset", show);
if (!show)
{
delete mReset;
mReset = NULL;
}
}
setChildRects(LLRect(0, rect.getHeight(), rect.getWidth(), 0));
if (node->hasAttribute("name")) // Views can't have names, but drop targets can
{
@@ -134,9 +152,11 @@ void LLDropTarget::setControlName(const std::string& control_name, LLView* conte
if (control_name.empty()) // The "empty set"
{
mControl = NULL;
mConnection.disconnect();
return; // This DropTarget never changes text, it isn't tied to a control
}
bool none(true);
std::string text;
if (LLStartUp::getStartupState() != STATE_STARTED) // Too early for PerAccount
{
@@ -151,15 +171,40 @@ void LLDropTarget::setControlName(const std::string& control_name, LLView* conte
return; // Though this should never happen.
}
const LLUUID id(mControl->getValue().asString());
if (id.isNull())
none = id.isNull();
if (none)
text = LLTrans::getString("CurrentlyNotSet");
else if (LLViewerInventoryItem* item = gInventory.getItem(id))
text = currently_set_to(item);
else
text = LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount");
}
if (mControl)
mConnection = mControl->getSignal()->connect(boost::bind(&LLView::setValue, this, _2));
else
mConnection.disconnect();
mText->setText(text);
if (mReset) mReset->setVisible(!none);
}
void LLDropTarget::setChildRects(LLRect rect)
{
mBorder->setRect(rect);
if (mReset)
{
// Reset button takes rightmost part of the text area.
S32 height(rect.getHeight());
rect.mRight -= height;
mText->setRect(rect);
rect.mLeft = rect.mRight;
rect.mRight += height;
mReset->setRect(rect);
}
else
{
mText->setRect(rect);
}
}
void LLDropTarget::fillParent(const LLView* parent)
@@ -174,13 +219,33 @@ void LLDropTarget::fillParent(const LLView* parent)
}
// The following block enlarges the target, but maintains the desired size for the text and border
const LLRect& rect = getRect(); // Children maintain the old rectangle
mText->setRect(rect);
mBorder->setRect(rect);
setChildRects(getRect()); // Children maintain the old rectangle
const LLRect& parent_rect = parent->getRect();
setRect(LLRect(0, parent_rect.getHeight(), parent_rect.getWidth(), 0));
}
void LLDropTarget::setControlValue(const std::string& val)
{
if (mControl)
{
boost::signals2::shared_connection_block block(mConnection);
mControl->setValue(val);
}
}
void LLDropTarget::setItem(const LLInventoryItem* item)
{
if (mReset) mReset->setVisible(!!item);
mText->setText(currently_set_to(item));
setControlValue(item ? item->getUUID().asString() : "");
}
void LLDropTarget::setValue(const LLSD& value)
{
const LLUUID& id(value.asUUID());
setItem(id.isNull() ? NULL : gInventory.getItem(id));
}
void LLDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data)
{
llinfos << "LLDropTarget::doDrop()" << llendl;
@@ -188,23 +253,14 @@ void LLDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data)
BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg)
{
if (mEntityID.isNull())
if (mEntityID.notNull())
return getParent() ? LLToolDragAndDrop::handleGiveDragAndDrop(mEntityID, LLUUID::null, drop, cargo_type, cargo_data, accept) : false;
if (LLViewerInventoryItem* inv_item = static_cast<LLViewerInventoryItem*>(cargo_data))
{
if (LLViewerInventoryItem* inv_item = static_cast<LLViewerInventoryItem*>(cargo_data))
{
*accept = ACCEPT_YES_COPY_SINGLE;
if (drop)
{
mText->setText(currently_set_to(inv_item));
if (mControl) mControl->setValue(inv_item->getUUID().asString());
}
}
else
{
*accept = ACCEPT_NO;
}
return true;
*accept = ACCEPT_YES_COPY_SINGLE;
if (drop) setItem(inv_item);
}
return getParent() ? LLToolDragAndDrop::handleGiveDragAndDrop(mEntityID, LLUUID::null, drop, cargo_type, cargo_data, accept) : false;
return true;
}

View File

@@ -47,11 +47,13 @@ public:
Optional<bool> border_visible; // Whether or not to display the border
Optional<std::string> control_name; // Control to change on item drop (Per Account only)
Optional<std::string> label; // Label for the LLTextBox, used when label doesn't dynamically change on drop
Optional<bool> show_reset; // Whether or not to show the reset button
Optional<bool> fill_parent; // Whether or not to fill the direct parent, to have a larger drop target. If true, the next sibling must explicitly define its rect without deltas.
Params()
: border_visible("border_visible", true)
, control_name("control_name", "")
, label("label", "")
, show_reset("show_reset", true)
, fill_parent("fill_parent", false)
{
changeDefault(mouse_opaque, false);
@@ -69,16 +71,23 @@ public:
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg);
static LLView* fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory);
virtual void initFromXML(LLXMLNodePtr node, LLView* parent);
virtual void setControlName(const std::string& control, LLView* context);
virtual void setControlName(const std::string& control, LLView* context);
virtual void setValue(const LLSD& value);
void setChildRects(LLRect rect);
void fillParent(const LLView* parent);
void setEntityID(const LLUUID& id) { mEntityID = id;}
protected:
virtual void setItem(const class LLInventoryItem* item);
void setControlValue(const std::string& val);
LLUUID mEntityID;
private:
class LLViewBorder* mBorder;
LLControlVariable* mControl;
boost::signals2::scoped_connection mConnection;
class LLTextBox* mText;
class LLButton* mReset;
};
#endif // LLDROPTARGET_H

View File

@@ -102,7 +102,7 @@ LLFloaterRegionRestarting::LLFloaterRegionRestarting(const LLSD& key) :
{
//buildFromFile("floater_region_restarting.xml");
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_restarting.xml");
mName = key["NAME"].asString(); // <alchemy/>
mName = key.has("NAME") ? key["NAME"].asString() : gAgent.getRegion()->getName(); // <alchemy/>
center();
}

View File

@@ -547,6 +547,7 @@ void LLFloaterTools::refresh()
std::string value_string;
if ((prim_count == 1) && gSavedSettings.getBOOL("EditLinkedParts")) //Selecting a single prim in "Edit Linked" mode, show link number
{
link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost();
childSetTextArg("link_num_obj_count", "[DESC]", std::string("Link number:"));
LLViewerObject* selected = LLSelectMgr::getInstance()->getSelection()->getFirstObject();

View File

@@ -3103,7 +3103,7 @@ void LLFolderBridge::pasteFromClipboard(bool only_copies)
{
if (move_is_into_current_outfit || move_is_into_outfit)
{
if (can_move_to_outfit(item, move_is_into_current_outfit))
if (item && can_move_to_outfit(item, move_is_into_current_outfit))
{
dropToOutfit(item, move_is_into_current_outfit);
}

View File

@@ -245,9 +245,21 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType());
if (is_hidden_if_empty)
{
// Force the fetching of those folders so they are hidden iff they really are empty...
// Force the fetching of those folders so they are hidden if they really are empty...
gInventory.fetchDescendentsOf(object_id);
return FALSE;
LLInventoryModel::cat_array_t* cat_array = NULL;
LLInventoryModel::item_array_t* item_array = NULL;
gInventory.getDirectDescendentsOf(object_id,cat_array,item_array);
S32 descendents_actual = 0;
if (cat_array && item_array)
{
descendents_actual = cat_array->count() + item_array->count();
}
if (descendents_actual == 0)
{
return FALSE;
}
}
}
}

View File

@@ -876,7 +876,7 @@ bool LLFindWearablesEx::operator()(LLInventoryCategory* cat, LLInventoryItem* it
if (!vitem) return false;
// Skip non-wearables.
if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT)
if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT && vitem->getType() != LLAssetType::AT_GESTURE)
{
return false;
}

View File

@@ -71,7 +71,14 @@ const S32 NOTICE_DATE_STRING_SIZE = 30;
class LLGroupDropTarget : public LLDropTarget
{
public:
LLGroupDropTarget(const LLDropTarget::Params& p = LLDropTarget::Params());
struct Params : public LLInitParam::Block<Params, LLDropTarget::Params>
{
Params()
{
changeDefault(show_reset, false); // We have a button for this
}
};
LLGroupDropTarget(const Params& p = Params());
~LLGroupDropTarget() {};
//
@@ -92,14 +99,14 @@ protected:
LLPanelGroupNotices* mGroupNoticesPanel;
};
LLGroupDropTarget::LLGroupDropTarget(const LLDropTarget::Params& p)
LLGroupDropTarget::LLGroupDropTarget(const LLGroupDropTarget::Params& p)
: LLDropTarget(p)
{}
// static
LLView* LLGroupDropTarget::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory* factory)
{
LLGroupDropTarget* target = new LLGroupDropTarget();
LLGroupDropTarget* target = new LLGroupDropTarget;
target->initFromXML(node, parent);
return target;
}

View File

@@ -472,7 +472,11 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object)
case CLICK_ACTION_BUY:
if ( mClickActionBuyEnabled )
{
cursor = UI_CURSOR_TOOLBUY;
LLSelectNode* node = LLSelectMgr::getInstance()->getHoverNode();
if (!node || node->mSaleInfo.isForSale())
{
cursor = UI_CURSOR_TOOLBUY;
}
}
break;
case CLICK_ACTION_OPEN:
@@ -578,6 +582,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE);
LLViewerObject *parent = NULL;
LLViewerObject *object = mHoverPick.getObject();
LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace);
// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l
// Block all special click action cursors when:
// - @fartouch=n restricted and the object is out of range

View File

@@ -2818,24 +2818,27 @@ bool handle_go_to()
std::vector<std::string> strings;
std::string val;
LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal;
val = llformat("%g", pos.mdV[VX]);
val = llformat("%.9g", pos.mdV[VX]);
strings.push_back(val);
val = llformat("%g", pos.mdV[VY]);
val = llformat("%.9g", pos.mdV[VY]);
strings.push_back(val);
val = llformat("%g", pos.mdV[VZ]);
val = llformat("%.9g", pos.mdV[VZ]);
strings.push_back(val);
send_generic_message("autopilot", strings);
LLViewerParcelMgr::getInstance()->deselectLand();
if (isAgentAvatarValid() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
if (gSavedSettings.getBOOL("SinguMotionResetsCamera"))
{
gAgentCamera.setFocusGlobal(gAgentCamera.getFocusTargetGlobal(), gAgentAvatarp->getID());
}
else
{
// Snap camera back to behind avatar
gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE);
if (!gSavedSettings.getBOOL("AutoPilotLocksCamera"))
{
gAgentCamera.setFocusGlobal(gAgentCamera.getFocusTargetGlobal(), gAgentID);
}
else
{
// Snap camera back to behind avatar
gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE);
}
}
// Could be first use

View File

@@ -131,7 +131,7 @@
mouse_opaque="true" name="Give item:" v_pad="0" width="75">
Give item:
</text>
<drop_target bottom="-427" height="17" left_delta="79" width="321" fill_parent="true" name="drop_target_rect" label="Drop inventory item here." tool_tip="Drop inventory items here to give them to this person."/>
<drop_target bottom="-427" height="17" left_delta="79" width="321" fill_parent="true" show_reset="false" name="drop_target_rect" label="Drop inventory item here." tool_tip="Drop inventory items here to give them to this person."/>
<check_box bottom="-447" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" label="Show in search" left="75" mouse_opaque="true"
name="allow_publish"

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Animation Preview" title="">
<floater name="Animation Preview">
<text name="name_label">
Nome:
</text>
@@ -147,7 +147,7 @@ Raccomandiamo file di tipo BVH esportati da
Poser 4.
</text>
<button label="Annulla" name="cancel_btn"/>
<button label="Importa ([AMOUNT]L$)" name="ok_btn"/>
<button label="Importa ([UPLOADFEE])" name="ok_btn"/>
<string name="failed_to_initialize">
Impossibile inizializzare la sequenza
</string>

View File

@@ -468,5 +468,5 @@ In alternativa, puoi crearne una nuova da zero ed indossarla.
<scroll_container left="254" name="panel_container"/>
<button label="Annulla" label_selected="Annulla" name="Cancel"/>
<button label="OK" label_selected="OK" name="Ok"/>
<button label="Crea Outfit..." label_selected="Crea Outfit..." name="Make Outfit" left="122" />
<button label="Crea Outfit..." label_selected="Crea Outfit..." name="Make Outfit"/>
</floater>

View File

@@ -49,5 +49,5 @@ Prova a salvare in formato targa (.tga) a 24 bit.
</text>
<check_box label="Usa compressione ottimizzata" name="lossless_check"/>
<button label="Annulla" name="cancel_btn"/>
<button label="Carica ([AMOUNT] L$)" name="ok_btn"/>
<button label="Carica ([UPLOADFEE])" name="ok_btn"/>
</floater>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Name/Description" title="">
<floater name="Name/Description">
<text name="name_label">
Nome:
</text>
@@ -7,5 +7,5 @@
Descrizione:
</text>
<button label="Annulla" name="cancel_btn"/>
<button label="Carica ([AMOUNT] L$)" name="ok_btn"/>
<button label="Carica ([UPLOADFEE])" name="ok_btn"/>
</floater>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Sound Preview" title="sound.wav">
<floater name="Sound Preview">
<text name="name_label">
Nome:
</text>
@@ -7,5 +7,5 @@
Descrizione:
</text>
<button label="Annulla" label_selected="Annulla" name="cancel_btn"/>
<button label="Carica ([AMOUNT] L$)" label_selected="Carica ([AMOUNT] L$)" name="ok_btn"/>
<button label="Carica ([UPLOADFEE])" name="ok_btn"/>
</floater>