summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2017-01-17 20:11:00 +0200
committerandreykproductengine <akleshchev@productengine.com>2017-01-17 20:11:00 +0200
commitb94aa751c93b2c9bf9a9567946fe388a7c475d77 (patch)
tree753be8a9339d02f568fdf0506aa7a9d873f7799d /indra/newview
parentba6974eb376a50eb40dab1682fb96299fe97639d (diff)
MAINT-6959 Ability to set custom folders for uploading items
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings_per_account.xml44
-rw-r--r--indra/newview/llfloaterpreference.cpp64
-rw-r--r--indra/newview/llfloaterpreference.h4
-rw-r--r--indra/newview/llinventorybridge.cpp3
-rw-r--r--indra/newview/llinventorymodel.cpp36
-rw-r--r--indra/newview/llinventorymodel.h3
-rw-r--r--indra/newview/llinventorypanel.cpp23
-rw-r--r--indra/newview/llinventorypanel.h1
-rw-r--r--indra/newview/llmeshrepository.cpp12
-rw-r--r--indra/newview/llviewerassetupload.cpp3
-rw-r--r--indra/newview/skins/default/xui/en/floater_preferences.xml7
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory.xml37
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_uploads.xml142
13 files changed, 369 insertions, 10 deletions
diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml
index eee13fb28e..92e61d2e86 100644
--- a/indra/newview/app_settings/settings_per_account.xml
+++ b/indra/newview/app_settings/settings_per_account.xml
@@ -348,5 +348,49 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>ModelUploadFolder</key>
+ <map>
+ <key>Comment</key>
+ <string>All model uploads will be stored in this directory (UUID)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string></string>
+ </map>
+ <key>TextureUploadFolder</key>
+ <map>
+ <key>Comment</key>
+ <string>All image(texture) uploads will be stored in this directory (UUID)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string></string>
+ </map>
+ <key>SoundUploadFolder</key>
+ <map>
+ <key>Comment</key>
+ <string>All sound uploads will be stored in this directory (UUID)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string></string>
+ </map>
+ <key>AnimationUploadFolder</key>
+ <map>
+ <key>Comment</key>
+ <string>All animation uploads will be stored in this directory (UUID)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string></string>
+ </map>
</map>
</llsd>
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 100ee5ab72..02dffa7f08 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -467,6 +467,11 @@ BOOL LLFloaterPreference::postBuild()
gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeMaturity, this));
+ gSavedPerAccountSettings.getControl("ModelUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeModelFolder, this));
+ gSavedPerAccountSettings.getControl("TextureUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeTextureFolder, this));
+ gSavedPerAccountSettings.getControl("SoundUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeSoundFolder, this));
+ gSavedPerAccountSettings.getControl("AnimationUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeAnimationFolder, this));
+
LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core");
if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
tabcontainer->selectFirstTab();
@@ -501,6 +506,7 @@ BOOL LLFloaterPreference::postBuild()
fov_slider->setMinValue(LLViewerCamera::getInstance()->getMinView());
fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView());
+
return TRUE;
}
@@ -742,7 +748,12 @@ void LLFloaterPreference::onOpen(const LLSD& key)
// Display selected maturity icons.
onChangeMaturity();
-
+
+ onChangeModelFolder();
+ onChangeTextureFolder();
+ onChangeSoundFolder();
+ onChangeAnimationFolder();
+
// Load (double-)click to walk/teleport settings.
updateClickActionControls();
@@ -1979,6 +1990,57 @@ void LLFloaterPreference::onChangeMaturity()
getChild<LLIconCtrl>("rating_icon_adult")->setVisible(sim_access == SIM_ACCESS_ADULT);
}
+std::string get_category_path(LLUUID cat_id)
+{
+ LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
+ if (cat->getParentUUID().notNull())
+ {
+ return get_category_path(cat->getParentUUID()) + " > " + cat->getName();
+ }
+ else
+ {
+ return cat->getName();
+ }
+}
+
+std::string get_category_path(LLFolderType::EType cat_type)
+{
+ LLUUID cat_id = gInventory.findUserDefinedCategoryUUIDForType(cat_type);
+ return get_category_path(cat_id);
+}
+
+void LLFloaterPreference::onChangeModelFolder()
+{
+ if (gInventory.isInventoryUsable())
+ {
+ getChild<LLLineEditor>("upload_models")->setText(get_category_path(LLFolderType::FT_OBJECT));
+ }
+}
+
+void LLFloaterPreference::onChangeTextureFolder()
+{
+ if (gInventory.isInventoryUsable())
+ {
+ getChild<LLLineEditor>("upload_textures")->setText(get_category_path(LLFolderType::FT_TEXTURE));
+ }
+}
+
+void LLFloaterPreference::onChangeSoundFolder()
+{
+ if (gInventory.isInventoryUsable())
+ {
+ getChild<LLLineEditor>("upload_sounds")->setText(get_category_path(LLFolderType::FT_SOUND));
+ }
+}
+
+void LLFloaterPreference::onChangeAnimationFolder()
+{
+ if (gInventory.isInventoryUsable())
+ {
+ getChild<LLLineEditor>("upload_animation")->setText(get_category_path(LLFolderType::FT_ANIMATION));
+ }
+}
+
// FIXME: this will stop you from spawning the sidetray from preferences dialog on login screen
// but the UI for this will still be enabled
void LLFloaterPreference::onClickBlockList()
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index fa0c09e97a..ea199cf034 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -161,6 +161,10 @@ public:
void onCommitMusicEnabled();
void applyResolution();
void onChangeMaturity();
+ void onChangeModelFolder();
+ void onChangeTextureFolder();
+ void onChangeSoundFolder();
+ void onChangeAnimationFolder();
void onClickBlockList();
void onClickProxySettings();
void onClickTranslationSettings();
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 1de579d4c3..b7f5424f25 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3789,6 +3789,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
disabled_items.push_back(std::string("New Gesture"));
disabled_items.push_back(std::string("New Clothes"));
disabled_items.push_back(std::string("New Body Parts"));
+ disabled_items.push_back(std::string("upload_def"));
}
if (favorites == mUUID)
{
@@ -3815,6 +3816,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
disabled_items.push_back(std::string("New Gesture"));
disabled_items.push_back(std::string("New Clothes"));
disabled_items.push_back(std::string("New Body Parts"));
+ disabled_items.push_back(std::string("upload_def"));
}
if (marketplace_listings_id == mUUID)
{
@@ -3864,6 +3866,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
items.push_back(std::string("New Gesture"));
items.push_back(std::string("New Clothes"));
items.push_back(std::string("New Body Parts"));
+ items.push_back(std::string("upload_def"));
}
}
getClipboardEntries(false, items, disabled_items, flags);
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 503fa28a33..287fa4c45b 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -515,6 +515,42 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe
return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getRootFolderID());
}
+const LLUUID LLInventoryModel::findUserDefinedCategoryUUIDForType(LLFolderType::EType preferred_type)
+{
+ LLUUID cat_id;
+ switch (preferred_type)
+ {
+ case LLFolderType::FT_OBJECT:
+ {
+ cat_id = LLUUID(gSavedPerAccountSettings.getString("ModelUploadFolder"));
+ break;
+ }
+ case LLFolderType::FT_TEXTURE:
+ {
+ cat_id = LLUUID(gSavedPerAccountSettings.getString("TextureUploadFolder"));
+ break;
+ }
+ case LLFolderType::FT_SOUND:
+ {
+ cat_id = LLUUID(gSavedPerAccountSettings.getString("SoundUploadFolder"));
+ break;
+ }
+ case LLFolderType::FT_ANIMATION:
+ {
+ cat_id = LLUUID(gSavedPerAccountSettings.getString("AnimationUploadFolder"));
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (cat_id.isNull() || !getCategory(cat_id))
+ {
+ cat_id = findCategoryUUIDForTypeInRoot(preferred_type, true, getRootFolderID());
+ }
+ return cat_id;
+}
+
const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder)
{
return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getLibraryRootFolderID());
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 826d1f880d..dee1769172 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -287,6 +287,9 @@ public:
// will search in the user's library folder instead of "My Inventory"
const LLUUID findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type,
bool create_folder = true);
+ // Returns user specified category for uploads, returns default id if there are no
+ // user specified one or it does not exist, creates default category if it is missing.
+ const LLUUID findUserDefinedCategoryUUIDForType(LLFolderType::EType preferred_type);
// Get whatever special folder this object is a child of, if any.
const LLViewerInventoryCategory *getFirstNondefaultParent(const LLUUID& obj_id) const;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 6a27c0fe21..bd15ba4975 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -167,7 +167,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2));
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));
}
LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id )
@@ -1190,6 +1190,27 @@ bool LLInventoryPanel::beginIMSession()
return true;
}
+void LLInventoryPanel::fileUploadLocation(const LLSD& userdata)
+{
+ const std::string param = userdata.asString();
+ if (param == "model")
+ {
+ gSavedPerAccountSettings.setString("ModelUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
+ }
+ else if (param == "texture")
+ {
+ gSavedPerAccountSettings.setString("TextureUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
+ }
+ else if (param == "sound")
+ {
+ gSavedPerAccountSettings.setString("SoundUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
+ }
+ else if (param == "animation")
+ {
+ gSavedPerAccountSettings.setString("AnimationUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
+ }
+}
+
bool LLInventoryPanel::attachObject(const LLSD& userdata)
{
// Copy selected item UUIDs to a vector.
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index b69edd8b93..5cb9dde47a 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -201,6 +201,7 @@ public:
void doToSelected(const LLSD& userdata);
void doCreate(const LLSD& userdata);
bool beginIMSession();
+ void fileUploadLocation(const LLSD& userdata);
bool attachObject(const LLSD& userdata);
static void idle(void* user_data);
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 9dacae2c4e..1a533dace7 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2030,8 +2030,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
LLSD result;
LLSD res;
- result["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
- result["texture_folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE);
+ result["folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_OBJECT);
+ result["texture_folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE);
result["asset_type"] = "mesh";
result["inventory_type"] = "object";
result["description"] = "(No Description)";
@@ -3536,11 +3536,11 @@ void LLMeshRepository::notifyLoadedMeshes()
// Handle addition of texture, if any.
if ( data.mResponse.has("new_texture_folder_id") )
{
- const LLUUID& folder_id = data.mResponse["new_texture_folder_id"].asUUID();
+ const LLUUID& new_folder_id = data.mResponse["new_texture_folder_id"].asUUID();
- if ( folder_id.notNull() )
+ if ( new_folder_id.notNull() )
{
- LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE);
+ LLUUID parent_id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE);
std::string name;
// Check if the server built a different name for the texture folder
@@ -3555,7 +3555,7 @@ void LLMeshRepository::notifyLoadedMeshes()
// Add the category to the internal representation
LLPointer<LLViewerInventoryCategory> cat =
- new LLViewerInventoryCategory(folder_id, parent_id,
+ new LLViewerInventoryCategory(new_folder_id, parent_id,
LLFolderType::FT_NONE, name, gAgent.getID());
cat->setVersion(LLViewerInventoryCategory::VERSION_UNKNOWN);
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index cafaf8645a..49d29c0e4e 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -307,10 +307,9 @@ void LLResourceUploadInfo::assignDefaults()
mDescription = "(No Description)";
}
- mFolderId = gInventory.findCategoryUUIDForType(
+ mFolderId = gInventory.findUserDefinedCategoryUUIDForType(
(mDestinationFolderType == LLFolderType::FT_NONE) ?
(LLFolderType::EType)mAssetType : mDestinationFolderType);
-
}
std::string LLResourceUploadInfo::getDisplayName() const
diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml
index 9a9101e0da..5ca527ad20 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences.xml
@@ -120,6 +120,13 @@
layout="topleft"
help_topic="preferences_advanced1_tab"
name="advanced1" />
+ <panel
+ class="panel_preference"
+ filename="panel_preferences_uploads.xml"
+ label="Uploads"
+ layout="topleft"
+ help_topic="preferences_uploads_tab"
+ name="uploads" />
</tab_container>
</floater>
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index 5b8a9413bf..e1f9269c70 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -322,6 +322,43 @@
</menu_item_call>
</menu>
<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>
+ <menu_item_call
+ label="Sound uploads"
+ layout="topleft"
+ name="Sound uploads">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="sound" />
+ </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>
+ <menu_item_call
+ label="Model uploads"
+ layout="topleft"
+ name="Model uploads">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="model" />
+ </menu_item_call>
+ </menu>
+ <menu
label="Change Type"
layout="topleft"
name="Change Type">
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_uploads.xml b/indra/newview/skins/default/xui/en/panel_preferences_uploads.xml
new file mode 100644
index 0000000000..f397d05408
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_preferences_uploads.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<panel
+ border="true"
+ follows="all"
+ height="408"
+ label="Uploads"
+ layout="topleft"
+ left="102"
+ name="uploads"
+ top="1"
+ width="517">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left="33"
+ name="title"
+ top_pad="10"
+ width="250">
+ Current destination folders for uploads
+ </text>
+
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left="37"
+ name="title_models"
+ top_pad="20"
+ width="100">
+ Images
+ </text>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|top"
+ font="SansSerif"
+ height="23"
+ layout="topleft"
+ left="40"
+ max_length="4096"
+ name="upload_textures"
+ enabled="false"
+ top_pad="5"
+ width="350" />
+
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left="37"
+ name="title_sounds"
+ top_pad="10"
+ width="100">
+ Sounds
+ </text>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|top"
+ font="SansSerif"
+ height="23"
+ layout="topleft"
+ left="40"
+ max_length="4096"
+ name="upload_sounds"
+ enabled="false"
+ top_pad="5"
+ width="350" />
+
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left="37"
+ name="title_animation"
+ top_pad="10"
+ width="100">
+ Animations
+ </text>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|top"
+ font="SansSerif"
+ height="23"
+ layout="topleft"
+ left="40"
+ max_length="4096"
+ name="upload_animation"
+ enabled="false"
+ top_pad="5"
+ width="350" />
+
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left="37"
+ name="title_animation"
+ top_pad="10"
+ width="100">
+ Models
+ </text>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|top"
+ font="SansSerif"
+ height="23"
+ layout="topleft"
+ left="40"
+ max_length="4096"
+ name="upload_models"
+ enabled="false"
+ top_pad="5"
+ width="350" />
+
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="30"
+ layout="topleft"
+ left="33"
+ name="upload_help"
+ top_pad="10"
+ width="387">
+ To change a destination folder, right click on it in inventory and choose
+ "Use as default for"
+ </text>
+</panel>