Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions indra/newview/llinventoryfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3890,6 +3890,31 @@ void LLInventoryAction::fileUploadLocation(const LLUUID& dest_id, const std::str
}
}

bool LLInventoryAction::isFileUploadLocation(const LLUUID& dest_id, const std::string& action)
{
if (action == "def_model")
{
return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_OBJECT) == dest_id;
}
else if (action == "def_texture")
{
return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE) == dest_id;
}
else if (action == "def_sound")
{
return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_SOUND) == dest_id;
}
else if (action == "def_animation")
{
return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_ANIMATION) == dest_id;
}
else if (action == "def_pbr_material")
{
return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_MATERIAL) == dest_id;
}
return false;
}

void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFolderView> root)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
Expand Down
1 change: 1 addition & 0 deletions indra/newview/llinventoryfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ struct LLInventoryAction
static void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFolderView> root);
static void removeItemFromDND(LLFolderView* root);
static void fileUploadLocation(const LLUUID& dest_id, const std::string& action);
static bool isFileUploadLocation(const LLUUID& dest_id, const std::string& action);

static void saveMultipleTextures(const std::vector<std::string>& filenames, std::set<LLFolderViewItem*> selected_items, LLInventoryModel* model);

Expand Down
7 changes: 7 additions & 0 deletions indra/newview/llinventorygallerymenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ LLContextMenu* LLInventoryGalleryContextMenu::createMenu()
registrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, uuids, gFloaterView->getParentFloater(mGallery)));

enable_registrar.add("Inventory.CanSetUploadLocation", boost::bind(&LLInventoryGalleryContextMenu::canSetUploadLocation, this, _2));
enable_registrar.add("Inventory.FileUploadLocation.Check", boost::bind(&LLInventoryGalleryContextMenu::isUploadLocationSelected, this, _2));

enable_registrar.add("Inventory.EnvironmentEnabled", [](LLUICtrl*, const LLSD&)
{
Expand Down Expand Up @@ -489,6 +490,12 @@ void LLInventoryGalleryContextMenu::fileUploadLocation(const LLSD& userdata)
LLInventoryAction::fileUploadLocation(mUUIDs.front(), param);
}

bool LLInventoryGalleryContextMenu::isUploadLocationSelected(const LLSD& userdata)
{
const std::string param = userdata.asString();
return LLInventoryAction::isFileUploadLocation(mUUIDs.front(), param);
}

bool LLInventoryGalleryContextMenu::canSetUploadLocation(const LLSD& userdata)
{
if (mUUIDs.size() != 1)
Expand Down
1 change: 1 addition & 0 deletions indra/newview/llinventorygallerymenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class LLInventoryGalleryContextMenu : public LLListContextMenu
void updateMenuItemsVisibility(LLContextMenu* menu);

void fileUploadLocation(const LLSD& userdata);
bool isUploadLocationSelected(const LLSD& userdata);
bool canSetUploadLocation(const LLSD& userdata);

static void onRename(const LLSD& notification, const LLSD& response);
Expand Down
8 changes: 8 additions & 0 deletions indra/newview/llinventorypanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this));
mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this));
mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2));
mEnableCallbackRegistrar.add("Inventory.FileUploadLocation.Check", boost::bind(&LLInventoryPanel::isUploadLocationSelected, this, _2));
mCommitCallbackRegistrar.add("Inventory.OpenNewFolderWindow", boost::bind(&LLInventoryPanel::openSingleViewInventory, this, LLUUID()));
}

Expand Down Expand Up @@ -1832,6 +1833,13 @@ void LLInventoryPanel::fileUploadLocation(const LLSD& userdata)
LLInventoryAction::fileUploadLocation(dest, param);
}

bool LLInventoryPanel::isUploadLocationSelected(const LLSD& userdata)
{
const std::string param = userdata.asString();
const LLUUID dest = LLFolderBridge::sSelf.get()->getUUID();
return LLInventoryAction::isFileUploadLocation(dest, param);
}

void LLInventoryPanel::openSingleViewInventory(LLUUID folder_id)
{
LLPanelMainInventory::newFolderWindow(folder_id.isNull() ? LLFolderBridge::sSelf.get()->getUUID() : folder_id);
Expand Down
1 change: 1 addition & 0 deletions indra/newview/llinventorypanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ class LLInventoryPanel : public LLPanel
void doCreate(const LLSD& userdata);
bool beginIMSession();
void fileUploadLocation(const LLSD& userdata);
bool isUploadLocationSelected(const LLSD& userdata);
void openSingleViewInventory(LLUUID folder_id = LLUUID());
void purgeSelectedItems();
bool attachObject(const LLSD& userdata);
Expand Down
98 changes: 34 additions & 64 deletions indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -686,51 +686,6 @@
function="Inventory.DoToSelected"
parameter="remove_from_favorites" />
</menu_item_call>
<menu
label="Use as default for"
layout="topleft"
name="upload_def">
<menu_item_call
label="Image uploads"
layout="topleft"
name="Image uploads">
<menu_item_call.on_click
function="Inventory.FileUploadLocation"
parameter="texture" />
<menu_item_call.on_visible
function="Inventory.CanSetUploadLocation" />
</menu_item_call>
<menu_item_call
label="Sound uploads"
layout="topleft"
name="Sound uploads">
<menu_item_call.on_click
function="Inventory.FileUploadLocation"
parameter="sound" />
<menu_item_call.on_visible
function="Inventory.CanSetUploadLocation" />
</menu_item_call>
<menu_item_call
label="Animation uploads"
layout="topleft"
name="Animation uploads">
<menu_item_call.on_click
function="Inventory.FileUploadLocation"
parameter="animation" />
<menu_item_call.on_visible
function="Inventory.CanSetUploadLocation" />
</menu_item_call>
<menu_item_call
label="Model uploads"
layout="topleft"
name="Model uploads">
<menu_item_call.on_click
function="Inventory.FileUploadLocation"
parameter="model" />
<menu_item_call.on_visible
function="Inventory.CanSetUploadLocation" />
</menu_item_call>
</menu>
<menu
label="Upload to folder"
layout="topleft"
Expand Down Expand Up @@ -812,54 +767,69 @@
label="Use as default for"
layout="topleft"
name="upload_def">
<menu_item_call
<menu_item_check
label="Image uploads"
layout="topleft"
name="Image uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_texture" />
<menu_item_call.on_visible
<on_visible
function="Inventory.CanSetUploadLocation" />
</menu_item_call>
<menu_item_call
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_texture" />
</menu_item_check>
<menu_item_check
label="Sound uploads"
layout="topleft"
name="Sound uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_sound" />
<menu_item_call.on_visible
<on_visible
function="Inventory.CanSetUploadLocation" />
</menu_item_call>
<menu_item_call
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_sound" />
</menu_item_check>
<menu_item_check
label="Animation uploads"
layout="topleft"
name="Animation uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_animation" />
<menu_item_call.on_visible
<on_visible
function="Inventory.CanSetUploadLocation" />
</menu_item_call>
<menu_item_call
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_animation" />
</menu_item_check>
<menu_item_check
label="Model uploads"
layout="topleft"
name="Model uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_model" />
<menu_item_call.on_visible
<on_visible
function="Inventory.CanSetUploadLocation" />
</menu_item_call>
<menu_item_call
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_model" />
</menu_item_check>
<menu_item_check
label="PBR material uploads"
layout="topleft"
name="PBR uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_pbr_material" />
</menu_item_call>
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_pbr_material" />
</menu_item_check>
</menu>
<menu_item_separator
layout="topleft"
Expand Down
45 changes: 30 additions & 15 deletions indra/newview/skins/default/xui/en/menu_inventory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1064,46 +1064,61 @@
label="Use as default for"
layout="topleft"
name="upload_def">
<menu_item_call
<menu_item_check
label="Image uploads"
layout="topleft"
name="Image uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_texture" />
</menu_item_call>
<menu_item_call
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_texture" />
</menu_item_check>
<menu_item_check
label="Sound uploads"
layout="topleft"
name="Sound uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_sound" />
</menu_item_call>
<menu_item_call
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_sound" />
</menu_item_check>
<menu_item_check
label="Animation uploads"
layout="topleft"
name="Animation uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_animation" />
</menu_item_call>
<menu_item_call
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_animation" />
</menu_item_check>
<menu_item_check
label="Model uploads"
layout="topleft"
name="Model uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_model" />
</menu_item_call>
<menu_item_call
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_model" />
</menu_item_check>
<menu_item_check
label="PBR material uploads"
layout="topleft"
name="PBR uploads">
<menu_item_call.on_click
<on_click
function="Inventory.FileUploadLocation"
parameter="def_pbr_material" />
</menu_item_call>
<on_check
function="Inventory.FileUploadLocation.Check"
parameter="def_pbr_material" />
</menu_item_check>
</menu>
<menu_item_separator
layout="topleft"
Expand Down
Loading