From 0db67883470dc3e4381672bfbb40f3ef920a4a01 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 10 Dec 2014 11:09:28 -0500 Subject: STORM-2091 "Empty Trash"/"Empty Lost and Found" menu item is active even if empty --- indra/newview/llinventorybridge.cpp | 16 ++++++++++++++++ indra/newview/llpanelmaininventory.cpp | 10 ++++++++++ .../skins/default/xui/en/menu_inventory_gear_default.xml | 6 ++++++ 3 files changed, 32 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index eebb6a0384..07a14fe53c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3736,6 +3736,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items // This is the lost+found folder. items.push_back(std::string("Empty Lost And Found")); + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array); + if (0 == cat_array->size() && 0 == item_array->size()) + { + disabled_items.push_back(std::string("Empty Lost And Found")); + } + disabled_items.push_back(std::string("New Folder")); disabled_items.push_back(std::string("New Script")); disabled_items.push_back(std::string("New Note")); @@ -3780,6 +3788,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { // This is the trash. items.push_back(std::string("Empty Trash")); + + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array); + if (0 == cat_array->size() && 0 == item_array->size()) + { + disabled_items.push_back(std::string("Empty Trash")); + } } else if(isItemInTrash()) { diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index eb40616a9c..e646d889dd 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1194,6 +1194,16 @@ bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata) BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) { const std::string command_name = userdata.asString(); + if (command_name == "not_empty") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = static_cast(current_item->getViewModelItem())->getUUID(); + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(item_id, cat_array, item_array); + return (0 == cat_array->size() && 0 == item_array->size()); + } if (command_name == "delete") { return getActivePanel()->isSelectionRemovable(); diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml index 06d0b849a3..bccda8a247 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml @@ -95,6 +95,9 @@ + @@ -152,5 +155,8 @@ + -- cgit v1.2.3 From 4422fd381230056cf990129087a131d4c6139120 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 6 Jan 2015 13:21:38 -0500 Subject: STORM-2091 A few small changes per code review requests. --- indra/newview/llinventorybridge.cpp | 2 ++ indra/newview/llpanelmaininventory.cpp | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 07a14fe53c..199c90c705 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3739,6 +3739,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array); + // Enable Empty menu item only when there is something to act upon. if (0 == cat_array->size() && 0 == item_array->size()) { disabled_items.push_back(std::string("Empty Lost And Found")); @@ -3792,6 +3793,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array); + // Enable Empty menu item only when there is something to act upon. if (0 == cat_array->size() && 0 == item_array->size()) { disabled_items.push_back(std::string("Empty Trash")); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e646d889dd..f9ec3df333 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1196,13 +1196,17 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) const std::string command_name = userdata.asString(); if (command_name == "not_empty") { + BOOL status = FALSE; LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); - if (!current_item) return FALSE; - const LLUUID& item_id = static_cast(current_item->getViewModelItem())->getUUID(); - LLInventoryModel::cat_array_t* cat_array; - LLInventoryModel::item_array_t* item_array; - gInventory.getDirectDescendentsOf(item_id, cat_array, item_array); - return (0 == cat_array->size() && 0 == item_array->size()); + if (current_item) + { + const LLUUID& item_id = static_cast(current_item->getViewModelItem())->getUUID(); + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(item_id, cat_array, item_array); + status = (0 == cat_array->size() && 0 == item_array->size()); + } + return status; } if (command_name == "delete") { -- cgit v1.2.3 From 9f88029ca63335f4ab9f920412aa42f90dda204d Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 11 Dec 2014 18:23:23 -0500 Subject: STORM-2092 Add "Copy outfit list to clipboard" for COF folder --- indra/newview/llinventorybridge.cpp | 42 ++++++++++++++++++++++ indra/newview/llinventorybridge.h | 1 + .../skins/default/xui/en/menu_inventory.xml | 8 +++++ 3 files changed, 51 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 199c90c705..e6cd7b9f95 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3092,6 +3092,10 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) LLAppearanceMgr::instance().takeOffOutfit( cat->getLinkedUUID() ); return; } + else if ("copyoutfittoclipboard" == action) + { + copyOutfitToClipboard(); + } else if ("purge" == action) { purgeItem(model, mUUID); @@ -3249,6 +3253,39 @@ void LLFolderBridge::gatherMessage(std::string& message, S32 depth, LLError::ELe } } +void LLFolderBridge::copyOutfitToClipboard() +{ + std::string text; + + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array); + + S32 item_count(0); + if( item_array ) + { + item_count = item_array->size(); + } + + if (item_count) + { + for (S32 i = 0; i < item_count;) + { + LLSD uuid =item_array->at(i)->getUUID(); + LLViewerInventoryItem* item = gInventory.getItem(uuid); + + i++; + if (item != NULL) + { + // Append a newline to all but the last line + text += i != item_count ? item->getName() + "\n" : item->getName(); + } + } + } + + LLClipboard::instance().copyToClipboard(utf8str_to_wstring(text),0,text.size()); +} + void LLFolderBridge::openItem() { LL_DEBUGS() << "LLFolderBridge::openItem()" << LL_ENDL; @@ -3847,6 +3884,11 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } } + if (model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT) == mUUID) + { + items.push_back(std::string("Copy outfit list to clipboard")); + } + //Added by aura to force inventory pull on right-click to display folder options correctly. 07-17-06 mCallingCards = mWearables = FALSE; diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index df25e01688..b7d8c9d034 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -344,6 +344,7 @@ protected: BOOL checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& typeToCheck); void modifyOutfit(BOOL append); + void copyOutfitToClipboard(); void determineFolderType(); void dropToFavorites(LLInventoryItem* inv_item); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 61002bf1b5..5b8a9413bf 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -457,6 +457,14 @@ function="Inventory.DoToSelected" parameter="removefromoutfit" /> + + + -- cgit v1.2.3 From aeb64da07a094a1d398da85b66726a2a4de8ae6b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 6 Jan 2015 10:49:02 -0500 Subject: STORM-2100 Incorrect displays in Script Information window --- indra/newview/llfloaterscriptlimits.cpp | 27 +++++++++++++---- .../skins/default/xui/en/floater_script_limits.xml | 3 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 12 ++++---- .../xui/en/panel_script_limits_my_avatar.xml | 12 ++++---- .../xui/en/panel_script_limits_region_memory.xml | 34 +++++++++++----------- 5 files changed, 52 insertions(+), 36 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index eae16b9f03..56d3a266b1 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -523,6 +523,8 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) LLScrollListCell::Params cell_params; cell_params.font = LLFontGL::getFontSansSerif(); + // Start out right justifying numeric displays + cell_params.font_halign = LLFontGL::RIGHT; cell_params.column = "size"; cell_params.value = size; @@ -532,6 +534,8 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) cell_params.value = urls; item_params.columns.add(cell_params); + cell_params.font_halign = LLFontGL::LEFT; + // The rest of the columns are text to left justify them cell_params.column = "name"; cell_params.value = name_buf; item_params.columns.add(cell_params); @@ -546,7 +550,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) cell_params.column = "location"; cell_params.value = has_locations - ? llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z) + ? llformat("<%0.0f, %0.0f, %0.0f>", location_x, location_y, location_z) : ""; item_params.columns.add(cell_params); @@ -623,13 +627,24 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content) if((mParcelMemoryUsed >= 0) && (mParcelMemoryMax >= 0)) { - S32 parcel_memory_available = mParcelMemoryMax - mParcelMemoryUsed; - LLStringUtil::format_map_t args_parcel_memory; args_parcel_memory["[COUNT]"] = llformat ("%d", mParcelMemoryUsed); - args_parcel_memory["[MAX]"] = llformat ("%d", mParcelMemoryMax); - args_parcel_memory["[AVAILABLE]"] = llformat ("%d", parcel_memory_available); - std::string msg_parcel_memory = LLTrans::getString("ScriptLimitsMemoryUsed", args_parcel_memory); + std::string translate_message; + + if (0 < mParcelMemoryMax) + { + S32 parcel_memory_available = mParcelMemoryMax - mParcelMemoryUsed; + + args_parcel_memory["[MAX]"] = llformat ("%d", mParcelMemoryMax); + args_parcel_memory["[AVAILABLE]"] = llformat ("%d", parcel_memory_available); + translate_message = "ScriptLimitsMemoryUsed"; + } + else + { + translate_message = "ScriptLimitsMemoryUsedSimple"; + } + + std::string msg_parcel_memory = LLTrans::getString(translate_message, args_parcel_memory); getChild("memory_used")->setValue(LLSD(msg_parcel_memory)); } diff --git a/indra/newview/skins/default/xui/en/floater_script_limits.xml b/indra/newview/skins/default/xui/en/floater_script_limits.xml index 6b36cdfcc5..96b2ceec63 100644 --- a/indra/newview/skins/default/xui/en/floater_script_limits.xml +++ b/indra/newview/skins/default/xui/en/floater_script_limits.xml @@ -8,7 +8,8 @@ name="scriptlimits" save_rect="true" title="SCRIPT INFORMATION" - width="480"> + min_width="620" + width="620"> @@ -425,7 +425,7 @@ parameter="destinations" /> @@ -448,7 +448,7 @@ parameter="mini_map" /> + width="620"> + width="620"> Avatar Script Usage + width="620"> + width="620"> + width="620"> Loading... + width="600"> + width="620"> + width="620"> Parcel Script Memory + width="620"> + width="620"> + width="620"> + width="620"> Loading... + width="600">