Conflicts:
	indra/llmessage/message_prehash.cpp
	indra/llmessage/message_prehash.h
This commit is contained in:
Siana Gearz
2011-10-14 02:44:20 +02:00
34 changed files with 3303 additions and 2968 deletions

View File

@@ -89,6 +89,7 @@ LLInventoryDictionary::LLInventoryDictionary()
addEntry(LLInventoryType::IT_WEARABLE, new InventoryEntry("wearable", "wearable", 2, LLAssetType::AT_CLOTHING, LLAssetType::AT_BODYPART)); addEntry(LLInventoryType::IT_WEARABLE, new InventoryEntry("wearable", "wearable", 2, LLAssetType::AT_CLOTHING, LLAssetType::AT_BODYPART));
addEntry(LLInventoryType::IT_ANIMATION, new InventoryEntry("animation", "animation", 1, LLAssetType::AT_ANIMATION)); addEntry(LLInventoryType::IT_ANIMATION, new InventoryEntry("animation", "animation", 1, LLAssetType::AT_ANIMATION));
addEntry(LLInventoryType::IT_GESTURE, new InventoryEntry("gesture", "gesture", 1, LLAssetType::AT_GESTURE)); addEntry(LLInventoryType::IT_GESTURE, new InventoryEntry("gesture", "gesture", 1, LLAssetType::AT_GESTURE));
addEntry(LLInventoryType::IT_MESH, new InventoryEntry("mesh", "mesh", 1, LLAssetType::AT_MESH));
} }
@@ -121,31 +122,33 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] =
LLInventoryType::IT_GESTURE, // AT_GESTURE LLInventoryType::IT_GESTURE, // AT_GESTURE
LLInventoryType::IT_NONE, // AT_SIMSTATE LLInventoryType::IT_NONE, // AT_SIMSTATE
LLInventoryType::IT_NONE, // AT_FAVORITE LLInventoryType::IT_NONE, // AT_FAVORITE
LLInventoryType::IT_NONE, // AT_LINK LLInventoryType::IT_NONE, // 24 AT_LINK_FOLDER
LLInventoryType::IT_NONE, // AT_LINK_FOLDER
/*LLInventoryType::IT_NONE, // FT_ENSEMBLE_START LLInventoryType::IT_NONE, // 25 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 26 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 27 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 28 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 29 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 30 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 31 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 32 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 33 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 34 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 35 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 36 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 37 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 38 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 39 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 40 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 41 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 42 AT_NONE
LLInventoryType::IT_NONE, // LLInventoryType::IT_NONE, // 43 AT_NONE
LLInventoryType::IT_NONE, // FT_ENSEMBLE_END LLInventoryType::IT_NONE, // 44 AT_NONE
LLInventoryType::IT_NONE, // AT_CURRENT_OUTFIT LLInventoryType::IT_NONE, // 45 AT_NONE
LLInventoryType::IT_NONE, // AT_OUTFIT LLInventoryType::IT_NONE, // 46 AT_NONE
LLInventoryType::IT_NONE // AT_MY_OUTFITS*/ LLInventoryType::IT_NONE, // 47 AT_NONE
LLInventoryType::IT_NONE, // 48 AT_NONE
LLInventoryType::IT_MESH // 49 AT_MESH
}; };
// static // static

View File

@@ -233,6 +233,11 @@ void LLParcel::init(const LLUUID &owner_id,
setPreviousOwnerID(LLUUID::null); setPreviousOwnerID(LLUUID::null);
setPreviouslyGroupOwned(FALSE); setPreviouslyGroupOwned(FALSE);
setSeeAVs(TRUE);
setAllowGroupAVSounds(TRUE);
setAllowAnyAVSounds(TRUE);
setHaveNewParcelLimitData(FALSE);
} }
void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned) void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned)
@@ -709,7 +714,9 @@ void LLParcel::packMessage(LLSD& msg)
msg["user_location"] = ll_sd_from_vector3(mUserLocation); msg["user_location"] = ll_sd_from_vector3(mUserLocation);
msg["user_look_at"] = ll_sd_from_vector3(mUserLookAt); msg["user_look_at"] = ll_sd_from_vector3(mUserLookAt);
msg["landing_type"] = (U8)mLandingType; msg["landing_type"] = (U8)mLandingType;
msg["see_avs"] = (LLSD::Boolean) getSeeAVs();
msg["group_av_sounds"] = (LLSD::Boolean) getAllowGroupAVSounds();
msg["any_av_sounds"] = (LLSD::Boolean) getAllowAnyAVSounds();
} }
@@ -728,6 +735,24 @@ void LLParcel::unpackMessage(LLMessageSystem* msg)
msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer ); msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer );
setMediaURL(buffer); setMediaURL(buffer);
BOOL see_avs = TRUE; // All default to true for legacy server behavior
BOOL any_av_sounds = TRUE;
BOOL group_av_sounds = TRUE;
bool have_new_parcel_limit_data = (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_SeeAVs) > 0); // New version of server should send all 3 of these values
have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_AnyAVSounds) > 0);
have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_GroupAVSounds) > 0);
if (have_new_parcel_limit_data)
{
msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_SeeAVs, see_avs);
msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_AnyAVSounds, any_av_sounds);
msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_GroupAVSounds, group_av_sounds);
}
setSeeAVs((bool) see_avs);
setAllowAnyAVSounds((bool) any_av_sounds);
setAllowGroupAVSounds((bool) group_av_sounds);
setHaveNewParcelLimitData(have_new_parcel_limit_data);
// non-optimized version // non-optimized version
msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale ); msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale );

View File

@@ -81,7 +81,7 @@ const U8 PARCEL_AUCTION = 0x05;
// unused 0x06 // unused 0x06
// unused 0x07 // unused 0x07
// flag, unused 0x08 // flag, unused 0x08
// flag, unused 0x10 const U8 PARCEL_HIDDENAVS = 0x10; // avatars not visible outside of parcel. Used for 'see avs' feature, but must be off for compatibility
const U8 PARCEL_SOUND_LOCAL = 0x20; const U8 PARCEL_SOUND_LOCAL = 0x20;
const U8 PARCEL_WEST_LINE = 0x40; // flag, property line on west edge const U8 PARCEL_WEST_LINE = 0x40; // flag, property line on west edge
const U8 PARCEL_SOUTH_LINE = 0x80; // flag, property line on south edge const U8 PARCEL_SOUTH_LINE = 0x80; // flag, property line on south edge
@@ -277,6 +277,8 @@ public:
void setUserLocation(const LLVector3& pos) { mUserLocation = pos; } void setUserLocation(const LLVector3& pos) { mUserLocation = pos; }
void setUserLookAt(const LLVector3& rot) { mUserLookAt = rot; } void setUserLookAt(const LLVector3& rot) { mUserLookAt = rot; }
void setLandingType(const ELandingType type) { mLandingType = type; } void setLandingType(const ELandingType type) { mLandingType = type; }
void setSeeAVs(BOOL see_avs) { mSeeAVs = see_avs; }
void setHaveNewParcelLimitData(bool have_new_parcel_data) { mHaveNewParcelLimitData = have_new_parcel_data; } // Remove this once hidden AV feature is fully available grid-wide
void setAuctionID(U32 auction_id) { mAuctionID = auction_id;} void setAuctionID(U32 auction_id) { mAuctionID = auction_id;}
@@ -303,6 +305,8 @@ public:
void setDenyAnonymous(BOOL b) { setParcelFlag(PF_DENY_ANONYMOUS, b); } void setDenyAnonymous(BOOL b) { setParcelFlag(PF_DENY_ANONYMOUS, b); }
void setDenyAgeUnverified(BOOL b) { setParcelFlag(PF_DENY_AGEUNVERIFIED, b); } void setDenyAgeUnverified(BOOL b) { setParcelFlag(PF_DENY_AGEUNVERIFIED, b); }
void setRestrictPushObject(BOOL b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); } void setRestrictPushObject(BOOL b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); }
void setAllowGroupAVSounds(BOOL b) { mAllowGroupAVSounds = b; }
void setAllowAnyAVSounds(BOOL b) { mAllowAnyAVSounds = b; }
void setDrawDistance(F32 dist) { mDrawDistance = dist; } void setDrawDistance(F32 dist) { mDrawDistance = dist; }
void setSalePrice(S32 price) { mSalePrice = price; } void setSalePrice(S32 price) { mSalePrice = price; }
@@ -379,6 +383,8 @@ public:
const LLVector3& getUserLocation() const { return mUserLocation; } const LLVector3& getUserLocation() const { return mUserLocation; }
const LLVector3& getUserLookAt() const { return mUserLookAt; } const LLVector3& getUserLookAt() const { return mUserLookAt; }
ELandingType getLandingType() const { return mLandingType; } ELandingType getLandingType() const { return mLandingType; }
BOOL getSeeAVs() const { return mSeeAVs; }
BOOL getHaveNewParcelLimitData() const { return mHaveNewParcelLimitData; }
// User-specified snapshot // User-specified snapshot
const LLUUID& getSnapshotID() const { return mSnapshotID; } const LLUUID& getSnapshotID() const { return mSnapshotID; }
@@ -508,6 +514,9 @@ public:
BOOL getRegionDenyAgeUnverifiedOverride() const BOOL getRegionDenyAgeUnverifiedOverride() const
{ return mRegionDenyAgeUnverifiedOverride; } { return mRegionDenyAgeUnverifiedOverride; }
BOOL getAllowGroupAVSounds() const { return mAllowGroupAVSounds; }
BOOL getAllowAnyAVSounds() const { return mAllowAnyAVSounds; }
F32 getDrawDistance() const { return mDrawDistance; } F32 getDrawDistance() const { return mDrawDistance; }
S32 getSalePrice() const { return mSalePrice; } S32 getSalePrice() const { return mSalePrice; }
time_t getClaimDate() const { return mClaimDate; } time_t getClaimDate() const { return mClaimDate; }
@@ -615,6 +624,8 @@ protected:
LLVector3 mUserLocation; LLVector3 mUserLocation;
LLVector3 mUserLookAt; LLVector3 mUserLookAt;
ELandingType mLandingType; ELandingType mLandingType;
BOOL mSeeAVs; // Avatars on this parcel are visible from outside it
BOOL mHaveNewParcelLimitData; // Remove once hidden AV feature is grid-wide
LLTimer mSaleTimerExpires; LLTimer mSaleTimerExpires;
LLTimer mMediaResetTimer; LLTimer mMediaResetTimer;
@@ -670,6 +681,9 @@ protected:
BOOL mRegionPushOverride; BOOL mRegionPushOverride;
BOOL mRegionDenyAnonymousOverride; BOOL mRegionDenyAnonymousOverride;
BOOL mRegionDenyAgeUnverifiedOverride; BOOL mRegionDenyAgeUnverifiedOverride;
BOOL mAllowGroupAVSounds;
BOOL mAllowAnyAVSounds;
public: public:
// HACK, make private // HACK, make private

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -196,7 +196,7 @@ void invrepair()
LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryCategory::cat_array_t cats;
LLViewerInventoryItem::item_array_t items; LLViewerInventoryItem::item_array_t items;
//ObjectContentNameMatches objectnamematches(ifolder); //ObjectContentNameMatches objectnamematches(ifolder);
gInventory.collectDescendents(gAgent.getInventoryRootID(),cats,items,FALSE);//,objectnamematches); gInventory.collectDescendents(gInventory.getRootFolderID(),cats,items,FALSE);//,objectnamematches);
} }

View File

@@ -835,15 +835,12 @@ private:
** Depreciated stuff. Move when ready. ** Depreciated stuff. Move when ready.
**/ **/
public: public:
const LLUUID& getInventoryRootID() const { return mInventoryRootID; }
void setInventoryRootID(const LLUUID &id) { mInventoryRootID = id; }
//What's this t-posed stuff from? //What's this t-posed stuff from?
static BOOL isTPosed() { return mForceTPose; } static BOOL isTPosed() { return mForceTPose; }
static void setTPosed(BOOL TPose) { mForceTPose = TPose; } static void setTPosed(BOOL TPose) { mForceTPose = TPose; }
static void toggleTPosed(); static void toggleTPosed();
private: private:
LLUUID mInventoryRootID;
static BOOL mForceTPose; static BOOL mForceTPose;

View File

@@ -276,8 +276,6 @@ LLTimer gLogoutTimer;
static const F32 LOGOUT_REQUEST_TIME = 6.f; // this will be cut short by the LogoutReply msg. static const F32 LOGOUT_REQUEST_TIME = 6.f; // this will be cut short by the LogoutReply msg.
F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME; F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME;
LLUUID gInventoryLibraryOwner;
LLUUID gInventoryLibraryRoot;
// <edit> // <edit>
LLUUID gSystemFolderRoot; LLUUID gSystemFolderRoot;
LLUUID gSystemFolderSettings; LLUUID gSystemFolderSettings;
@@ -333,6 +331,40 @@ static std::string gLaunchFileOnQuit;
// Used on Win32 for other apps to identify our window (eg, win_setup) // Used on Win32 for other apps to identify our window (eg, win_setup)
const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; // Don't change const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; // Don't change
//-- LLDeferredTaskList ------------------------------------------------------
/**
* A list of deferred tasks.
*
* We sometimes need to defer execution of some code until the viewer gets idle,
* e.g. removing an inventory item from within notifyObservers() may not work out.
*
* Tasks added to this list will be executed in the next LLAppViewer::idle() iteration.
* All tasks are executed only once.
*/
class LLDeferredTaskList: public LLSingleton<LLDeferredTaskList>
{
LOG_CLASS(LLDeferredTaskList);
friend class LLAppViewer;
typedef boost::signals2::signal<void()> signal_t;
void addTask(const signal_t::slot_type& cb)
{
mSignal.connect(cb);
}
void run()
{
if (!mSignal.empty())
{
mSignal();
mSignal.disconnect_all_slots();
}
}
signal_t mSignal;
};
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// File scope definitons // File scope definitons
const char *VFS_DATA_FILE_BASE = "data.db2.x."; const char *VFS_DATA_FILE_BASE = "data.db2.x.";
@@ -1357,6 +1389,11 @@ bool LLAppViewer::cleanup()
if( gViewerWindow) if( gViewerWindow)
gViewerWindow->shutdownViews(); gViewerWindow->shutdownViews();
llinfos << "Cleaning up Inventory" << llendflush;
// Cleanup Inventory after the UI since it will delete any remaining observers
// (Deleted observers should have already removed themselves)
gInventory.cleanupInventory();
llinfos << "Cleaning up Selections" << llendflush; llinfos << "Cleaning up Selections" << llendflush;
@@ -3345,6 +3382,11 @@ bool LLAppViewer::initCache()
} }
} }
void LLAppViewer::addOnIdleCallback(const boost::function<void()>& cb)
{
LLDeferredTaskList::instance().addTask(cb);
}
void LLAppViewer::purgeCache() void LLAppViewer::purgeCache()
{ {
LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << llendl; LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << llendl;
@@ -3930,6 +3972,9 @@ void LLAppViewer::idle()
} }
} }
// Execute deferred tasks.
LLDeferredTaskList::instance().run();
// Handle shutdown process, for example, // Handle shutdown process, for example,
// wait for floaters to close, send quit message, // wait for floaters to close, send quit message,
// forcibly quit if it has taken too long // forcibly quit if it has taken too long
@@ -4289,10 +4334,13 @@ void LLAppViewer::disconnectViewer()
if (!gNoRender) if (!gNoRender)
{ {
// save inventory if appropriate // save inventory if appropriate
gInventory.cache(gAgent.getInventoryRootID(), gAgent.getID()); gInventory.cache(gInventory.getRootFolderID(), gAgent.getID());
if(gInventoryLibraryRoot.notNull() && gInventoryLibraryOwner.notNull()) if (gInventory.getLibraryRootFolderID().notNull()
&& gInventory.getLibraryOwnerID().notNull())
{ {
gInventory.cache(gInventoryLibraryRoot, gInventoryLibraryOwner); gInventory.cache(
gInventory.getLibraryRootFolderID(),
gInventory.getLibraryOwnerID());
} }
} }

View File

@@ -158,6 +158,9 @@ public:
// *NOTE:Mani Fix this for login abstraction!! // *NOTE:Mani Fix this for login abstraction!!
void handleLoginComplete(); void handleLoginComplete();
void addOnIdleCallback(const boost::function<void()>& cb); // add a callback to fire (once) when idle
void purgeCache(); // Clear the local cache.
protected: protected:
virtual bool initWindow(); // Initialize the viewer's window. virtual bool initWindow(); // Initialize the viewer's window.
virtual bool initLogging(); // Initialize log files, logging system, return false on failure. virtual bool initLogging(); // Initialize log files, logging system, return false on failure.
@@ -178,7 +181,6 @@ private:
bool initConfiguration(); // Initialize settings from the command line/config file. bool initConfiguration(); // Initialize settings from the command line/config file.
bool initCache(); // Initialize local client cache. bool initCache(); // Initialize local client cache.
void purgeCache(); // Clear the local cache.
// We have switched locations of both Mac and Windows cache, make sure // We have switched locations of both Mac and Windows cache, make sure
// files migrate and old cache is cleared out. // files migrate and old cache is cleared out.
@@ -311,8 +313,6 @@ extern LLTimer gLogoutTimer;
extern F32 gSimLastTime; extern F32 gSimLastTime;
extern F32 gSimFrames; extern F32 gSimFrames;
extern LLUUID gInventoryLibraryOwner;
extern LLUUID gInventoryLibraryRoot;
// <edit> // <edit>
extern LLUUID gSystemFolderRoot; extern LLUUID gSystemFolderRoot;
extern LLUUID gSystemFolderSettings; extern LLUUID gSystemFolderSettings;

View File

@@ -97,6 +97,7 @@ static std::string OWNER_INSIM = "4";
// constants used in callbacks below - syntactic sugar. // constants used in callbacks below - syntactic sugar.
static const BOOL BUY_GROUP_LAND = TRUE; static const BOOL BUY_GROUP_LAND = TRUE;
static const BOOL BUY_PERSONAL_LAND = FALSE; static const BOOL BUY_PERSONAL_LAND = FALSE;
LLPointer<LLParcelSelection> LLPanelLandGeneral::sSelectionForBuyPass = NULL;
// Statics // Statics
LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL; LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL;
@@ -156,6 +157,10 @@ void send_parcel_select_objects(S32 parcel_local_id, U32 return_type,
msg->sendReliable(region->getHost()); msg->sendReliable(region->getHost());
} }
LLParcel* LLFloaterLand::getCurrentSelectedParcel()
{
return mParcel->getParcel();
};
//static //static
LLPanelLandObjects* LLFloaterLand::getCurrentPanelLandObjects() LLPanelLandObjects* LLFloaterLand::getCurrentPanelLandObjects()
@@ -177,6 +182,13 @@ void LLFloaterLand::refreshAll()
void LLFloaterLand::onOpen() void LLFloaterLand::onOpen()
{ {
// moved from triggering show instance in llviwermenu.cpp
if (LLViewerParcelMgr::getInstance()->selectionEmpty())
{
LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
}
// Done automatically when the selected parcel's properties arrive // Done automatically when the selected parcel's properties arrive
// (and hence we have the local id). // (and hence we have the local id).
// LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN | AL_RENTER); // LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN | AL_RENTER);
@@ -192,10 +204,6 @@ void LLFloaterLand::onOpen()
// virtual // virtual
void LLFloaterLand::onClose(bool app_quitting) void LLFloaterLand::onClose(bool app_quitting)
{ {
LLViewerParcelMgr::getInstance()->removeObserver( sObserver );
delete sObserver;
sObserver = NULL;
// Might have been showing owned objects // Might have been showing owned objects
LLSelectMgr::getInstance()->unhighlightAll(); LLSelectMgr::getInstance()->unhighlightAll();
@@ -244,6 +252,9 @@ BOOL LLFloaterLand::postBuild()
// virtual // virtual
LLFloaterLand::~LLFloaterLand() LLFloaterLand::~LLFloaterLand()
{ {
LLViewerParcelMgr::getInstance()->removeObserver( sObserver );
delete sObserver;
sObserver = NULL;
} }
// public // public
@@ -255,6 +266,7 @@ void LLFloaterLand::refresh()
mPanelAudio->refresh(); mPanelAudio->refresh();
mPanelMedia->refresh(); mPanelMedia->refresh();
mPanelAccess->refresh(); mPanelAccess->refresh();
mPanelCovenant->refresh();
} }
@@ -421,7 +433,7 @@ BOOL LLPanelLandGeneral::postBuild()
mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL); mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL);
mBtnStartAuction = getChild<LLButton>("Linden Sale..."); mBtnStartAuction = getChild<LLButton>("Linden Sale...");
mBtnStartAuction->setClickedCallback(onClickStartAuction, NULL); mBtnStartAuction->setClickedCallback(onClickStartAuction, this);
return TRUE; return TRUE;
} }
@@ -678,7 +690,8 @@ void LLPanelLandGeneral::refresh()
cost_per_sqm = (F32)parcel->getSalePrice() / (F32)area; cost_per_sqm = (F32)parcel->getSalePrice() / (F32)area;
} }
mSaleInfoForSale1->setTextArg("[PRICE]", llformat("%d", parcel->getSalePrice())); S32 price = parcel->getSalePrice();
mSaleInfoForSale1->setTextArg("[PRICE]", LLResMgr::getInstance()->getMonetaryString(price));
mSaleInfoForSale1->setTextArg("[PRICE_PER_SQM]", llformat("%.1f", cost_per_sqm)); mSaleInfoForSale1->setTextArg("[PRICE_PER_SQM]", llformat("%.1f", cost_per_sqm));
if (can_be_sold) if (can_be_sold)
{ {
@@ -732,6 +745,7 @@ void LLPanelLandGeneral::refreshNames()
if (!parcel) if (!parcel)
{ {
mTextOwner->setText(LLStringUtil::null); mTextOwner->setText(LLStringUtil::null);
mTextGroup->setText(LLStringUtil::null);
return; return;
} }
@@ -759,16 +773,19 @@ void LLPanelLandGeneral::refreshNames()
} }
mTextGroup->setText(group); mTextGroup->setText(group);
const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID(); if (parcel->getForSale())
if(auth_buyer_id.notNull())
{ {
std::string name; const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID();
gCacheName->getFullName(auth_buyer_id, name); if(auth_buyer_id.notNull())
mSaleInfoForSale2->setTextArg("[BUYER]", name); {
} std::string name;
else gCacheName->getFullName(auth_buyer_id, name);
{ mSaleInfoForSale2->setTextArg("[BUYER]", name);
mSaleInfoForSale2->setTextArg("[BUYER]", getString("anyone")); }
else
{
mSaleInfoForSale2->setTextArg("[BUYER]", getString("anyone"));
}
} }
} }
@@ -776,7 +793,7 @@ void LLPanelLandGeneral::refreshNames()
// virtual // virtual
void LLPanelLandGeneral::draw() void LLPanelLandGeneral::draw()
{ {
refreshNames(); //refreshNames();
LLPanel::draw(); LLPanel::draw();
} }
@@ -933,6 +950,8 @@ void LLPanelLandGeneral::onClickBuyPass(void* data)
args["PARCEL_NAME"] = parcel_name; args["PARCEL_NAME"] = parcel_name;
args["TIME"] = time; args["TIME"] = time;
// creating pointer on selection to avoid deselection of parcel until we are done with buying pass (EXT-6464)
sSelectionForBuyPass = LLViewerParcelMgr::getInstance()->getParcelSelection();
LLNotificationsUtil::add("LandBuyPass", args, LLSD(), cbBuyPass); LLNotificationsUtil::add("LandBuyPass", args, LLSD(), cbBuyPass);
} }
@@ -963,6 +982,8 @@ bool LLPanelLandGeneral::cbBuyPass(const LLSD& notification, const LLSD& respons
// User clicked OK // User clicked OK
LLViewerParcelMgr::getInstance()->buyPass(); LLViewerParcelMgr::getInstance()->buyPass();
} }
// we are done with buying pass, additional selection is no longer needed
sSelectionForBuyPass = NULL;
return false; return false;
} }
@@ -1023,7 +1044,30 @@ void LLPanelLandGeneral::onClickStopSellLand(void* data)
// LLPanelLandObjects // LLPanelLandObjects
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel)
: LLPanel(std::string("land_objects_panel")), mParcel(parcel) : LLPanel(std::string("land_objects_panel")),
mParcel(parcel),
mParcelObjectBonus(NULL),
mSWTotalObjects(NULL),
mObjectContribution(NULL),
mTotalObjects(NULL),
mOwnerObjects(NULL),
mBtnShowOwnerObjects(NULL),
mBtnReturnOwnerObjects(NULL),
mGroupObjects(NULL),
mBtnShowGroupObjects(NULL),
mBtnReturnGroupObjects(NULL),
mOtherObjects(NULL),
mBtnShowOtherObjects(NULL),
mBtnReturnOtherObjects(NULL),
mSelectedObjects(NULL),
mCleanOtherObjectsTime(NULL),
mOtherTime(0),
mBtnRefresh(NULL),
mBtnReturnOwnerList(NULL),
mOwnerList(NULL),
mFirstReply(TRUE),
mSelectedCount(0),
mSelectedIsGroup(FALSE)
{ {
} }
@@ -1779,8 +1823,9 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel)
mClearBtn(NULL), mClearBtn(NULL),
mMatureCtrl(NULL), mMatureCtrl(NULL),
mPushRestrictionCtrl(NULL), mPushRestrictionCtrl(NULL),
mPublishHelpButton(NULL), mSeeAvatarsCtrl(NULL),
mParcel(parcel) mParcel(parcel),
mPublishHelpButton(NULL)
{ {
} }
@@ -1826,6 +1871,9 @@ BOOL LLPanelLandOptions::postBuild()
mPushRestrictionCtrl = getChild<LLCheckBoxCtrl>( "PushRestrictCheck"); mPushRestrictionCtrl = getChild<LLCheckBoxCtrl>( "PushRestrictCheck");
childSetCommitCallback("PushRestrictCheck", onCommitAny, this); childSetCommitCallback("PushRestrictCheck", onCommitAny, this);
mSeeAvatarsCtrl = getChild<LLCheckBoxCtrl>( "SeeAvatarsCheck");
childSetCommitCallback("SeeAvatarsCheck", onCommitAny, this);
mCheckShowDirectory = getChild<LLCheckBoxCtrl>( "ShowDirectoryCheck"); mCheckShowDirectory = getChild<LLCheckBoxCtrl>( "ShowDirectoryCheck");
childSetCommitCallback("ShowDirectoryCheck", onCommitAny, this); childSetCommitCallback("ShowDirectoryCheck", onCommitAny, this);
@@ -1945,6 +1993,9 @@ void LLPanelLandOptions::refresh()
mPushRestrictionCtrl->set(FALSE); mPushRestrictionCtrl->set(FALSE);
mPushRestrictionCtrl->setEnabled(FALSE); mPushRestrictionCtrl->setEnabled(FALSE);
mSeeAvatarsCtrl->set(TRUE);
mSeeAvatarsCtrl->setEnabled(FALSE);
mLandingTypeCombo->setCurrentByIndex(0); mLandingTypeCombo->setCurrentByIndex(0);
mLandingTypeCombo->setEnabled(FALSE); mLandingTypeCombo->setEnabled(FALSE);
@@ -2008,6 +2059,10 @@ void LLPanelLandOptions::refresh()
mPushRestrictionCtrl->setEnabled(can_change_options); mPushRestrictionCtrl->setEnabled(can_change_options);
} }
mSeeAvatarsCtrl->set(parcel->getSeeAVs());
mSeeAvatarsCtrl->setLabel(getString("see_avs_text"));
mSeeAvatarsCtrl->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData());
BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel,
GP_LAND_SET_LANDING_POINT); GP_LAND_SET_LANDING_POINT);
mLandingTypeCombo->setCurrentByIndex((S32)parcel->getLandingType()); mLandingTypeCombo->setCurrentByIndex((S32)parcel->getLandingType());
@@ -2210,6 +2265,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
BOOL allow_publish = FALSE; BOOL allow_publish = FALSE;
BOOL mature_publish = self->mMatureCtrl->get(); BOOL mature_publish = self->mMatureCtrl->get();
BOOL push_restriction = self->mPushRestrictionCtrl->get(); BOOL push_restriction = self->mPushRestrictionCtrl->get();
BOOL see_avs = self->mSeeAvatarsCtrl->get();
BOOL show_directory = self->mCheckShowDirectory->get(); BOOL show_directory = self->mCheckShowDirectory->get();
// we have to get the index from a lookup, not from the position in the dropdown! // we have to get the index from a lookup, not from the position in the dropdown!
S32 category_index = LLParcel::getCategoryFromString(self->mCategoryCombo->getSelectedValue()); S32 category_index = LLParcel::getCategoryFromString(self->mCategoryCombo->getSelectedValue());
@@ -2243,6 +2299,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
parcel->setCategory((LLParcel::ECategory)category_index); parcel->setCategory((LLParcel::ECategory)category_index);
parcel->setLandingType((LLParcel::ELandingType)landing_type_index); parcel->setLandingType((LLParcel::ELandingType)landing_type_index);
parcel->setSnapshotID(snapshot_id); parcel->setSnapshotID(snapshot_id);
parcel->setSeeAVs(see_avs);
// Send current parcel data upstream to server // Send current parcel data upstream to server
LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );
@@ -2323,7 +2380,8 @@ void LLPanelLandOptions::onClickPublishHelp(void*)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel)
: LLPanel(std::string("land_access_panel")), mParcel(parcel) : LLPanel(std::string("land_access_panel")),
mParcel(parcel)
{ {
} }
@@ -2820,7 +2878,8 @@ void LLPanelLandAccess::onClickRemoveBanned(void* data)
// LLPanelLandCovenant // LLPanelLandCovenant
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
LLPanelLandCovenant::LLPanelLandCovenant(LLParcelSelectionHandle& parcel) LLPanelLandCovenant::LLPanelLandCovenant(LLParcelSelectionHandle& parcel)
: LLPanel(std::string("land_covenant_panel")), mParcel(parcel) : LLPanel(std::string("land_covenant_panel")),
mParcel(parcel)
{ {
} }

View File

@@ -38,8 +38,9 @@
#include <vector> #include <vector>
#include "llfloater.h" #include "llfloater.h"
#include "llpointer.h" // LLPointer<>
//#include "llviewertexturelist.h" //#include "llviewertexturelist.h"
#include "llmemory.h" // LLPointer<> #include "llsafehandle.h"
typedef std::set<LLUUID, lluuid_less> uuid_list_t; typedef std::set<LLUUID, lluuid_less> uuid_list_t;
const F32 CACHE_REFRESH_TIME = 2.5f; const F32 CACHE_REFRESH_TIME = 2.5f;
@@ -70,6 +71,7 @@ class LLPanelLandAccess;
class LLPanelLandBan; class LLPanelLandBan;
class LLPanelLandRenters; class LLPanelLandRenters;
class LLPanelLandCovenant; class LLPanelLandCovenant;
class LLParcel;
class LLFloaterLand class LLFloaterLand
: public LLFloater, public LLFloaterSingleton<LLFloaterLand> : public LLFloater, public LLFloaterSingleton<LLFloaterLand>
@@ -81,6 +83,8 @@ public:
static LLPanelLandObjects* getCurrentPanelLandObjects(); static LLPanelLandObjects* getCurrentPanelLandObjects();
static LLPanelLandCovenant* getCurrentPanelLandCovenant(); static LLPanelLandCovenant* getCurrentPanelLandCovenant();
LLParcel* getCurrentSelectedParcel();
// Destroys itself on close. // Destroys itself on close.
virtual void onClose(bool app_quitting); virtual void onClose(bool app_quitting);
virtual void onOpen(); virtual void onOpen();
@@ -235,6 +239,11 @@ protected:
LLSafeHandle<LLParcelSelection>& mParcel; LLSafeHandle<LLParcelSelection>& mParcel;
// This pointer is needed to avoid parcel deselection until buying pass is completed or canceled.
// Deselection happened because of zero references to parcel selection, which took place when
// "Buy Pass" was called from popup menu(EXT-6464)
static LLPointer<LLParcelSelection> sSelectionForBuyPass;
static LLHandle<LLFloater> sBuyPassDialogHandle; static LLHandle<LLFloater> sBuyPassDialogHandle;
}; };
@@ -353,6 +362,7 @@ private:
LLCheckBoxCtrl *mMatureCtrl; LLCheckBoxCtrl *mMatureCtrl;
LLCheckBoxCtrl *mPushRestrictionCtrl; LLCheckBoxCtrl *mPushRestrictionCtrl;
LLCheckBoxCtrl *mSeeAvatarsCtrl;
LLButton *mPublishHelpButton; LLButton *mPublishHelpButton;
LLSafeHandle<LLParcelSelection>& mParcel; LLSafeHandle<LLParcelSelection>& mParcel;

View File

@@ -192,7 +192,7 @@ BOOL LLFloaterLandmark::handleKeyHere(KEY key, MASK mask)
{ {
if (!root_folder->getCurSelectedItem()) if (!root_folder->getCurSelectedItem())
{ {
LLFolderViewItem* itemp = root_folder->getItemByID(gAgent.getInventoryRootID()); LLFolderViewItem* itemp = root_folder->getItemByID(gInventory.getRootFolderID());
if (itemp) if (itemp)
{ {
root_folder->setSelection(itemp, FALSE, FALSE); root_folder->setSelection(itemp, FALSE, FALSE);

View File

@@ -154,7 +154,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
} }
else else
{ {
parent_category_id = gAgent.getInventoryRootID(); parent_category_id = gInventory.getRootFolderID();
} }
LLUUID category_id = gInventory.createNewCategory(parent_category_id, LLUUID category_id = gInventory.createNewCategory(parent_category_id,
LLFolderType::FT_NONE, LLFolderType::FT_NONE,

View File

@@ -929,7 +929,7 @@ void LLFloaterWorldMap::buildLandmarkIDLists()
LLInventoryModel::cat_array_t cats; LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items; LLInventoryModel::item_array_t items;
LLIsType is_landmark(LLAssetType::AT_LANDMARK); LLIsType is_landmark(LLAssetType::AT_LANDMARK);
gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
cats, cats,
items, items,
LLInventoryModel::EXCLUDE_TRASH, LLInventoryModel::EXCLUDE_TRASH,

View File

@@ -736,11 +736,11 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
// *TODO: push this into listener and remove // *TODO: push this into listener and remove
// dependency on llagent // dependency on llagent
if(mListener && gInventory.isObjectDescendentOf(mListener->getUUID(), gAgent.getInventoryRootID())) if(mListener && gInventory.isObjectDescendentOf(mListener->getUUID(), gInventory.getRootFolderID()))
{ {
src = LLToolDragAndDrop::SOURCE_AGENT; src = LLToolDragAndDrop::SOURCE_AGENT;
} }
else if (mListener && gInventory.isObjectDescendentOf(mListener->getUUID(), gInventoryLibraryRoot)) else if (mListener && gInventory.isObjectDescendentOf(mListener->getUUID(), gInventory.getLibraryRootFolderID()))
{ {
src = LLToolDragAndDrop::SOURCE_LIBRARY; src = LLToolDragAndDrop::SOURCE_LIBRARY;
} }
@@ -2793,7 +2793,7 @@ U32 LLFolderView::getSearchType() const
BOOL LLFolderView::addFolder( LLFolderViewFolder* folder) BOOL LLFolderView::addFolder( LLFolderViewFolder* folder)
{ {
// enforce sort order of My Inventory followed by Library // enforce sort order of My Inventory followed by Library
if (folder->getListener()->getUUID() == gInventoryLibraryRoot) if (folder->getListener()->getUUID() == gInventory.getLibraryRootFolderID())
{ {
mFolders.push_back(folder); mFolders.push_back(folder);
} }
@@ -3203,7 +3203,7 @@ void LLFolderView::sanitizeSelection()
else else
{ {
// nothing selected to start with, so pick "My Inventory" as best guess // nothing selected to start with, so pick "My Inventory" as best guess
new_selection = getItemByID(gAgent.getInventoryRootID()); new_selection = getItemByID(gInventory.getRootFolderID());
} }
if (new_selection) if (new_selection)

View File

@@ -357,7 +357,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
} }
else else
{ {
category = model->createNewCategory(gAgent.getInventoryRootID(), category = model->createNewCategory(gInventory.getRootFolderID(),
LLFolderType::FT_NONE, LLStringUtil::null); LLFolderType::FT_NONE, LLStringUtil::null);
} }
model->notifyObservers(); model->notifyObservers();
@@ -679,7 +679,7 @@ class LLAttachObject : public inventory_panel_listener_t
} }
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(id); LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(id);
if(item && gInventory.isObjectDescendentOf(id, gAgent.getInventoryRootID())) if(item && gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID()))
{ {
rez_attachment(item, attachmentp); rez_attachment(item, attachmentp);
} }

View File

@@ -321,7 +321,7 @@ BOOL LLInvFVBridge::isItemRemovable()
{ {
return TRUE; return TRUE;
} }
if(model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID())) if(model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID()))
{ {
return TRUE; return TRUE;
} }
@@ -938,8 +938,8 @@ BOOL LLInvFVBridge::isAgentInventory() const
{ {
const LLInventoryModel* model = getInventoryModel(); const LLInventoryModel* model = getInventoryModel();
if(!model) return FALSE; if(!model) return FALSE;
if(gAgent.getInventoryRootID() == mUUID) return TRUE; if(gInventory.getRootFolderID() == mUUID) return TRUE;
return model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID()); return model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID());
} }
BOOL LLInvFVBridge::isCOFFolder() const BOOL LLInvFVBridge::isCOFFolder() const
@@ -959,7 +959,7 @@ void LLInvFVBridge::changeItemParent(LLInventoryModel* model,
BOOL restamp) BOOL restamp)
{ {
// <edit> // <edit>
bool send_parent_update = gInventory.isObjectDescendentOf(item->getUUID(), gAgent.getInventoryRootID()); bool send_parent_update = gInventory.isObjectDescendentOf(item->getUUID(), gInventory.getRootFolderID());
// </edit> // </edit>
if(item->getParentUUID() != new_parent_id) if(item->getParentUUID() != new_parent_id)
{ {
@@ -1643,11 +1643,11 @@ BOOL LLFolderBridge::isItemRemovable()
// <edit> // <edit>
// People delete their inventory easily... // People delete their inventory easily...
if(mUUID == gAgent.getInventoryRootID()) if(mUUID == gInventory.getRootFolderID())
{ {
return FALSE; return FALSE;
} }
if(!model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID())) if(!model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID()))
{ {
return FALSE; return FALSE;
} }
@@ -4043,7 +4043,7 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model
LLUUID object_id = mUUID; LLUUID object_id = mUUID;
LLViewerInventoryItem* item; LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gInventory.getItem(object_id); item = (LLViewerInventoryItem*)gInventory.getItem(object_id);
if(item && gInventory.isObjectDescendentOf(object_id, gAgent.getInventoryRootID())) if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID()))
{ {
rez_attachment(item, NULL, replace); rez_attachment(item, NULL, replace);
} }
@@ -4635,7 +4635,7 @@ void LLOutfitObserver::done()
} }
if(pid.isNull()) if(pid.isNull())
{ {
pid = gAgent.getInventoryRootID(); pid = gInventory.getRootFolderID();
} }
LLUUID cat_id = gInventory.createNewCategory( LLUUID cat_id = gInventory.createNewCategory(
@@ -4742,7 +4742,7 @@ void wear_outfit_by_name(const std::string& name)
LLInventoryModel::cat_array_t cat_array; LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array; LLInventoryModel::item_array_t item_array;
LLNameCategoryCollector has_name(name); LLNameCategoryCollector has_name(name);
gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
cat_array, cat_array,
item_array, item_array,
LLInventoryModel::EXCLUDE_TRASH, LLInventoryModel::EXCLUDE_TRASH,

View File

@@ -432,29 +432,15 @@ void LLInventoryModel::unlockDirectDescendentArrays(const LLUUID& cat_id)
// not necessarily only for that type. *NOTE: This will create a new // not necessarily only for that type. *NOTE: This will create a new
// inventory category on the fly if one does not exist. // inventory category on the fly if one does not exist.
const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type,
bool create_folder//, bool create_folder,
/*bool find_in_library*/) bool find_in_library)
{ {
LLUUID rv = findCatUUID(preferred_type); LLUUID rv = LLUUID::null;
if(rv.isNull() && isInventoryUsable() && create_folder)
{
LLUUID root_id = gAgent.getInventoryRootID();
if(root_id.notNull())
{
rv = createNewCategory(root_id, preferred_type, LLStringUtil::null);
}
}
return rv;
}
// Internal method which looks for a category with the specified const LLUUID &root_id = (find_in_library) ? gInventory.getLibraryRootFolderID() : gInventory.getRootFolderID();
// preferred type. Returns LLUUID::null if not found.
LLUUID LLInventoryModel::findCatUUID(LLFolderType::EType preferred_type)
{
const LLUUID &root_id = gAgent.getInventoryRootID();
if(LLFolderType::FT_ROOT_INVENTORY == preferred_type) if(LLFolderType::FT_ROOT_INVENTORY == preferred_type)
{ {
return root_id; rv = root_id;
} }
else if (root_id.notNull()) else if (root_id.notNull())
{ {
@@ -467,17 +453,26 @@ LLUUID LLInventoryModel::findCatUUID(LLFolderType::EType preferred_type)
{ {
if(cats->get(i)->getPreferredType() == preferred_type) if(cats->get(i)->getPreferredType() == preferred_type)
{ {
return cats->get(i)->getUUID(); rv = cats->get(i)->getUUID();
break;
} }
} }
} }
} }
return LLUUID::null;
if(rv.isNull() && isInventoryUsable() && (create_folder && !find_in_library))
{
if(root_id.notNull())
{
return createNewCategory(root_id, preferred_type, LLStringUtil::null);
}
}
return rv;
} }
LLUUID LLInventoryModel::findCategoryByName(std::string name) LLUUID LLInventoryModel::findCategoryByName(std::string name)
{ {
LLUUID root_id = gAgent.getInventoryRootID(); LLUUID root_id = gInventory.getRootFolderID();
if(root_id.notNull()) if(root_id.notNull())
{ {
cat_array_t* cats = NULL; cat_array_t* cats = NULL;
@@ -674,7 +669,7 @@ void LLInventoryModel::addChangedMaskForLinks(const LLUUID& object_id, U32 mask)
LLInventoryModel::cat_array_t cat_array; LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array; LLInventoryModel::item_array_t item_array;
LLLinkedItemIDMatches is_linked_item_match(object_id); LLLinkedItemIDMatches is_linked_item_match(object_id);
collectDescendentsIf(gAgent.getInventoryRootID(), collectDescendentsIf(gInventory.getRootFolderID(),
cat_array, cat_array,
item_array, item_array,
LLInventoryModel::INCLUDE_TRASH, LLInventoryModel::INCLUDE_TRASH,
@@ -724,7 +719,7 @@ LLInventoryModel::item_array_t LLInventoryModel::collectLinkedItems(const LLUUID
item_array_t items; item_array_t items;
LLInventoryModel::cat_array_t cat_array; LLInventoryModel::cat_array_t cat_array;
LLLinkedItemIDMatches is_linked_item_match(id); LLLinkedItemIDMatches is_linked_item_match(id);
collectDescendentsIf((start_folder_id == LLUUID::null ? gAgent.getInventoryRootID() : start_folder_id), collectDescendentsIf((start_folder_id == LLUUID::null ? gInventory.getRootFolderID() : start_folder_id),
cat_array, cat_array,
items, items,
LLInventoryModel::INCLUDE_TRASH, LLInventoryModel::INCLUDE_TRASH,
@@ -756,7 +751,7 @@ void LLInventoryModel::appendPath(const LLUUID& id, std::string& path)
bool LLInventoryModel::isInventoryUsable() const bool LLInventoryModel::isInventoryUsable() const
{ {
bool result = false; bool result = false;
if(gAgent.getInventoryRootID().notNull() && mIsAgentInvUsable) if(gInventory.getRootFolderID().notNull() && mIsAgentInvUsable)
{ {
result = true; result = true;
} }
@@ -1768,8 +1763,8 @@ void LLInventoryModel::startBackgroundFetch(const LLUUID& cat_id)
if (!sFullFetchStarted) if (!sFullFetchStarted)
{ {
sFullFetchStarted = TRUE; sFullFetchStarted = TRUE;
sFetchQueue.push_back(gInventoryLibraryRoot); sFetchQueue.push_back(gInventory.getLibraryRootFolderID());
sFetchQueue.push_back(gAgent.getInventoryRootID()); sFetchQueue.push_back(gInventory.getRootFolderID());
if (!sBackgroundFetchActive) if (!sBackgroundFetchActive)
{ {
sBackgroundFetchActive = TRUE; sBackgroundFetchActive = TRUE;
@@ -2584,7 +2579,7 @@ void LLInventoryModel::buildParentChildMap()
else else
{ {
// it's a protected folder. // it's a protected folder.
cat->setParent(gAgent.getInventoryRootID()); cat->setParent(gInventory.getRootFolderID());
} }
cat->updateServer(TRUE); cat->updateServer(TRUE);
catsp = getUnlockedCatArray(cat->getParentUUID()); catsp = getUnlockedCatArray(cat->getParentUUID());
@@ -2684,7 +2679,7 @@ void LLInventoryModel::buildParentChildMap()
} }
} }
const LLUUID& agent_inv_root_id = gAgent.getInventoryRootID(); const LLUUID& agent_inv_root_id = gInventory.getRootFolderID();
if (agent_inv_root_id.notNull()) if (agent_inv_root_id.notNull())
{ {
cat_array_t* catsp = get_ptr_in_map(mParentChildCategoryTree, agent_inv_root_id); cat_array_t* catsp = get_ptr_in_map(mParentChildCategoryTree, agent_inv_root_id);
@@ -3553,6 +3548,58 @@ void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**)
} }
} }
void LLInventoryModel::removeItem(const LLUUID& item_id)
{
LLViewerInventoryItem* item = getItem(item_id);
const LLUUID new_parent = findCategoryUUIDForType(LLFolderType::FT_TRASH);
if(item && new_parent.notNull() && item->getParentUUID() != new_parent)
{
LLInventoryModel::update_list_t update;
LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(), -1);
update.push_back(old_folder);
LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1);
update.push_back(new_folder);
accountForUpdate(update);
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setParent(new_parent);
new_item->updateParentOnServer(TRUE);
updateItem(new_item);
notifyObservers();
}
}
const LLUUID &LLInventoryModel::getRootFolderID() const
{
return mRootFolderID;
}
void LLInventoryModel::setRootFolderID(const LLUUID& val)
{
mRootFolderID = val;
}
const LLUUID &LLInventoryModel::getLibraryRootFolderID() const
{
return mLibraryRootFolderID;
}
void LLInventoryModel::setLibraryRootFolderID(const LLUUID& val)
{
mLibraryRootFolderID = val;
}
const LLUUID &LLInventoryModel::getLibraryOwnerID() const
{
return mLibraryOwnerID;
}
void LLInventoryModel::setLibraryOwnerID(const LLUUID& val)
{
mLibraryOwnerID = val;
}
// *NOTE: DEBUG functionality // *NOTE: DEBUG functionality
void LLInventoryModel::dumpInventory() const void LLInventoryModel::dumpInventory() const
{ {

View File

@@ -146,6 +146,23 @@ public:
private: private:
bool mIsAgentInvUsable; // used to handle an invalid inventory state bool mIsAgentInvUsable; // used to handle an invalid inventory state
//--------------------------------------------------------------------
// Root Folders
//--------------------------------------------------------------------
public:
// The following are set during login with data from the server
void setRootFolderID(const LLUUID& id);
void setLibraryOwnerID(const LLUUID& id);
void setLibraryRootFolderID(const LLUUID& id);
const LLUUID &getRootFolderID() const;
const LLUUID &getLibraryOwnerID() const;
const LLUUID &getLibraryRootFolderID() const;
private:
LLUUID mRootFolderID;
LLUUID mLibraryRootFolderID;
LLUUID mLibraryOwnerID;
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Structure // Structure
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@@ -246,8 +263,8 @@ public:
// on the fly if one does not exist. *NOTE: if find_in_library is true it // on the fly if one does not exist. *NOTE: if find_in_library is true it
// will search in the user's library folder instead of "My Inventory" // will search in the user's library folder instead of "My Inventory"
const LLUUID findCategoryUUIDForType(LLFolderType::EType preferred_type, const LLUUID findCategoryUUIDForType(LLFolderType::EType preferred_type,
bool create_folder = true bool create_folder = true,
/*,bool find_in_library = false*/); bool find_in_library = false);
// Get whatever special folder this object is a child of, if any. // Get whatever special folder this object is a child of, if any.
const LLViewerInventoryCategory *getFirstNondefaultParent(const LLUUID& obj_id) const; const LLViewerInventoryCategory *getFirstNondefaultParent(const LLUUID& obj_id) const;
@@ -326,6 +343,7 @@ public:
// consistent internal state. No cache accounting, observer // consistent internal state. No cache accounting, observer
// notification, or server update is performed. // notification, or server update is performed.
void deleteObject(const LLUUID& id); void deleteObject(const LLUUID& id);
void removeItem(const LLUUID& item_id);
// Delete a particular inventory object by ID, and delete it from // Delete a particular inventory object by ID, and delete it from
// the server. Also updates linked items. // the server. Also updates linked items.
@@ -490,28 +508,6 @@ public:
static bool isEverythingFetched(); static bool isEverythingFetched();
static void backgroundFetch(void*); // background fetch idle function static void backgroundFetch(void*); // background fetch idle function
static void incrBulkFetch(S16 fetching) { sBulkFetchCount+=fetching; if (sBulkFetchCount<0) sBulkFetchCount=0; } static void incrBulkFetch(S16 fetching) { sBulkFetchCount+=fetching; if (sBulkFetchCount<0) sBulkFetchCount=0; }
protected:
// Internal methods which add inventory and make sure that all of
// the internal data structures are consistent. These methods
// should be passed pointers of newly created objects, and the
// instance will take over the memory management from there.
// <edit>
// Internal method which looks for a category with the specified
// preferred type. Returns LLUUID::null if not found
LLUUID findCatUUID(LLFolderType::EType preferred_type);
// Empty the entire contents
// Given the current state of the inventory items, figure out the
// clone information. *FIX: This is sub-optimal, since we can
// insert this information snurgically, but this makes sure the
// implementation works before we worry about optimization.
//void recalculateCloneInformation();
// file import/export.
// <edit>
/** Notifications /** Notifications
** ** ** **
*******************************************************************************/ *******************************************************************************/

View File

@@ -75,7 +75,9 @@ LLPanelLandAudio::LLPanelLandAudio(LLParcelSelectionHandle& parcel)
mCheckSoundLocal(NULL), mCheckSoundLocal(NULL),
mSoundHelpButton(NULL), mSoundHelpButton(NULL),
mRadioVoiceChat(NULL), mRadioVoiceChat(NULL),
mMusicURLEdit(NULL) mMusicURLEdit(NULL),
mCheckAVSoundAny(NULL),
mCheckAVSoundGroup(NULL)
{ {
} }
@@ -100,6 +102,12 @@ BOOL LLPanelLandAudio::postBuild()
mMusicURLEdit = getChild<LLLineEditor>("music_url"); mMusicURLEdit = getChild<LLLineEditor>("music_url");
childSetCommitCallback("music_url", onCommitAny, this); childSetCommitCallback("music_url", onCommitAny, this);
mCheckAVSoundAny = getChild<LLCheckBoxCtrl>("all av sound check");
childSetCommitCallback("all av sound check", onCommitAny, this);
mCheckAVSoundGroup = getChild<LLCheckBoxCtrl>("group av sound check");
childSetCommitCallback("group av sound check", onCommitAny, this);
return TRUE; return TRUE;
} }
@@ -140,6 +148,13 @@ void LLPanelLandAudio::refresh()
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
mRadioVoiceChat->setEnabled( region && region->isVoiceEnabled() && can_change_media ); mRadioVoiceChat->setEnabled( region && region->isVoiceEnabled() && can_change_media );
BOOL can_change_av_sounds = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS) && parcel->getHaveNewParcelLimitData();
mCheckAVSoundAny->set(parcel->getAllowAnyAVSounds());
mCheckAVSoundAny->setEnabled(can_change_av_sounds);
mCheckAVSoundGroup->set(parcel->getAllowGroupAVSounds() || parcel->getAllowAnyAVSounds()); // On if "Everyone" is on
mCheckAVSoundGroup->setEnabled(can_change_av_sounds && !parcel->getAllowAnyAVSounds()); // Enabled if "Everyone" is off
} }
} }
// static // static
@@ -178,6 +193,13 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
break; break;
} }
BOOL any_av_sound = self->mCheckAVSoundAny->get();
BOOL group_av_sound = TRUE; // If set to "Everyone" then group is checked as well
if (!any_av_sound)
{ // If "Everyone" is off, use the value from the checkbox
group_av_sound = self->mCheckAVSoundGroup->get();
}
// Remove leading/trailing whitespace (common when copying/pasting) // Remove leading/trailing whitespace (common when copying/pasting)
LLStringUtil::trim(music_url); LLStringUtil::trim(music_url);
@@ -186,6 +208,8 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan); parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan);
parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local);
parcel->setMusicURL(music_url); parcel->setMusicURL(music_url);
parcel->setAllowAnyAVSounds(any_av_sound);
parcel->setAllowGroupAVSounds(group_av_sound);
// Send current parcel data upstream to server // Send current parcel data upstream to server
LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );

View File

@@ -58,6 +58,8 @@ private:
LLRadioGroup* mRadioVoiceChat; LLRadioGroup* mRadioVoiceChat;
LLLineEditor* mMusicURLEdit; LLLineEditor* mMusicURLEdit;
LLCheckBoxCtrl* mMusicUrlCheck; LLCheckBoxCtrl* mMusicUrlCheck;
LLCheckBoxCtrl* mCheckAVSoundAny;
LLCheckBoxCtrl* mCheckAVSoundGroup;
LLSafeHandle<LLParcelSelection>& mParcel; LLSafeHandle<LLParcelSelection>& mParcel;
}; };

View File

@@ -612,7 +612,7 @@ void LLPreviewGesture::addAnimations()
PERM_ITEM_UNRESTRICTED, PERM_ITEM_UNRESTRICTED,
gAgent.getID(), gAgent.getID(),
gAgent.getGroupID()); gAgent.getGroupID());
gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
cats, cats,
items, items,
LLInventoryModel::EXCLUDE_TRASH, LLInventoryModel::EXCLUDE_TRASH,
@@ -657,7 +657,7 @@ void LLPreviewGesture::addSounds()
PERM_ITEM_UNRESTRICTED, PERM_ITEM_UNRESTRICTED,
gAgent.getID(), gAgent.getID(),
gAgent.getGroupID()); gAgent.getGroupID());
gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
cats, cats,
items, items,
LLInventoryModel::EXCLUDE_TRASH, LLInventoryModel::EXCLUDE_TRASH,

View File

@@ -1118,7 +1118,7 @@ void LLPreviewLSL::loadAsset()
const LLInventoryItem* item = gInventory.getItem(mItemUUID); const LLInventoryItem* item = gInventory.getItem(mItemUUID);
BOOL is_library = item BOOL is_library = item
&& !gInventory.isObjectDescendentOf(mItemUUID, && !gInventory.isObjectDescendentOf(mItemUUID,
gAgent.getInventoryRootID()); gInventory.getRootFolderID());
if(!item) if(!item)
{ {
// do the more generic search. // do the more generic search.

View File

@@ -1716,8 +1716,8 @@ bool idle_startup()
it = options[0].find("folder_id"); it = options[0].find("folder_id");
if(it != options[0].end()) if(it != options[0].end())
{ {
gAgent.setInventoryRootID(LLUUID((*it).second)); gInventory.setRootFolderID(LLUUID((*it).second));
//gInventory.mock(gAgent.getInventoryRootID()); //gInventory.mock(gInventory.getRootFolderID());
} }
} }
@@ -2318,7 +2318,7 @@ bool idle_startup()
it = options[0].find("folder_id"); it = options[0].find("folder_id");
if(it != options[0].end()) if(it != options[0].end())
{ {
gInventoryLibraryRoot.set((*it).second); gInventory.setLibraryRootFolderID(LLUUID((*it).second));
} }
} }
options.clear(); options.clear();
@@ -2330,14 +2330,14 @@ bool idle_startup()
it = options[0].find("agent_id"); it = options[0].find("agent_id");
if(it != options[0].end()) if(it != options[0].end())
{ {
gInventoryLibraryOwner.set((*it).second); gInventory.setLibraryOwnerID(LLUUID((*it).second));
} }
} }
options.clear(); options.clear();
if(LLUserAuth::getInstance()->getOptions("inventory-skel-lib", options) if(LLUserAuth::getInstance()->getOptions("inventory-skel-lib", options)
&& gInventoryLibraryOwner.notNull()) && gInventory.getLibraryOwnerID().notNull())
{ {
if(!gInventory.loadSkeleton(options, gInventoryLibraryOwner)) if(!gInventory.loadSkeleton(options, gInventory.getLibraryOwnerID()))
{ {
LL_WARNS("AppInit") << "Problem loading inventory-skel-lib" << LL_ENDL; LL_WARNS("AppInit") << "Problem loading inventory-skel-lib" << LL_ENDL;
} }

View File

@@ -473,7 +473,7 @@ BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask)
{ {
if (!root_folder->getCurSelectedItem()) if (!root_folder->getCurSelectedItem())
{ {
LLFolderViewItem* itemp = root_folder->getItemByID(gAgent.getInventoryRootID()); LLFolderViewItem* itemp = root_folder->getItemByID(gInventory.getRootFolderID());
if (itemp) if (itemp)
{ {
root_folder->setSelection(itemp, FALSE, FALSE); root_folder->setSelection(itemp, FALSE, FALSE);

View File

@@ -362,22 +362,6 @@ void LLViewerInventoryItem::updateParentOnServer(BOOL restamp) const
// return mClones; // return mClones;
//} //}
// [RLVa:KB] - Checked: 2010-09-27 (RLVa-1.1.3a) | Added: RLVa-1.1.3a
bool LLViewerInventoryItem::isWearableType() const
{
return (getInventoryType() == LLInventoryType::IT_WEARABLE);
}
LLWearableType::EType LLViewerInventoryItem::getWearableType() const
{
if (!isWearableType())
{
return LLWearableType::WT_INVALID;
}
return LLWearableType::EType(getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK);
}
// [/RLVa:KB]
///---------------------------------------------------------------------------- ///----------------------------------------------------------------------------
/// Class LLViewerInventoryCategory /// Class LLViewerInventoryCategory
///---------------------------------------------------------------------------- ///----------------------------------------------------------------------------
@@ -443,7 +427,8 @@ void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const
void LLViewerInventoryCategory::updateServer(BOOL is_new) const void LLViewerInventoryCategory::updateServer(BOOL is_new) const
{ {
// communicate that change with the server. // communicate that change with the server.
if ( (LLFolderType::FT_NONE != mPreferredType) && (LLFolderType::FT_OUTFIT != mPreferredType) )
if (LLFolderType::lookupIsProtectedType(mPreferredType))
{ {
LLNotificationsUtil::add("CannotModifyProtectedCategories"); LLNotificationsUtil::add("CannotModifyProtectedCategories");
return; return;
@@ -467,7 +452,7 @@ void LLViewerInventoryCategory::removeFromServer( void )
llinfos << "Removing inventory category " << mUUID << " from server." llinfos << "Removing inventory category " << mUUID << " from server."
<< llendl; << llendl;
// communicate that change with the server. // communicate that change with the server.
if ( (LLFolderType::FT_NONE != mPreferredType) && (LLFolderType::FT_OUTFIT != mPreferredType) ) if(LLFolderType::lookupIsProtectedType(mPreferredType))
{ {
LLNotificationsUtil::add("CannotRemoveProtectedCategories"); LLNotificationsUtil::add("CannotRemoveProtectedCategories");
return; return;
@@ -586,7 +571,7 @@ bool LLViewerInventoryCategory::importFileLocal(LLFILE* fp)
} }
else if(0 == strcmp("pref_type", keyword)) else if(0 == strcmp("pref_type", keyword))
{ {
mPreferredType = LLFolderType::assetTypeToFolderType(LLAssetType::lookup(valuestr)); mPreferredType = LLFolderType::lookup(valuestr);
} }
else if(0 == strcmp("name", keyword)) else if(0 == strcmp("name", keyword))
{ {
@@ -907,15 +892,19 @@ public:
void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecard_inv_id, const LLInventoryItem *src, U32 callback_id) void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecard_inv_id, const LLInventoryItem *src, U32 callback_id)
{ {
LLSD body; if (NULL == src)
LLViewerRegion* viewer_region = NULL;
if(object_id.notNull())
{ {
LLViewerObject* vo = gObjectList.findObject(object_id); LL_WARNS("copy_inventory_from_notecard") << "Null pointer to item was passed for object_id "
if(vo) << object_id << " and notecard_inv_id "
{ << notecard_inv_id << LL_ENDL;
viewer_region = vo->getRegion(); return;
} }
LLViewerRegion* viewer_region = NULL;
LLViewerObject* vo = NULL;
if (object_id.notNull() && (vo = gObjectList.findObject(object_id)) != NULL)
{
viewer_region = vo->getRegion();
} }
// Fallback to the agents region if for some reason the // Fallback to the agents region if for some reason the
@@ -925,20 +914,32 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar
viewer_region = gAgent.getRegion(); viewer_region = gAgent.getRegion();
} }
if(viewer_region) if (! viewer_region)
{ {
std::string url = viewer_region->getCapability("CopyInventoryFromNotecard"); LL_WARNS("copy_inventory_from_notecard") << "Can't find region from object_id "
if (!url.empty()) << object_id << " or gAgent"
{ << LL_ENDL;
body["notecard-id"] = notecard_inv_id; return;
body["object-id"] = object_id; }
body["item-id"] = src->getUUID();
body["folder-id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType()));
body["callback-id"] = (LLSD::Integer)callback_id;
LLHTTPClient::post(url, body, new LLCopyInventoryFromNotecardResponder()); // check capability to prevent a crash while LL_ERRS in LLCapabilityListener::capListener. See EXT-8459.
} std::string url = viewer_region->getCapability("CopyInventoryFromNotecard");
if (url.empty())
{
LL_WARNS("copy_inventory_from_notecard") << "There is no 'CopyInventoryFromNotecard' capability"
<< " for region: " << viewer_region->getName()
<< LL_ENDL;
return;
} }
LLSD request, body;
body["notecard-id"] = notecard_inv_id;
body["object-id"] = object_id;
body["item-id"] = src->getUUID();
body["folder-id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType()));
body["callback-id"] = (LLSD::Integer)callback_id;
LLHTTPClient::post(url, body, new LLCopyInventoryFromNotecardResponder());
} }
@@ -965,6 +966,22 @@ const LLUUID& LLViewerInventoryItem::getAssetUUID() const
return LLInventoryItem::getAssetUUID(); return LLInventoryItem::getAssetUUID();
} }
const bool LLViewerInventoryItem::getIsFullPerm() const
{
LLPermissions item_permissions = getPermissions();
// modify-ok & copy-ok & transfer-ok
return ( item_permissions.allowOperationBy(PERM_MODIFY,
gAgent.getID(),
gAgent.getGroupID()) &&
item_permissions.allowOperationBy(PERM_COPY,
gAgent.getID(),
gAgent.getGroupID()) &&
item_permissions.allowOperationBy(PERM_TRANSFER,
gAgent.getID(),
gAgent.getGroupID()) );
}
const std::string& LLViewerInventoryItem::getName() const const std::string& LLViewerInventoryItem::getName() const
{ {
if (const LLViewerInventoryItem *linked_item = getLinkedItem()) if (const LLViewerInventoryItem *linked_item = getLinkedItem())
@@ -1041,6 +1058,30 @@ U32 LLViewerInventoryItem::getFlags() const
return LLInventoryItem::getFlags(); return LLInventoryItem::getFlags();
} }
bool LLViewerInventoryItem::isWearableType() const
{
return (getInventoryType() == LLInventoryType::IT_WEARABLE);
}
LLWearableType::EType LLViewerInventoryItem::getWearableType() const
{
if (!isWearableType())
{
return LLWearableType::WT_INVALID;
}
return LLWearableType::EType(getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK);
}
time_t LLViewerInventoryItem::getCreationDate() const
{
return LLInventoryItem::getCreationDate();
}
U32 LLViewerInventoryItem::getCRC32() const
{
return LLInventoryItem::getCRC32();
}
// This returns true if the item that this item points to // This returns true if the item that this item points to
// doesn't exist in memory (i.e. LLInventoryModel). The baseitem // doesn't exist in memory (i.e. LLInventoryModel). The baseitem
@@ -1077,6 +1118,42 @@ LLViewerInventoryCategory *LLViewerInventoryItem::getLinkedCategory() const
} }
return NULL; return NULL;
} }
bool LLViewerInventoryItem::checkPermissionsSet(PermissionMask mask) const
{
const LLPermissions& perm = getPermissions();
PermissionMask curr_mask = PERM_NONE;
if(perm.getOwner() == gAgent.getID())
{
curr_mask = perm.getMaskBase();
}
else if(gAgent.isInGroup(perm.getGroup()))
{
curr_mask = perm.getMaskGroup();
}
else
{
curr_mask = perm.getMaskEveryone();
}
return ((curr_mask & mask) == mask);
}
PermissionMask LLViewerInventoryItem::getPermissionMask() const
{
const LLPermissions& permissions = getPermissions();
BOOL copy = permissions.allowCopyBy(gAgent.getID());
BOOL mod = permissions.allowModifyBy(gAgent.getID());
BOOL xfer = permissions.allowOperationBy(PERM_TRANSFER, gAgent.getID());
PermissionMask perm_mask = 0;
if (copy) perm_mask |= PERM_COPY;
if (mod) perm_mask |= PERM_MODIFY;
if (xfer) perm_mask |= PERM_TRANSFER;
return perm_mask;
}
//----------
void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group) void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group)
{ {
rename(name); rename(name);

View File

@@ -59,11 +59,16 @@ public:
virtual const LLUUID& getAssetUUID() const; virtual const LLUUID& getAssetUUID() const;
virtual const std::string& getName() const; virtual const std::string& getName() const;
virtual const LLPermissions& getPermissions() const; virtual const LLPermissions& getPermissions() const;
virtual const bool getIsFullPerm() const; // 'fullperm' in the popular sense: modify-ok & copy-ok & transfer-ok, no special god rules applied
virtual const LLUUID& getCreatorUUID() const; virtual const LLUUID& getCreatorUUID() const;
virtual const std::string& getDescription() const; virtual const std::string& getDescription() const;
virtual const LLSaleInfo& getSaleInfo() const; virtual const LLSaleInfo& getSaleInfo() const;
virtual LLInventoryType::EType getInventoryType() const; virtual LLInventoryType::EType getInventoryType() const;
virtual bool isWearableType() const;
virtual LLWearableType::EType getWearableType() const;
virtual U32 getFlags() const; virtual U32 getFlags() const;
virtual time_t getCreationDate() const;
virtual U32 getCRC32() const; // really more of a checksum.
// construct a complete viewer inventory item // construct a complete viewer inventory item
LLViewerInventoryItem(const LLUUID& uuid, const LLUUID& parent_uuid, LLViewerInventoryItem(const LLUUID& uuid, const LLUUID& parent_uuid,
@@ -123,12 +128,9 @@ public:
// new methods // new methods
BOOL isComplete() const { return mIsComplete; } BOOL isComplete() const { return mIsComplete; }
BOOL isFinished() const { return mIsComplete; }
void setComplete(BOOL complete) { mIsComplete = complete; } void setComplete(BOOL complete) { mIsComplete = complete; }
//void updateAssetOnServer() const; //void updateAssetOnServer() const;
// [RLVa:KB] - Checked: 2010-09-27 (RLVa-1.1.3a) | Added: RLVa-1.1.3a
virtual bool isWearableType() const;
virtual LLWearableType::EType getWearableType() const;
// [/RLVa:KB]
virtual void packMessage(LLMessageSystem* msg) const; virtual void packMessage(LLMessageSystem* msg) const;
virtual void setTransactionID(const LLTransactionID& transaction_id); virtual void setTransactionID(const LLTransactionID& transaction_id);
@@ -145,6 +147,10 @@ public:
LLViewerInventoryItem *getLinkedItem() const; LLViewerInventoryItem *getLinkedItem() const;
LLViewerInventoryCategory *getLinkedCategory() const; LLViewerInventoryCategory *getLinkedCategory() const;
// Checks the items permissions (for owner, group, or everyone) and returns true if all mask bits are set.
bool checkPermissionsSet(PermissionMask mask) const;
PermissionMask getPermissionMask() const;
// callback // callback
void onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group); void onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group);
protected: protected:
@@ -265,7 +271,8 @@ public:
void fire(U32 callback_id, const LLUUID& item_id); void fire(U32 callback_id, const LLUUID& item_id);
U32 registerCB(LLPointer<LLInventoryCallback> cb); U32 registerCB(LLPointer<LLInventoryCallback> cb);
private: private:
std::map<U32, LLPointer<LLInventoryCallback> > mMap; typedef std::map<U32, LLPointer<LLInventoryCallback> > callback_map_t;
callback_map_t mMap;
U32 mLastCallback; U32 mLastCallback;
static LLInventoryCallbackManager *sInstance; static LLInventoryCallbackManager *sInstance;
public: public:

View File

@@ -4841,7 +4841,7 @@ void handle_take()
} }
// check library // check library
if(gInventory.isObjectDescendentOf(category_id, gInventoryLibraryRoot)) if(gInventory.isObjectDescendentOf(category_id, gInventory.getLibraryRootFolderID()))
{ {
category_id.setNull(); category_id.setNull();
} }
@@ -6427,11 +6427,6 @@ class LLShowFloater : public view_listener_t
} }
else if (floater_name == "about land") else if (floater_name == "about land")
{ {
if (LLViewerParcelMgr::getInstance()->selectionEmpty())
{
LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
}
LLFloaterLand::showInstance(); LLFloaterLand::showInstance();
} }
else if (floater_name == "buy land") else if (floater_name == "buy land")

View File

@@ -865,37 +865,13 @@ public:
virtual void done() virtual void done()
{ {
LL_DEBUGS("Messaging") << "LLDiscardAgentOffer::done()" << LL_ENDL; LL_DEBUGS("Messaging") << "LLDiscardAgentOffer::done()" << LL_ENDL;
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
bool notify = false; // We're invoked from LLInventoryModel::notifyObservers().
if(trash_id.notNull() && mObjectID.notNull()) // If we now try to remove the inventory item, it will cause a nested
{ // notifyObservers() call, which won't work.
LLInventoryModel::update_list_t update; // So defer moving the item to trash until viewer gets idle (in a moment).
LLInventoryModel::LLCategoryUpdate old_folder(mFolderID, -1); LLAppViewer::instance()->addOnIdleCallback(boost::bind(&LLInventoryModel::removeItem, &gInventory, mObjectID));
update.push_back(old_folder);
LLInventoryModel::LLCategoryUpdate new_folder(trash_id, 1);
update.push_back(new_folder);
gInventory.accountForUpdate(update);
gInventory.moveObject(mObjectID, trash_id);
LLInventoryObject* obj = gInventory.getObject(mObjectID);
if(obj)
{
// no need to restamp since this is already a freshly
// stamped item.
obj->updateParentOnServer(FALSE);
notify = true;
}
}
else
{
LL_WARNS("Messaging") << "DiscardAgentOffer unable to find: "
<< (trash_id.isNull() ? "trash " : "")
<< (mObjectID.isNull() ? "object" : "") << LL_ENDL;
}
gInventory.removeObserver(this); gInventory.removeObserver(this);
if(notify)
{
gInventory.notifyObservers();
}
delete this; delete this;
} }
protected: protected:
@@ -5975,7 +5951,7 @@ void container_inventory_arrived(LLViewerObject* object,
{ {
// create a new inventory category to put this in // create a new inventory category to put this in
LLUUID cat_id; LLUUID cat_id;
cat_id = gInventory.createNewCategory(gAgent.getInventoryRootID(), cat_id = gInventory.createNewCategory(gInventory.getRootFolderID(),
LLFolderType::FT_NONE, LLFolderType::FT_NONE,
std::string("Acquired Items")); //TODO: Translate std::string("Acquired Items")); //TODO: Translate

View File

@@ -624,7 +624,7 @@ bool RlvForceWear::isStrippable(const LLInventoryItem* pItem)
} }
LLViewerInventoryCategory* pFolder = gInventory.getCategory(pItem->getParentUUID()); LLViewerInventoryCategory* pFolder = gInventory.getCategory(pItem->getParentUUID());
while ( (pFolder) && (gAgent.getInventoryRootID() != pFolder->getParentUUID()) ) while ( (pFolder) && (gInventory.getRootFolderID() != pFolder->getParentUUID()) )
{ {
if (std::string::npos != pFolder->getName().find(RLV_FOLDER_FLAG_NOSTRIP)) if (std::string::npos != pFolder->getName().find(RLV_FOLDER_FLAG_NOSTRIP))
return false; return false;

View File

@@ -232,7 +232,7 @@ LLViewerInventoryCategory* RlvInventory::getSharedRoot() const
if (gInventory.isInventoryUsable()) if (gInventory.isInventoryUsable())
{ {
LLInventoryModel::cat_array_t* pFolders; LLInventoryModel::item_array_t* pItems; LLInventoryModel::cat_array_t* pFolders; LLInventoryModel::item_array_t* pItems;
gInventory.getDirectDescendentsOf(gAgent.getInventoryRootID(), pFolders, pItems); gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), pFolders, pItems);
if (pFolders) if (pFolders)
{ {
// NOTE: we might have multiple #RLV folders so we'll just go with the first one we come across // NOTE: we might have multiple #RLV folders so we'll just go with the first one we come across
@@ -308,7 +308,7 @@ std::string RlvInventory::getSharedPath(const LLViewerInventoryCategory* pFolder
return std::string(); return std::string();
const LLUUID& idRLV = pRlvRoot->getUUID(); const LLUUID& idRLV = pRlvRoot->getUUID();
const LLUUID& idRoot = gAgent.getInventoryRootID(); const LLUUID& idRoot = gInventory.getRootFolderID();
std::string strPath; std::string strPath;
// Walk up the tree until we reach the top // Walk up the tree until we reach the top
@@ -617,7 +617,7 @@ RlvForceWear::EWearAction RlvWearableItemCollector::getWearAction(const LLUUID&
while ((itCurFolder = m_WearActionMap.find(idCurFolder)) == m_WearActionMap.end()) while ((itCurFolder = m_WearActionMap.find(idCurFolder)) == m_WearActionMap.end())
{ {
const LLViewerInventoryCategory* pFolder = gInventory.getCategory(idCurFolder); const LLViewerInventoryCategory* pFolder = gInventory.getCategory(idCurFolder);
if ((!pFolder) || (gAgent.getInventoryRootID() == pFolder->getParentUUID())) if ((!pFolder) || (gInventory.getRootFolderID() == pFolder->getParentUUID()))
break; break;
idCurFolder = pFolder->getParentUUID(); idCurFolder = pFolder->getParentUUID();
} }

View File

@@ -640,6 +640,9 @@ Only large parcels can be listed in search.
<string name="search_disabled_permissions_tooltip"> <string name="search_disabled_permissions_tooltip">
This option is disabled because you cannot modify this parcel&apos;s options. This option is disabled because you cannot modify this parcel&apos;s options.
</string> </string>
<string name="see_avs_text">
See and chat with residents on this parcel
</string>
<combo_box allow_text_entry="false" bottom="-140" enabled="false" follows="left|top" <combo_box allow_text_entry="false" bottom="-140" enabled="false" follows="left|top"
height="18" left="255" max_chars="20" mouse_opaque="true" height="18" left="255" max_chars="20" mouse_opaque="true"
name="land category with adult" width="130" visible="false"> name="land category with adult" width="130" visible="false">
@@ -754,17 +757,28 @@ Only large parcels can be listed in search.
Your parcel information or content is considered adult. Your parcel information or content is considered adult.
</string> </string>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-180" drop_shadow_visible="true" enabled="true" follows="left|top" bottom="-178" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4"
mouse_opaque="true" name="allow_label5" v_pad="0" width="278">
Allow Residents on other parcels to:
</text>
<check_box bottom="-196" enabled="false" follows="left|top" font="SansSerifSmall"
height="16" initial_value="false" label="See Avatars" left="14"
mouse_opaque="true" name="SeeAvatarsCheck" radio_style="false"
tool_tip="Allows residents on other parcels to see and chat with residents on this parcel, and you to see and chat with them."
width="107" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-212" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4" font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4"
mouse_opaque="true" name="Snapshot:" v_pad="0" width="278"> mouse_opaque="true" name="Snapshot:" v_pad="0" width="278">
Snapshot: Snapshot:
</text> </text>
<texture_picker allow_no_texture="false" bottom="-299" can_apply_immediately="false" <texture_picker allow_no_texture="false" bottom="-349" can_apply_immediately="false"
default_image_name="" enabled="true" follows="left|top" height="135" default_image_name="" enabled="true" follows="left|top" height="135"
label="" left="76" mouse_opaque="true" name="snapshot_ctrl" label="" left="10" mouse_opaque="true" name="snapshot_ctrl"
tool_tip="Click to choose a picture" width="180" /> tool_tip="Click to choose a picture" width="180" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-303" drop_shadow_visible="true" enabled="true" follows="left|top" bottom="-353" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4" font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4"
mouse_opaque="true" name="landing_point" v_pad="0" width="278"> mouse_opaque="true" name="landing_point" v_pad="0" width="278">
Landing Point: [LANDING] Landing Point: [LANDING]
@@ -772,22 +786,22 @@ Only large parcels can be listed in search.
<string name="landing_point_none"> <string name="landing_point_none">
(none) (none)
</string> </string>
<button bottom="-303" enabled="true" follows="left|top" font="SansSerifSmall" <button bottom="-353" enabled="true" follows="left|top" font="SansSerifSmall"
halign="center" height="16" label="Set" label_selected="Set" left="236" halign="center" height="16" label="Set" label_selected="Set" left="236"
mouse_opaque="true" name="Set" scale_image="true" mouse_opaque="true" name="Set" scale_image="true"
tool_tip="Sets the landing point where visitors arrive. Sets to your avatar&apos;s location inside this parcel." tool_tip="Sets the landing point where visitors arrive. Sets to your avatar&apos;s location inside this parcel."
width="50" /> width="50" />
<button bottom="-303" enabled="true" follows="left|top" font="SansSerifSmall" <button bottom="-353" enabled="true" follows="left|top" font="SansSerifSmall"
halign="center" height="16" label="Clear" label_selected="Clear" left="291" halign="center" height="16" label="Clear" label_selected="Clear" left="291"
mouse_opaque="true" name="Clear" scale_image="true" mouse_opaque="true" name="Clear" scale_image="true"
tool_tip="Clear the landing point." width="50" /> tool_tip="Clear the landing point." width="50" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-323" drop_shadow_visible="true" enabled="true" follows="left|top" bottom="-373" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4" font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4"
mouse_opaque="true" name="Teleport Routing: " v_pad="0" width="278"> mouse_opaque="true" name="Teleport Routing: " v_pad="0" width="278">
Teleport Routing: Teleport Routing:
</text> </text>
<combo_box allow_text_entry="false" bottom="-325" enabled="true" follows="left|top" <combo_box allow_text_entry="false" bottom="-375" enabled="true" follows="left|top"
height="18" left="120" max_chars="20" mouse_opaque="true" height="18" left="120" max_chars="20" mouse_opaque="true"
name="landing type" name="landing type"
tool_tip="Teleport Routing -- select how to handle teleports onto your land." tool_tip="Teleport Routing -- select how to handle teleports onto your land."
@@ -1321,12 +1335,12 @@ Select the thumbnail to choose a different texture.
Sound: Sound:
</text> </text>
<check_box <check_box
bottom_delta="0" bottom_delta="-16"
follows="left|top" follows="left|top"
height="16" height="16"
label="Restrict gesture and object sounds to this parcel" label="Restrict gesture and object sounds to this parcel"
layout="topleft" layout="topleft"
left_delta="70" left_delta="20"
name="check_sound_local" name="check_sound_local"
width="200" /> width="200" />
<button <button
@@ -1340,7 +1354,37 @@ Select the thumbnail to choose a different texture.
name="?" name="?"
width="18" /> width="18" />
<text <text
bottom_delta="-65" bottom_delta="-30"
follows="left|top"
height="16"
layout="topleft"
left="10"
length="1"
name="Avatar Sounds:"
type="string"
width="364">
Avatar Sounds:
</text>
<check_box
bottom_delta="-16"
follows="left|top"
height="16"
label="Everyone"
layout="topleft"
left_delta="20"
name="all av sound check"
width="200" />
<check_box
bottom_delta="-16"
follows="left|top"
height="16"
label="Group"
layout="topleft"
left_delta="0"
name="group av sound check"
width="200" />
<text
bottom_delta="-30"
follows="left|top" follows="left|top"
height="16" height="16"
layout="topleft" layout="topleft"
@@ -1353,12 +1397,12 @@ Select the thumbnail to choose a different texture.
Voice: Voice:
</text> </text>
<radio_group <radio_group
bottom_delta="-40" bottom_delta="-56"
draw_border="false" draw_border="false"
enabled="true" enabled="true"
follows="left|top" follows="left|top"
height="60" height="60"
left="80" left_delta="20"
mouse_opaque="true" mouse_opaque="true"
name="parcel_voice_channel" name="parcel_voice_channel"
tab_stop="true" tab_stop="true"

View File

@@ -67,7 +67,7 @@ AIInventoryFetchDescendentsObserver::AIInventoryFetchDescendentsObserver(AIState
void AIFetchInventoryFolder::fetch(std::string const& foldername, bool create, bool fetch_contents) void AIFetchInventoryFolder::fetch(std::string const& foldername, bool create, bool fetch_contents)
{ {
fetch(gAgent.getInventoryRootID(), foldername, create, fetch_contents); fetch(gInventory.getRootFolderID(), foldername, create, fetch_contents);
} }
char const* AIFetchInventoryFolder::state_str_impl(state_type run_state) const char const* AIFetchInventoryFolder::state_str_impl(state_type run_state) const
@@ -103,7 +103,7 @@ void AIFetchInventoryFolder::multiplex_impl(void)
// If LLInventoryModel_mIsAgentInvUsable_true then this should be and stay true forever. // If LLInventoryModel_mIsAgentInvUsable_true then this should be and stay true forever.
llassert(gInventory.isInventoryUsable()); llassert(gInventory.isInventoryUsable());
if (mParentFolder.isNull()) if (mParentFolder.isNull())
mParentFolder = gAgent.getInventoryRootID(); mParentFolder = gInventory.getRootFolderID();
if (mFolderUUID.isNull() || !gInventory.getCategory(mFolderUUID)) // Is the UUID unknown, or doesn't exist? if (mFolderUUID.isNull() || !gInventory.getCategory(mFolderUUID)) // Is the UUID unknown, or doesn't exist?
{ {
// Set this to null here in case we abort. // Set this to null here in case we abort.
@@ -116,7 +116,7 @@ void AIFetchInventoryFolder::multiplex_impl(void)
break; break;
} }
// Check if the parent exists. // Check if the parent exists.
if (mParentFolder != gAgent.getInventoryRootID() && !gInventory.getCategory(mParentFolder)) if (mParentFolder != gInventory.getRootFolderID() && !gInventory.getCategory(mParentFolder))
{ {
llwarns << "Unknown parent folder ID " << mParentFolder << llendl; llwarns << "Unknown parent folder ID " << mParentFolder << llendl;
abort(); abort();

View File

@@ -71,7 +71,7 @@ class AIFetchInventoryFolder : public AIStateMachine {
* is set, you will also be able to scan over the contents of the folder * is set, you will also be able to scan over the contents of the folder
* upon successful finish. * upon successful finish.
* *
* @param parentUUID The UUID of the parent. Passing gAgent.getInventoryRootID(), or a null ID, will assume a root folder. * @param parentUUID The UUID of the parent. Passing gInventory.getRootFolderID(), or a null ID, will assume a root folder.
* @param foldername The name of the folder. * @param foldername The name of the folder.
* @param create if set, create the folder if it doesn't exists yet. * @param create if set, create the folder if it doesn't exists yet.
* @param fetch_contents if set, fetch the contents before finishing. * @param fetch_contents if set, fetch the contents before finishing.