diff options
author | Wolfpup Lowenhar <wolfpup67@earthlink.net> | 2010-10-27 22:25:41 -0400 |
---|---|---|
committer | Wolfpup Lowenhar <wolfpup67@earthlink.net> | 2010-10-27 22:25:41 -0400 |
commit | 9bd439e7c711de25ac65843c24575734f53f092f (patch) | |
tree | c54b7b52d5e81222b5f6590041dee0cfe5246f89 /indra/newview | |
parent | 379f9b824087a44f7ffab0becfafaa29611751be (diff) | |
parent | 158e647247f67344a5d7a9dde6ccc80bad615c9a (diff) |
STORM-255 : Merge from viewer-development
Diffstat (limited to 'indra/newview')
18 files changed, 105 insertions, 135 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 68e408d3e4..7c953cd2dc 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -296,8 +296,11 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera) LLSelectMgr::getInstance()->deselectAll(); } - // Hide all popup menus - gMenuHolder->hideMenus(); + if (gMenuHolder != NULL) + { + // Hide all popup menus + gMenuHolder->hideMenus(); + } } if (change_camera && !gSavedSettings.getBOOL("FreezeTime")) diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 260e15c714..f990b9294d 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -128,7 +128,7 @@ bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item) switch(item->getType()) { case LLAssetType::AT_OBJECT: - if (gAgentAvatarp->isWearingAttachment(item->getUUID())) + if (get_is_item_worn(item->getUUID())) { acceptable = false; } @@ -139,7 +139,7 @@ bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item) BOOL copyable = false; if (item->getPermissions().allowCopyBy(gAgentID)) copyable = true; - if (!copyable && gAgentWearables.isWearingItem(item->getUUID())) + if (!copyable && get_is_item_worn(item->getUUID())) { acceptable = false; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b15dcd993a..e672892282 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1649,10 +1649,12 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const LLUUID &cat_id = inv_cat->getUUID(); const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false); const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); + const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); const BOOL move_is_into_outfit = getCategory() && (getCategory()->getPreferredType() == LLFolderType::FT_OUTFIT); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); //-------------------------------------------------------------------------------- // Determine if folder can be moved. @@ -1690,6 +1692,21 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } + if (move_is_into_landmarks) + { + for (S32 i=0; i < descendent_items.count(); ++i) + { + LLViewerInventoryItem* item = descendent_items[i]; + + // Don't move anything except landmarks and categories into Landmarks folder. + // We use getType() instead of getActua;Type() to allow links to landmarks and folders. + if (LLAssetType::AT_LANDMARK != item->getType() && LLAssetType::AT_CATEGORY != item->getType()) + { + is_movable = FALSE; + break; // It's generally movable, but not into Landmarks. + } + } + } // //-------------------------------------------------------------------------------- @@ -2661,6 +2678,8 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data) { + LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data; + //llinfos << "LLFolderBridge::dragOrDrop()" << llendl; BOOL accept = FALSE; switch(cargo_type) @@ -2676,9 +2695,24 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: + accept = dragItemIntoFolder(inv_item, drop); + break; case DAD_LINK: - accept = dragItemIntoFolder((LLInventoryItem*)cargo_data, - drop); + // DAD_LINK type might mean one of two asset types: AT_LINK or AT_LINK_FOLDER. + // If we have an item of AT_LINK_FOLDER type we should process the linked + // category being dragged or dropped into folder. + if (inv_item && LLAssetType::AT_LINK_FOLDER == inv_item->getActualType()) + { + LLInventoryCategory* linked_category = gInventory.getCategory(inv_item->getLinkedUUID()); + if (linked_category) + { + accept = dragCategoryIntoFolder((LLInventoryCategory*)linked_category, drop); + } + } + else + { + accept = dragItemIntoFolder(inv_item, drop); + } break; case DAD_CATEGORY: if (LLFriendCardsManager::instance().isAnyFriendCategory(mUUID)) @@ -2875,6 +2909,24 @@ static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_curr return TRUE; } +// Returns TRUE if item is a landmark or a link to a landmark +// and can be moved to Favorites or Landmarks folder. +static BOOL can_move_to_landmarks(LLInventoryItem* inv_item) +{ + // Need to get the linked item to know its type because LLInventoryItem::getType() + // returns actual type AT_LINK for links, not the asset type of a linked item. + if (LLAssetType::AT_LINK == inv_item->getType()) + { + LLInventoryItem* linked_item = gInventory.getItem(inv_item->getLinkedUUID()); + if (linked_item) + { + return LLAssetType::AT_LANDMARK == linked_item->getType(); + } + } + + return LLAssetType::AT_LANDMARK == inv_item->getType(); +} + void LLFolderBridge::dropToFavorites(LLInventoryItem* inv_item) { // use callback to rearrange favorite landmarks after adding @@ -2931,9 +2983,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false); + const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + const BOOL move_is_into_favorites = (mUUID == favorites_id); const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); + const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL accept = FALSE; @@ -2944,7 +2999,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); const BOOL move_is_outof_current_outfit = LLAppearanceMgr::instance().getIsInCOF(inv_item->getUUID()); - const BOOL folder_allows_reorder = (mUUID == favorites_id); //-------------------------------------------------------------------------------- // Determine if item can be moved. @@ -2990,12 +3044,16 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (!is_movable) accept = FALSE; - if ((mUUID == inv_item->getParentUUID()) && !folder_allows_reorder) + if ((mUUID == inv_item->getParentUUID()) && !move_is_into_favorites) accept = FALSE; if (move_is_into_current_outfit || move_is_into_outfit) { accept = can_move_to_outfit(inv_item, move_is_into_current_outfit); } + else if (move_is_into_favorites || move_is_into_landmarks) + { + accept = can_move_to_landmarks(inv_item); + } if(accept && drop) { @@ -3021,8 +3079,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // // REORDER - // (only reorder the item) - if ((mUUID == inv_item->getParentUUID()) && folder_allows_reorder) + // (only reorder the item in Favorites folder) + if ((mUUID == inv_item->getParentUUID()) && move_is_into_favorites) { LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); LLFolderViewItem* itemp = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL; @@ -3036,7 +3094,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // FAVORITES folder // (copy the item) - else if (favorites_id == mUUID) + else if (move_is_into_favorites) { dropToFavorites(inv_item); } @@ -3101,6 +3159,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = FALSE; } + // Don't allow to move a single item to Favorites or Landmarks + // if it is not a landmark or a link to a landmark. + else if ((move_is_into_favorites || move_is_into_landmarks) + && !can_move_to_landmarks(inv_item)) + { + accept = FALSE; + } if(drop && accept) { @@ -3146,12 +3211,18 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = can_move_to_outfit(inv_item, move_is_into_current_outfit); } + // Don't allow to move a single item to Favorites or Landmarks + // if it is not a landmark or a link to a landmark. + else if (move_is_into_favorites || move_is_into_landmarks) + { + accept = can_move_to_landmarks(inv_item); + } if (accept && drop) { // FAVORITES folder // (copy the item) - if (favorites_id == mUUID) + if (move_is_into_favorites) { dropToFavorites(inv_item); } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f3d9639dee..ef20869114 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -487,12 +487,9 @@ bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(const LLInventoryIte return false; break; case LLAssetType::AT_OBJECT: - if (isAgentAvatarValid() && !gAgentAvatarp->isWearingAttachment(item->getUUID())) - return true; - break; case LLAssetType::AT_BODYPART: case LLAssetType::AT_CLOTHING: - if(!gAgentWearables.isWearingItem(item->getUUID())) + if (!get_is_item_worn(item->getUUID())) return true; break; default: diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index 408270a1a0..29e262199e 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -205,24 +205,6 @@ BOOL LLPlacesFolderView::handleRightMouseDown(S32 x, S32 y, MASK mask) return LLFolderView::handleRightMouseDown(x, y, mask); } -BOOL LLPlacesFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg) -{ - // Don't accept anything except landmarks and folders to be dropped - // in places folder view. See STORM-296. - if (cargo_type != DAD_LANDMARK && cargo_type != DAD_CATEGORY) - { - *accept = ACCEPT_NO; - return FALSE; - } - - return LLFolderView::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, - accept, tooltip_msg); -} - void LLPlacesFolderView::setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle) { mMenuHandlesByInventoryType[asset_type] = menu_handle; diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h index a44776d18b..6641871a0b 100644 --- a/indra/newview/llplacesinventorypanel.h +++ b/indra/newview/llplacesinventorypanel.h @@ -70,12 +70,6 @@ public: */ /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); - /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg); - void setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle); void setParentLandmarksPanel(LLLandmarksPanel* panel) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 68935d536b..1778eaed68 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -221,8 +221,6 @@ BOOL check_show_xui_names(void *); // Debug UI void handle_buy_currency_test(void*); -void handle_save_to_xml(void*); -void handle_load_from_xml(void*); void handle_god_mode(void*); @@ -1384,37 +1382,6 @@ class LLAdvancedCheckDebugWindowProc : public view_listener_t // ------------------------------XUI MENU --------------------------- -////////////////////// -// LOAD UI FROM XML // -////////////////////// - - -class LLAdvancedLoadUIFromXML : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - handle_load_from_xml(NULL); - return true; -} -}; - - - -//////////////////// -// SAVE UI TO XML // -//////////////////// - - -class LLAdvancedSaveUIToXML : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - handle_save_to_xml(NULL); - return true; -} -}; - - class LLAdvancedSendTestIms : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -7188,44 +7155,6 @@ const LLRect LLViewerMenuHolderGL::getMenuRect() const return LLRect(0, getRect().getHeight() - MENU_BAR_HEIGHT, getRect().getWidth(), STATUS_BAR_HEIGHT); } -void handle_save_to_xml(void*) -{ - LLFloater* frontmost = gFloaterView->getFrontmost(); - if (!frontmost) - { - LLNotificationsUtil::add("NoFrontmostFloater"); - return; - } - - std::string default_name = "floater_"; - default_name += frontmost->getTitle(); - default_name += ".xml"; - - LLStringUtil::toLower(default_name); - LLStringUtil::replaceChar(default_name, ' ', '_'); - LLStringUtil::replaceChar(default_name, '/', '_'); - LLStringUtil::replaceChar(default_name, ':', '_'); - LLStringUtil::replaceChar(default_name, '"', '_'); - - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getSaveFile(LLFilePicker::FFSAVE_XML, default_name)) - { - std::string filename = picker.getFirstFile(); - LLUICtrlFactory::getInstance()->saveToXML(frontmost, filename); - } -} - -void handle_load_from_xml(void*) -{ - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) - { - std::string filename = picker.getFirstFile(); - LLFloater* floater = new LLFloater(LLSD()); - floater->buildFromFile(filename); - } -} - void handle_web_browser_test(const LLSD& param) { std::string url = param.asString(); @@ -8011,8 +7940,6 @@ void initialize_menus() // Advanced > XUI commit.add("Advanced.ReloadColorSettings", boost::bind(&LLUIColorTable::loadFromSettings, LLUIColorTable::getInstance())); - view_listener_t::addMenu(new LLAdvancedLoadUIFromXML(), "Advanced.LoadUIFromXML"); - view_listener_t::addMenu(new LLAdvancedSaveUIToXML(), "Advanced.SaveUIToXML"); view_listener_t::addMenu(new LLAdvancedToggleXUINames(), "Advanced.ToggleXUINames"); view_listener_t::addMenu(new LLAdvancedCheckXUINames(), "Advanced.CheckXUINames"); view_listener_t::addMenu(new LLAdvancedSendTestIms(), "Advanced.SendTestIMs"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index ce628d93b5..43058a5ee3 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2761,18 +2761,6 @@ function="Floater.Show" parameter="font_test" /> </menu_item_call> - <menu_item_call - label="Load from XML" - name="Load from XML"> - <menu_item_call.on_click - function="Advanced.LoadUIFromXML" /> - </menu_item_call> - <menu_item_call - label="Save to XML" - name="Save to XML"> - <menu_item_call.on_click - function="Advanced.SaveUIToXML" /> - </menu_item_call> <menu_item_check label="Show XUI Names" name="Show XUI Names"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 83cbcb3344..4ee04b44b6 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1367,6 +1367,14 @@ Could not find 'data' chunk in WAV header: <notification icon="alertmodal.tga" + name="SoundFileInvalidChunkSize" + type="alertmodal"> +Wrong chunk size in WAV file: +[FILE] + </notification> + + <notification + icon="alertmodal.tga" name="SoundFileInvalidTooLong" type="alertmodal"> Audio file is too long (10 second maximum): diff --git a/indra/newview/skins/default/xui/en/panel_edit_gloves.xml b/indra/newview/skins/default/xui/en/panel_edit_gloves.xml index a490f27b9f..8c0c543d71 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_gloves.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_gloves.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_jacket.xml b/indra/newview/skins/default/xui/en/panel_edit_jacket.xml index 929cdffb3d..8e8d8e6505 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_jacket.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_jacket.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Upper Fabric" + label="Upper Texture" layout="topleft" left="25" name="Upper Fabric" @@ -41,7 +41,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Lower Fabric" + label="Lower Texture" layout="topleft" left_pad="20" name="Lower Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_pants.xml b/indra/newview/skins/default/xui/en/panel_edit_pants.xml index f22cf983aa..dd749a9259 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pants.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pants.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_shirt.xml b/indra/newview/skins/default/xui/en/panel_edit_shirt.xml index 85823073b5..5424b805e1 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_shirt.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_shirt.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_shoes.xml b/indra/newview/skins/default/xui/en/panel_edit_shoes.xml index b26fde68f1..859e7454a4 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_shoes.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_shoes.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_skirt.xml b/indra/newview/skins/default/xui/en/panel_edit_skirt.xml index bb8e0dca07..76d66cc5dc 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_skirt.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_skirt.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_socks.xml b/indra/newview/skins/default/xui/en/panel_edit_socks.xml index d813d94d93..5f978174b3 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_socks.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_socks.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_underpants.xml b/indra/newview/skins/default/xui/en/panel_edit_underpants.xml index 19225e9757..16f28377fb 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_underpants.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_underpants.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" diff --git a/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml b/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml index 720a55dcc2..059485cfb4 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml @@ -26,7 +26,7 @@ default_image_name="Default" follows="left|top" height="80" - label="Fabric" + label="Texture" layout="topleft" left="10" name="Fabric" |