From fc29786cb24dd54530169d82a19dbf54ca4fdb31 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 14 Jan 2018 19:14:46 -0500 Subject: STORM-2145 Added copying of initial preset files --- indra/newview/app_settings/Camera/Front.xml | 20 +++++++++++++ indra/newview/app_settings/Camera/Pennys Gamer.xml | 20 +++++++++++++ indra/newview/app_settings/Camera/Rear.xml | 20 +++++++++++++ indra/newview/app_settings/Camera/Side.xml | 20 +++++++++++++ indra/newview/llpresetsmanager.cpp | 33 +++++++++++++++++----- 5 files changed, 106 insertions(+), 7 deletions(-) create mode 100644 indra/newview/app_settings/Camera/Front.xml create mode 100644 indra/newview/app_settings/Camera/Pennys Gamer.xml create mode 100644 indra/newview/app_settings/Camera/Rear.xml create mode 100644 indra/newview/app_settings/Camera/Side.xml (limited to 'indra/newview') diff --git a/indra/newview/app_settings/Camera/Front.xml b/indra/newview/app_settings/Camera/Front.xml new file mode 100644 index 0000000000..6f2ea9da17 --- /dev/null +++ b/indra/newview/app_settings/Camera/Front.xml @@ -0,0 +1,20 @@ + + + + FocusOffsetRearView + + Comment + Initial focus point offset relative to avatar for the camera preset Rear View (x-axis is forward) + Persist + 1 + Type + Vector3D + Value + + 1.0 + 0.0 + 1.0 + + + diff --git a/indra/newview/app_settings/Camera/Pennys Gamer.xml b/indra/newview/app_settings/Camera/Pennys Gamer.xml new file mode 100644 index 0000000000..6f2ea9da17 --- /dev/null +++ b/indra/newview/app_settings/Camera/Pennys Gamer.xml @@ -0,0 +1,20 @@ + + + + FocusOffsetRearView + + Comment + Initial focus point offset relative to avatar for the camera preset Rear View (x-axis is forward) + Persist + 1 + Type + Vector3D + Value + + 1.0 + 0.0 + 1.0 + + + diff --git a/indra/newview/app_settings/Camera/Rear.xml b/indra/newview/app_settings/Camera/Rear.xml new file mode 100644 index 0000000000..6f2ea9da17 --- /dev/null +++ b/indra/newview/app_settings/Camera/Rear.xml @@ -0,0 +1,20 @@ + + + + FocusOffsetRearView + + Comment + Initial focus point offset relative to avatar for the camera preset Rear View (x-axis is forward) + Persist + 1 + Type + Vector3D + Value + + 1.0 + 0.0 + 1.0 + + + diff --git a/indra/newview/app_settings/Camera/Side.xml b/indra/newview/app_settings/Camera/Side.xml new file mode 100644 index 0000000000..6f2ea9da17 --- /dev/null +++ b/indra/newview/app_settings/Camera/Side.xml @@ -0,0 +1,20 @@ + + + + FocusOffsetRearView + + Comment + Initial focus point offset relative to avatar for the camera preset Rear View (x-axis is forward) + Persist + 1 + Type + Vector3D + Value + + 1.0 + 0.0 + 1.0 + + + diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 3daa6894f0..d4535c69c8 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -40,6 +40,7 @@ #include "llfloaterreg.h" #include "llfeaturemanager.h" #include "llagentcamera.h" +#include "llfile.h" LLPresetsManager::LLPresetsManager() { @@ -112,20 +113,38 @@ void LLPresetsManager::startWatching(const std::string& subdirectory) std::string LLPresetsManager::getPresetsDir(const std::string& subdirectory) { std::string presets_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR); - std::string full_path; if (!gDirUtilp->fileExists(presets_path)) { LLFile::mkdir(presets_path); } - full_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, subdirectory); - if (!gDirUtilp->fileExists(full_path)) + std::string dest_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, subdirectory); + if (!gDirUtilp->fileExists(dest_path)) { - LLFile::mkdir(full_path); + LLFile::mkdir(dest_path); + + if (PRESETS_CAMERA == subdirectory) + { + std::string source_dir = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "Camera"); + LLDirIterator dir_iter(source_dir, "*.xml"); + bool found = true; + while (found) + { + std::string file; + found = dir_iter.next(file); + + if (found) + { + std::string source = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "Camera", file); + std::string dest = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, "Camera", file); + LLFile::copy(source, dest); + } + } + } } - return full_path; + return dest_path; } void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets, EDefaultOptions default_option) @@ -234,7 +253,7 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n } else { - LL_WARNS() << "preferences floater instance not found" << LL_ENDL; + LL_WARNS("Presets") << "preferences floater instance not found" << LL_ENDL; } } else if(PRESETS_CAMERA == subdirectory) @@ -387,7 +406,7 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, std::string n } else { - LL_WARNS() << "failed to load preset '"<