Merge branch 'DRTVWR-518-ui' of https://bitbucket.org/lindenlab/viewer
commit
f206994f46
|
|
@ -1455,6 +1455,10 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
|
|||
|
||||
LLNotificationsUtil::add("RenameLandmark", args, payload, boost::bind(onRenameCommit, _1, _2));
|
||||
}
|
||||
else if (action == "move_to_landmarks")
|
||||
{
|
||||
change_item_parent(mSelectedItemID, gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK));
|
||||
}
|
||||
|
||||
// Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item).
|
||||
// See EXT-4217 and STORM-207.
|
||||
|
|
|
|||
|
|
@ -1964,6 +1964,26 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
|
|||
return result && !has_bad_items;
|
||||
}
|
||||
|
||||
void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id)
|
||||
{
|
||||
LLInventoryItem* inv_item = gInventory.getItem(item_id);
|
||||
if (inv_item)
|
||||
{
|
||||
LLInventoryModel::update_list_t update;
|
||||
LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1);
|
||||
update.push_back(old_folder);
|
||||
LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
|
||||
update.push_back(new_folder);
|
||||
gInventory.accountForUpdate(update);
|
||||
|
||||
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(inv_item);
|
||||
new_item->setParent(new_parent_id);
|
||||
new_item->updateParentOnServer(FALSE);
|
||||
gInventory.updateItem(new_item);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// LLInventoryCollectFunctor implementations
|
||||
///----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -99,6 +99,8 @@ S32 depth_nesting_in_marketplace(LLUUID cur_uuid);
|
|||
LLUUID nested_parent_id(LLUUID cur_uuid, S32 depth);
|
||||
S32 compute_stock_count(LLUUID cat_uuid, bool force_count = false);
|
||||
|
||||
void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id);
|
||||
|
||||
/** Miscellaneous global functions
|
||||
** **
|
||||
*******************************************************************************/
|
||||
|
|
|
|||
|
|
@ -626,6 +626,8 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
|
|||
? mCurrentSelectedList->getRootFolder()
|
||||
: NULL;
|
||||
|
||||
bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1;
|
||||
|
||||
if ("collapse_all" == command_name)
|
||||
{
|
||||
return has_expanded_folders(mCurrentSelectedList->getRootFolder());
|
||||
|
|
@ -680,7 +682,6 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
|
|||
)
|
||||
{
|
||||
// disable some commands for multi-selection. EXT-1757
|
||||
bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1;
|
||||
if (!is_single_selection)
|
||||
{
|
||||
return false;
|
||||
|
|
@ -729,7 +730,6 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
|
|||
}
|
||||
else if ("add_landmark" == command_name)
|
||||
{
|
||||
bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1;
|
||||
if (!is_single_selection)
|
||||
{
|
||||
return false;
|
||||
|
|
@ -776,6 +776,36 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
|
|||
}
|
||||
return true;
|
||||
}
|
||||
else if (command_name == "move_to_landmarks" || command_name == "move_to_favorites")
|
||||
{
|
||||
LLFolderViewModelItemInventory* cur_item_model = getCurSelectedViewModelItem();
|
||||
if (cur_item_model)
|
||||
{
|
||||
LLFolderType::EType folder_type = command_name == "move_to_landmarks" ? LLFolderType::FT_FAVORITE : LLFolderType::FT_LANDMARK;
|
||||
if (!gInventory.isObjectDescendentOf(cur_item_model->getUUID(), gInventory.findCategoryUUIDForType(folder_type)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (root_folder_view)
|
||||
{
|
||||
std::set<LLFolderViewItem*> selected_uuids = root_folder_view->getSelectionList();
|
||||
for (std::set<LLFolderViewItem*>::const_iterator iter = selected_uuids.begin(); iter != selected_uuids.end(); ++iter)
|
||||
{
|
||||
LLFolderViewItem* item = *iter;
|
||||
if (!item) return false;
|
||||
|
||||
cur_item_model = static_cast<LLFolderViewModelItemInventory*>(item->getViewModelItem());
|
||||
if (!cur_item_model || cur_item_model->getInventoryType() != LLInventoryType::IT_LANDMARK)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Unprocessed command has come: " << command_name << LL_ENDL;
|
||||
|
|
@ -815,6 +845,28 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata)
|
|||
{
|
||||
mCurrentSelectedList->doToSelected(userdata);
|
||||
}
|
||||
else if (command_name == "move_to_landmarks" || command_name == "move_to_favorites")
|
||||
{
|
||||
LLFolderView* root_folder_view = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : NULL;
|
||||
if (root_folder_view)
|
||||
{
|
||||
LLFolderType::EType folder_type = command_name == "move_to_landmarks" ? LLFolderType::FT_LANDMARK : LLFolderType::FT_FAVORITE;
|
||||
std::set<LLFolderViewItem*> selected_uuids = root_folder_view->getSelectionList();
|
||||
for (std::set<LLFolderViewItem*>::const_iterator iter = selected_uuids.begin(); iter != selected_uuids.end(); ++iter)
|
||||
{
|
||||
LLFolderViewItem* item = *iter;
|
||||
if (item)
|
||||
{
|
||||
LLFolderViewModelItemInventory* item_model = static_cast<LLFolderViewModelItemInventory*>(item->getViewModelItem());
|
||||
if (item_model)
|
||||
{
|
||||
change_item_parent(item_model->getUUID(), gInventory.findCategoryUUIDForType(folder_type));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void LLLandmarksPanel::onMenuVisibilityChange(LLUICtrl* ctrl, const LLSD& param)
|
||||
|
|
|
|||
|
|
@ -289,6 +289,12 @@ LLPanelOutfitsInventory* LLPanelOutfitsInventory::findInstance()
|
|||
return dynamic_cast<LLPanelOutfitsInventory*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfits_inventory"));
|
||||
}
|
||||
|
||||
void LLPanelOutfitsInventory::openApearanceTab(const std::string& tab_name)
|
||||
{
|
||||
if (!mAppearanceTabs) return;
|
||||
mAppearanceTabs->selectTabByName(tab_name);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// List Commands //
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,8 @@ public:
|
|||
|
||||
static LLPanelOutfitsInventory* findInstance();
|
||||
|
||||
void openApearanceTab(const std::string& tab_name);
|
||||
|
||||
// <FS:Ansariel> Show avatar complexity in appearance floater
|
||||
void updateAvatarComplexity(U32 complexity, const std::map<LLUUID, U32>& item_complexity, const std::map<LLUUID, U32>& temp_item_complexity, U32 body_parts_complexity);
|
||||
|
||||
|
|
|
|||
|
|
@ -169,8 +169,12 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
|
|||
std::string type = key["type"].asString();
|
||||
if (type == "my_outfits")
|
||||
{
|
||||
showOutfitsInventoryPanel();
|
||||
showOutfitsInventoryPanel("outfitslist_tab");
|
||||
}
|
||||
else if (type == "now_wearing")
|
||||
{
|
||||
showOutfitsInventoryPanel("cof_tab");
|
||||
}
|
||||
else if (type == "edit_outfit")
|
||||
{
|
||||
showOutfitEditPanel();
|
||||
|
|
@ -292,7 +296,14 @@ void LLSidepanelAppearance::showOutfitsInventoryPanel()
|
|||
{
|
||||
toggleWearableEditPanel(FALSE);
|
||||
toggleOutfitEditPanel(FALSE);
|
||||
toggleMyOutfitsPanel(TRUE);
|
||||
toggleMyOutfitsPanel(TRUE, "");
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::showOutfitsInventoryPanel(const std::string &tab_name)
|
||||
{
|
||||
toggleWearableEditPanel(FALSE);
|
||||
toggleOutfitEditPanel(FALSE);
|
||||
toggleMyOutfitsPanel(TRUE, tab_name);
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::showOutfitEditPanel()
|
||||
|
|
@ -317,37 +328,42 @@ void LLSidepanelAppearance::showOutfitEditPanel()
|
|||
return;
|
||||
}
|
||||
|
||||
toggleMyOutfitsPanel(FALSE);
|
||||
toggleMyOutfitsPanel(FALSE, "");
|
||||
toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode
|
||||
toggleOutfitEditPanel(TRUE);
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::showWearableEditPanel(LLViewerWearable *wearable /* = NULL*/, BOOL disable_camera_switch)
|
||||
{
|
||||
toggleMyOutfitsPanel(FALSE);
|
||||
toggleMyOutfitsPanel(FALSE, "");
|
||||
toggleOutfitEditPanel(FALSE, TRUE); // don't switch out of edit appearance mode
|
||||
toggleWearableEditPanel(TRUE, wearable, disable_camera_switch);
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible)
|
||||
void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string& tab_name)
|
||||
{
|
||||
if (!mPanelOutfitsInventory || mPanelOutfitsInventory->getVisible() == visible)
|
||||
{
|
||||
// visibility isn't changing, hence nothing to do
|
||||
return;
|
||||
}
|
||||
if (!mPanelOutfitsInventory
|
||||
|| (mPanelOutfitsInventory->getVisible() == visible && tab_name.empty()))
|
||||
{
|
||||
// visibility isn't changing, hence nothing to do
|
||||
return;
|
||||
}
|
||||
|
||||
mPanelOutfitsInventory->setVisible(visible);
|
||||
mPanelOutfitsInventory->setVisible(visible);
|
||||
|
||||
// *TODO: Move these controls to panel_outfits_inventory.xml
|
||||
// so that we don't need to toggle them explicitly.
|
||||
mFilterEditor->setVisible(visible);
|
||||
mCurrOutfitPanel->setVisible(visible);
|
||||
// *TODO: Move these controls to panel_outfits_inventory.xml
|
||||
// so that we don't need to toggle them explicitly.
|
||||
mFilterEditor->setVisible(visible);
|
||||
mCurrOutfitPanel->setVisible(visible);
|
||||
|
||||
if (visible)
|
||||
{
|
||||
mPanelOutfitsInventory->onOpen(LLSD());
|
||||
}
|
||||
if (visible)
|
||||
{
|
||||
mPanelOutfitsInventory->onOpen(LLSD());
|
||||
if (!tab_name.empty())
|
||||
{
|
||||
mPanelOutfitsInventory->openApearanceTab(tab_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch)
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ public:
|
|||
void fetchInventory();
|
||||
void inventoryFetched();
|
||||
|
||||
void showOutfitsInventoryPanel();
|
||||
void showOutfitsInventoryPanel(); // last selected
|
||||
void showOutfitsInventoryPanel(const std::string& tab_name);
|
||||
void showOutfitEditPanel();
|
||||
void showWearableEditPanel(LLViewerWearable *wearable = NULL, BOOL disable_camera_switch = FALSE);
|
||||
void setWearablesLoading(bool val);
|
||||
|
|
@ -90,7 +91,7 @@ private:
|
|||
void onOpenOutfitButtonClicked();
|
||||
void onEditAppearanceButtonClicked();
|
||||
|
||||
void toggleMyOutfitsPanel(BOOL visible);
|
||||
void toggleMyOutfitsPanel(BOOL visible, const std::string& tab_name);
|
||||
void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE);
|
||||
void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = NULL, BOOL disable_camera_switch = FALSE);
|
||||
|
||||
|
|
|
|||
|
|
@ -7901,6 +7901,11 @@ void handle_edit_outfit()
|
|||
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_outfit"));
|
||||
}
|
||||
|
||||
void handle_now_wearing()
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "now_wearing"));
|
||||
}
|
||||
|
||||
void handle_edit_shape()
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_shape"));
|
||||
|
|
@ -11579,6 +11584,7 @@ void initialize_menus()
|
|||
view_listener_t::addMenu(new LLEnableHoverHeight(), "Edit.EnableHoverHeight");
|
||||
view_listener_t::addMenu(new LLEnableEditPhysics(), "Edit.EnableEditPhysics");
|
||||
commit.add("CustomizeAvatar", boost::bind(&handle_customize_avatar));
|
||||
commit.add("NowWearing", boost::bind(&handle_now_wearing));
|
||||
commit.add("EditOutfit", boost::bind(&handle_edit_outfit));
|
||||
commit.add("EditShape", boost::bind(&handle_edit_shape));
|
||||
commit.add("HoverHeight", boost::bind(&handle_hover_height));
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
name="title"
|
||||
text_color="LtGray"
|
||||
top="0"
|
||||
value="Edit Outfit"
|
||||
value="Edit Outfit Parts"
|
||||
use_ellipses="true"
|
||||
width="360" />
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,14 @@ name="Stand Up">
|
|||
function="Self.EnableStandUp" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Now wearing..."
|
||||
name="NowWearing">
|
||||
<menu_item_call.on_click
|
||||
function="NowWearing" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Change Outfit"
|
||||
name="Change Outfit">
|
||||
<menu_item_call.on_click
|
||||
|
|
@ -95,22 +103,22 @@ name="Stand Up">
|
|||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Edit Outfit"
|
||||
layout="topleft"
|
||||
name="Edit Outfit">
|
||||
<menu_item_call.on_click
|
||||
function="EditOutfit" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Edit Shape"
|
||||
layout="topleft"
|
||||
name="Edit My Shape">
|
||||
name="Edit Shape">
|
||||
<menu_item_call.on_click
|
||||
function="EditShape" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableEditShape" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Edit Outfit"
|
||||
layout="topleft"
|
||||
name="Edit Outfit Parts">
|
||||
<menu_item_call.on_click
|
||||
function="EditOutfit" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Hover Height"
|
||||
layout="topleft"
|
||||
name="Hover Height">
|
||||
|
|
@ -120,7 +128,7 @@ name="Edit Outfit">
|
|||
function="Edit.EnableHoverHeight" />
|
||||
</menu_item_call>
|
||||
<context_menu
|
||||
label="Take Off"
|
||||
label="Take off"
|
||||
layout="topleft"
|
||||
name="Take Off >">
|
||||
<context_menu
|
||||
|
|
|
|||
|
|
@ -204,8 +204,17 @@
|
|||
function="Self.EnableRemoveAllAttachments" />
|
||||
</menu_item_call>
|
||||
</context_menu>
|
||||
<menu_item_call
|
||||
label="Now wearing..."
|
||||
layout="topleft"
|
||||
name="NowWearing">
|
||||
<menu_item_call.on_click
|
||||
function="NowWearing" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Change Outfit"
|
||||
label="Outfits"
|
||||
layout="topleft"
|
||||
name="Chenge Outfit">
|
||||
<menu_item_call.on_click
|
||||
|
|
@ -213,14 +222,6 @@
|
|||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Edit Outfit"
|
||||
layout="topleft"
|
||||
name="Edit Outfit">
|
||||
<menu_item_call.on_click
|
||||
function="EditOutfit" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Edit Shape"
|
||||
layout="topleft"
|
||||
name="Edit My Shape">
|
||||
|
|
@ -228,6 +229,14 @@
|
|||
function="EditShape" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableEditShape" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Edit Outfit"
|
||||
layout="topleft"
|
||||
name="Edit Outfit Parts">
|
||||
<menu_item_call.on_click
|
||||
function="EditOutfit" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Hover Height"
|
||||
layout="topleft"
|
||||
|
|
|
|||
|
|
@ -20,6 +20,14 @@
|
|||
function="Favorites.DoToSelected"
|
||||
parameter="about" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Move to Landmarks"
|
||||
layout="topleft"
|
||||
name="Move to Landmarks">
|
||||
<menu_item_call.on_click
|
||||
function="Favorites.DoToSelected"
|
||||
parameter="move_to_landmarks" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Show on Map"
|
||||
layout="topleft"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,28 @@
|
|||
function="Places.LandmarksGear.Enable"
|
||||
parameter="more_info" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Move to Landmarks"
|
||||
layout="topleft"
|
||||
name="Move to Landmarks">
|
||||
<menu_item_call.on_click
|
||||
function="Places.LandmarksGear.Custom.Action"
|
||||
parameter="move_to_landmarks" />
|
||||
<menu_item_call.on_visible
|
||||
function="Places.LandmarksGear.Enable"
|
||||
parameter="move_to_landmarks" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Move to Favorites"
|
||||
layout="topleft"
|
||||
name="Move to Favorites">
|
||||
<menu_item_call.on_click
|
||||
function="Places.LandmarksGear.Custom.Action"
|
||||
parameter="move_to_favorites" />
|
||||
<menu_item_call.on_visible
|
||||
function="Places.LandmarksGear.Enable"
|
||||
parameter="move_to_favorites" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Show on Map"
|
||||
layout="topleft"
|
||||
|
|
|
|||
|
|
@ -116,8 +116,16 @@
|
|||
parameter="agent" />
|
||||
</menu_item_call>
|
||||
|
||||
<menu_item_call
|
||||
label="Now wearing..."
|
||||
name="NowWearing">
|
||||
<menu_item_call.on_click
|
||||
function="NowWearing" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_check
|
||||
label="Appearance"
|
||||
label="Outfits"
|
||||
shortcut="control|O"
|
||||
name="ChangeOutfit">
|
||||
<menu_item_check.on_click
|
||||
|
|
@ -130,7 +138,7 @@
|
|||
</menu_item_check>
|
||||
|
||||
<menu
|
||||
label="Take Off"
|
||||
label="Take off"
|
||||
layout="topleft"
|
||||
name="Take Off >">
|
||||
<menu
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
name="title"
|
||||
text_color="LtGray"
|
||||
top="0"
|
||||
value="Edit Outfit"
|
||||
value="Edit Outfit Parts"
|
||||
use_ellipses="true"
|
||||
width="275" />
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue