diff --git a/indra/newview/aixmllindengenepool.cpp b/indra/newview/aixmllindengenepool.cpp index b02d4b60d..cbb6659d9 100644 --- a/indra/newview/aixmllindengenepool.cpp +++ b/indra/newview/aixmllindengenepool.cpp @@ -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); } diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index 3f50e53b6..8862d1604 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -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; } diff --git a/indra/newview/importtracker.cpp b/indra/newview/importtracker.cpp index 4b8a7e843..bddbf790e 100644 --- a/indra/newview/importtracker.cpp +++ b/indra/newview/importtracker.cpp @@ -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; }*//* diff --git a/indra/newview/jcfloaterareasearch.cpp b/indra/newview/jcfloaterareasearch.cpp index 8b1ac9d77..3beacdf3d 100644 --- a/indra/newview/jcfloaterareasearch.cpp +++ b/indra/newview/jcfloaterareasearch.cpp @@ -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; diff --git a/indra/newview/lldroptarget.cpp b/indra/newview/lldroptarget.cpp index 9e7cc377e..f41d0681a 100644 --- a/indra/newview/lldroptarget.cpp +++ b/indra/newview/lldroptarget.cpp @@ -37,6 +37,9 @@ #include "lldroptarget.h" +#include + +#include "llbutton.h" #include "llinventorymodel.h" #include "llstartup.h" #include "lltextbox.h" @@ -46,8 +49,9 @@ static LLRegisterWidget 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(cargo_data)) { - if (LLViewerInventoryItem* inv_item = static_cast(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; } diff --git a/indra/newview/lldroptarget.h b/indra/newview/lldroptarget.h index 08026bd2a..69d9a6998 100644 --- a/indra/newview/lldroptarget.h +++ b/indra/newview/lldroptarget.h @@ -47,11 +47,13 @@ public: Optional border_visible; // Whether or not to display the border Optional control_name; // Control to change on item drop (Per Account only) Optional label; // Label for the LLTextBox, used when label doesn't dynamically change on drop + Optional show_reset; // Whether or not to show the reset button Optional 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 diff --git a/indra/newview/llfloaterregionrestarting.cpp b/indra/newview/llfloaterregionrestarting.cpp index 98406389b..448b85216 100644 --- a/indra/newview/llfloaterregionrestarting.cpp +++ b/indra/newview/llfloaterregionrestarting.cpp @@ -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(); // + mName = key.has("NAME") ? key["NAME"].asString() : gAgent.getRegion()->getName(); // center(); } diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 5f27490cc..e621a2e40 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -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(); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d06d823ca..17927a225 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -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); } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index ceabe493a..9118d9cd2 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -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; + } } } } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index fe77aa6c3..d7cab7920 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -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; } diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 40e450dd7..e6bfd0251 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -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() + { + 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; } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index fa74444ff..06509dc95 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -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 diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 2961a1745..0a57d3a1f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2818,24 +2818,27 @@ bool handle_go_to() std::vector 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 diff --git a/indra/newview/skins/default/xui/en-us/panel_avatar.xml b/indra/newview/skins/default/xui/en-us/panel_avatar.xml index 9c59c900e..84be27a55 100644 --- a/indra/newview/skins/default/xui/en-us/panel_avatar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_avatar.xml @@ -131,7 +131,7 @@ mouse_opaque="true" name="Give item:" v_pad="0" width="75"> Give item: - + - + Nome: @@ -147,7 +147,7 @@ Raccomandiamo file di tipo BVH esportati da Poser 4.