From 8f9e76c53c662fd06b1a88288cc84f54e465be8e Mon Sep 17 00:00:00 2001 From: RevolutionSmythe Date: Tue, 26 Oct 2010 16:08:09 -0500 Subject: Bug fixes for earlier commits. Adds cut to the inventory panel along with copy and paste. --- linden/indra/newview/hippoLimits.cpp | 24 +++++++++-- linden/indra/newview/hippoLimits.h | 3 +- linden/indra/newview/llfloatertools.cpp | 2 +- linden/indra/newview/llinventoryactions.cpp | 5 +++ linden/indra/newview/llinventorybridge.cpp | 49 ++++++++++++++++++++++ linden/indra/newview/llinventorybridge.h | 1 + linden/indra/newview/llinventoryclipboard.cpp | 18 +++++++- linden/indra/newview/llinventoryclipboard.h | 7 ++++ linden/indra/newview/llmaniptranslate.cpp | 15 +++---- .../skins/default/xui/en-us/menu_inventory.xml | 12 ++++-- linden/indra/newview/wlsettingsmanager.cpp | 4 +- 11 files changed, 119 insertions(+), 21 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/hippoLimits.cpp b/linden/indra/newview/hippoLimits.cpp index 88b86a9..78a5856 100644 --- a/linden/indra/newview/hippoLimits.cpp +++ b/linden/indra/newview/hippoLimits.cpp @@ -173,7 +173,7 @@ F32 HippoLimits::getMinPrimXPos() const { if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) { - return FLT_MAX; + return FLT_MIN; } else { @@ -185,7 +185,7 @@ F32 HippoLimits::getMinPrimYPos() const { if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) { - return FLT_MAX; + return FLT_MIN; } else { @@ -197,10 +197,28 @@ F32 HippoLimits::getMinPrimZPos() const { if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) { - return FLT_MAX; + return FLT_MIN; } else { return mMinPrimZPos; } } + +F32 HippoLimits::getMaxDragDistance() const +{ + if (mMaxDragDistance == 0) + { + return FLT_MAX; + } + else + { + F32 max_drag_distance = gSavedSettings.getBOOL("LimitDragDistance") ? gSavedSettings.getF32("MaxDragDistance") : FLT_MAX; + + if(max_drag_distance > gHippoLimits->getMaxDragDistance()) //Chose the more restrictive + { + max_drag_distance = gHippoLimits->getMaxDragDistance(); + } + return max_drag_distance; + } +} \ No newline at end of file diff --git a/linden/indra/newview/hippoLimits.h b/linden/indra/newview/hippoLimits.h index a5493eb..7792a2c 100644 --- a/linden/indra/newview/hippoLimits.h +++ b/linden/indra/newview/hippoLimits.h @@ -12,7 +12,6 @@ public: const F32& getMinHoleSize() const { return mMinHoleSize; } const F32& getMaxHollow() const { return mMaxHollow; } const S32& getMaxLinkedPrims() const { return mMaxLinkedPrims; } - const F32& getMaxDragDistance() const { return mMaxDragDistance; } const S32& getMaxPhysLinkedPrims() const { return mMaxPhysLinkedPrims; } const F32& getMaxInventoryItemsTransfer() const { return mMaxInventoryItemsTransfer; } @@ -21,6 +20,8 @@ public: F32 getMinPrimScale() const; F32 getMaxPrimScale() const; + F32 getMaxDragDistance() const; + F32 getMinPrimXPos() const; F32 getMinPrimYPos() const; F32 getMinPrimZPos() const; diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index c092f5a..2f02f1e 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp @@ -195,7 +195,7 @@ void LLFloaterTools::updateToolsSizeLimits() getChild("Pos X")->setMaxValue(gHippoLimits->getMaxPrimXPos()); getChild("Pos Y")->setMaxValue(gHippoLimits->getMaxPrimYPos()); - getChild("Pos Z")->setMaxValue(gHippoLimits->getMinPrimZPos()); + getChild("Pos Z")->setMaxValue(gHippoLimits->getMaxPrimZPos()); getChild("Physical Checkbox Ctrl")->setEnabled(gHippoLimits->mAllowPhysicalPrims); } diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp index 7ae96ad..25a4a4b 100644 --- a/linden/indra/newview/llinventoryactions.cpp +++ b/linden/indra/newview/llinventoryactions.cpp @@ -119,6 +119,11 @@ bool doToSelected(LLFolderView* folder, std::string action) LLInventoryClipboard::instance().reset(); } + if ("cut" == action) + { + LLInventoryClipboard::instance().reset(); + } + std::set selected_items; folder->getSelectionList(selected_items); diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index b1627b5..f71df2d 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -463,6 +463,12 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, std::vector(NULL)); } } + //Do cuts as well + LLInventoryClipboard::instance().retrieveCuts(objects); + count = objects.count(); + parent_id = mUUID; + for(S32 i = 0; i < count; i++) + { + item = model->getItem(objects.get(i)); + if (item) + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + parent_id, + std::string(), + LLPointer(NULL)); + LLInventoryCategory* cat = model->getCategory(item->getUUID()); + if(cat) + { + model->purgeDescendentsOf(mUUID); + } + LLInventoryObject* obj = model->getObject(item->getUUID()); + if(!obj) return; + obj->removeFromServer(); + LLPreview::hide(item->getUUID()); + model->deleteObject(item->getUUID()); + model->notifyObservers(); + } + } } } diff --git a/linden/indra/newview/llinventorybridge.h b/linden/indra/newview/llinventorybridge.h index 45486ed..2004678 100644 --- a/linden/indra/newview/llinventorybridge.h +++ b/linden/indra/newview/llinventorybridge.h @@ -297,6 +297,7 @@ public: virtual BOOL removeItem(); virtual BOOL isItemCopyable() const; virtual BOOL copyToClipboard() const; + virtual BOOL cutToClipboard() const; virtual BOOL hasChildren() const { return FALSE; } virtual BOOL isUpToDate() const { return TRUE; } diff --git a/linden/indra/newview/llinventoryclipboard.cpp b/linden/indra/newview/llinventoryclipboard.cpp index 94ffcbd..95c22aa 100644 --- a/linden/indra/newview/llinventoryclipboard.cpp +++ b/linden/indra/newview/llinventoryclipboard.cpp @@ -60,6 +60,11 @@ void LLInventoryClipboard::add(const LLUUID& object) mObjects.put(object); } +void LLInventoryClipboard::addCut(const LLUUID& object) +{ + mCutObjects.put(object); +} + // this stores a single inventory object void LLInventoryClipboard::store(const LLUUID& object) { @@ -87,15 +92,26 @@ void LLInventoryClipboard::retrieve(LLDynamicArray& inv_objects) const } } +void LLInventoryClipboard::retrieveCuts(LLDynamicArray& inv_objects) const +{ + inv_objects.reset(); + S32 count = mCutObjects.count(); + for(S32 i = 0; i < count; i++) + { + inv_objects.put(mCutObjects[i]); + } +} + void LLInventoryClipboard::reset() { mObjects.reset(); + mCutObjects.reset(); } // returns true if the clipboard has something pasteable in it. BOOL LLInventoryClipboard::hasContents() const { - return (mObjects.count() > 0); + return (mObjects.count() > 0) || (mCutObjects.count() > 0); } diff --git a/linden/indra/newview/llinventoryclipboard.h b/linden/indra/newview/llinventoryclipboard.h index 7a2cf15..99e8450 100644 --- a/linden/indra/newview/llinventoryclipboard.h +++ b/linden/indra/newview/llinventoryclipboard.h @@ -54,6 +54,8 @@ public: // this method adds to the current list. void add(const LLUUID& object); + void addCut(const LLUUID& object); + // this stores a single inventory object void store(const LLUUID& object); @@ -64,6 +66,10 @@ public: // into the array provided. void retrieve(LLDynamicArray& inventory_objects) const; + // this method gets the objects in the clipboard by copying them + // into the array provided. + void retrieveCuts(LLDynamicArray& inventory_objects) const; + // this method empties out the clipboard void reset(); @@ -74,6 +80,7 @@ protected: static LLInventoryClipboard sInstance; LLDynamicArray mObjects; + LLDynamicArray mCutObjects; public: // please don't actually call these diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp index aada658..cc14b27 100644 --- a/linden/indra/newview/llmaniptranslate.cpp +++ b/linden/indra/newview/llmaniptranslate.cpp @@ -529,16 +529,13 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) relative_move -= mDragCursorStartGlobal; // You can't move more than some distance from your original mousedown point. - if (gSavedSettings.getBOOL("LimitDragDistance")) - { - F32 max_drag_distance = gSavedSettings.getF32("MaxDragDistance"); + F32 max_drag_distance = gHippoLimits->getMaxDragDistance(); - if(max_drag_distance < gHippoLimits->getMaxDragDistance()) max_drag_distance = gHippoLimits->getMaxDragDistance(); //Take the more restrictive if (relative_move.magVecSquared() > max_drag_distance * max_drag_distance) - { - lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (too far)" << llendl; - gViewerWindow->setCursor(UI_CURSOR_NOLOCKED); - return TRUE; - } + if (max_drag_distance != FLT_MAX && relative_move.magVecSquared() > max_drag_distance * max_drag_distance) + { + lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (too far)" << llendl; + gViewerWindow->setCursor(UI_CURSOR_NOLOCKED); + return TRUE; } F64 axis_magnitude = relative_move * axis_d; // dot product diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml b/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml index 1ae7465..86dc5c7 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml @@ -166,11 +166,15 @@ - + + + - - - + + diff --git a/linden/indra/newview/wlsettingsmanager.cpp b/linden/indra/newview/wlsettingsmanager.cpp index 78516df..ea37f61 100644 --- a/linden/indra/newview/wlsettingsmanager.cpp +++ b/linden/indra/newview/wlsettingsmanager.cpp @@ -178,7 +178,7 @@ void WLSettingsManager::Apply() fade = mSky->getFloat("fade", error); mWater->mName = wlWaterPresetName; - if(fade != 0) + if(fade != 0 && water_mgr->mCurParams.mName == wlWaterPresetName)//Load the settings forcefully the first time { LLWaterParamSet oldWset = water_mgr->mCurParams; //This still needs done so that we update right, but load it to the old @@ -201,7 +201,7 @@ void WLSettingsManager::Apply() } mSky->mName = wlSkyPresetName; - if(fade != 0) + if(fade != 0 && sky_mgr->mCurParams.mName == wlSkyPresetName)//Load the settings forcefully the first time { LLWLParamSet oldset = sky_mgr->mCurParams; //This still needs done so that we update right, but load it to the old -- cgit v1.1