summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenufile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermenufile.cpp')
-rw-r--r--indra/newview/llviewermenufile.cpp46
1 files changed, 28 insertions, 18 deletions
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 2a871a24af..02667a3ff6 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -478,13 +478,19 @@ const bool check_file_extension(const std::string& filename, LLFilePicker::ELoad
return true;
}
-const void upload_single_file(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type)
+void upload_single_file(
+ const std::vector<std::string>& filenames,
+ LLFilePicker::ELoadFilter type,
+ const LLUUID& dest)
{
std::string filename = filenames[0];
if (!check_file_extension(filename, type)) return;
if (!filename.empty())
{
+ LLSD args;
+ args["filename"] = filename;
+ args["dest"] = dest;
if (type == LLFilePicker::FFLOAD_WAV)
{
// pre-qualify wavs to make sure the format is acceptable
@@ -499,12 +505,12 @@ const void upload_single_file(const std::vector<std::string>& filenames, LLFileP
}
else
{
- LLFloaterReg::showInstance("upload_sound", LLSD(filename));
+ LLFloaterReg::showInstance("upload_sound", args);
}
}
if (type == LLFilePicker::FFLOAD_IMAGE)
{
- LLFloaterReg::showInstance("upload_image", LLSD(filename));
+ LLFloaterReg::showInstance("upload_image", args);
}
if (type == LLFilePicker::FFLOAD_ANIM)
{
@@ -512,18 +518,18 @@ const void upload_single_file(const std::vector<std::string>& filenames, LLFileP
LLStringUtil::toLower(filename_lc);
if (filename_lc.rfind(".anim") != std::string::npos)
{
- LLFloaterReg::showInstance("upload_anim_anim", LLSD(filename));
+ LLFloaterReg::showInstance("upload_anim_anim", args);
}
else
{
- LLFloaterReg::showInstance("upload_anim_bvh", LLSD(filename));
+ LLFloaterReg::showInstance("upload_anim_bvh", args);
}
}
}
return;
}
-void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k)
+void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLUUID& dest)
{
for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter)
{
@@ -570,7 +576,8 @@ void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k)
LLFloaterPerms::getNextOwnerPerms("Uploads"),
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
- expected_upload_cost);
+ expected_upload_cost,
+ dest);
if (!allow_2k)
{
@@ -595,14 +602,14 @@ void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k)
// Todo:
// 1. Decouple bulk upload from material editor
// 2. Take into account possiblity of identical textures
- LLMaterialEditor::uploadMaterialFromModel(filename, model, i);
+ LLMaterialEditor::uploadMaterialFromModel(filename, model, i, dest);
}
}
}
}
}
-void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLSD& notification, const LLSD& response)
+void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLSD& notification, const LLSD& response, const LLUUID& dest)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option != 0)
@@ -611,7 +618,7 @@ void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLS
return;
}
- do_bulk_upload(filenames, allow_2k);
+ do_bulk_upload(filenames, allow_2k, dest);
}
bool get_bulk_upload_expected_cost(
@@ -709,7 +716,7 @@ bool get_bulk_upload_expected_cost(
return file_count > 0;
}
-const void upload_bulk(const std::vector<std::string>& filtered_filenames, bool allow_2k)
+const void upload_bulk(const std::vector<std::string>& filtered_filenames, bool allow_2k, const LLUUID& dest)
{
S32 expected_upload_cost;
S32 expected_upload_count;
@@ -721,6 +728,7 @@ const void upload_bulk(const std::vector<std::string>& filtered_filenames, bool
key["upload_cost"] = expected_upload_cost;
key["upload_count"] = expected_upload_count;
key["has_2k_textures"] = (textures_2k_count > 0);
+ key["dest"] = dest;
LLSD array;
for (const std::string& str : filtered_filenames)
@@ -754,7 +762,7 @@ const void upload_bulk(const std::vector<std::string>& filtered_filenames, bool
}
-const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k)
+void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k, const LLUUID& dest)
{
// TODO:
// Check user balance for entire cost
@@ -776,7 +784,7 @@ const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::
filtered_filenames.push_back(filename);
}
}
- upload_bulk(filtered_filenames, allow_2k);
+ upload_bulk(filtered_filenames, allow_2k, dest);
}
class LLFileUploadImage : public view_listener_t
@@ -787,7 +795,7 @@ class LLFileUploadImage : public view_listener_t
{
gAgentCamera.changeCameraToDefault();
}
- LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_IMAGE, false);
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_IMAGE, false);
return true;
}
};
@@ -818,7 +826,7 @@ class LLFileUploadSound : public view_listener_t
{
gAgentCamera.changeCameraToDefault();
}
- LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_WAV, false);
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_WAV, false);
return true;
}
};
@@ -831,7 +839,7 @@ class LLFileUploadAnim : public view_listener_t
{
gAgentCamera.changeCameraToDefault();
}
- LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_ANIM, false);
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_ANIM, false);
return true;
}
};
@@ -844,7 +852,9 @@ class LLFileUploadBulk : public view_listener_t
{
gAgentCamera.changeCameraToDefault();
}
- LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, true), LLFilePicker::FFLOAD_ALL, true);
+
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, true, LLUUID::null), LLFilePicker::FFLOAD_ALL, true);
+
return true;
}
};
@@ -1138,7 +1148,7 @@ LLUUID upload_new_resource(
name, desc, compression_info,
destination_folder_type, inv_type,
next_owner_perms, group_perms, everyone_perms,
- expected_upload_cost, show_inventory));
+ expected_upload_cost, LLUUID::null, show_inventory));
upload_new_resource(uploadInfo, callback, userdata);
return LLUUID::null;