Commit 17e5349e authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

More graphics preset code cleanup

parent 68b1e535
Pipeline #1139 passed with stages
in 55 minutes and 1 second
......@@ -266,18 +266,6 @@ void LLPresetsManager::loadPresetNamesFromDir(const std::string& subdirectory, p
presets = mPresetNames;
}
bool LLPresetsManager::sCameraDirty = false;
void LLPresetsManager::setCameraDirty(bool dirty)
{
sCameraDirty = dirty;
}
bool LLPresetsManager::isCameraDirty()
{
return sCameraDirty;
}
void LLPresetsManager::graphicsSettingChanged()
{
static LLCachedControl<std::string> graphic_preset_active(gSavedSettings, "PresetGraphicActive", "");
......@@ -285,22 +273,18 @@ void LLPresetsManager::graphicsSettingChanged()
{
gSavedSettings.setString("PresetGraphicActive", "");
// Hack call because this is a static routine
LLPresetsManager::getInstance()->triggerChangeSignal();
triggerChangeSignal();
}
}
void LLPresetsManager::cameraSettingChanged()
{
setCameraDirty(true);
static LLCachedControl<std::string> preset_camera_active(gSavedSettings, "PresetCameraActive", "");
if (!preset_camera_active().empty() && !mIgnoreChangedSignal)
{
gSavedSettings.setString("PresetCameraActive", "");
// Hack call because this is a static routine
LLPresetsManager::getInstance()->triggerChangeCameraSignal();
triggerChangeCameraSignal();
}
}
......@@ -521,7 +505,6 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n
if (IS_CAMERA)
{
gSavedSettings.setString("PresetCameraActive", name);
setCameraDirty(false);
// signal interested parties
triggerChangeCameraSignal();
}
......
......@@ -73,8 +73,6 @@ class LLPresetsManager final : public LLSingleton<LLPresetsManager>
bool savePreset(const std::string& subdirectory, std::string name, bool createDefault = false);
void loadPreset(const std::string& subdirectory, std::string name);
bool deletePreset(const std::string& subdirectory, std::string name);
bool isCameraDirty();
static void setCameraDirty(bool dirty);
void createCameraDefaultPresets();
......@@ -83,12 +81,16 @@ class LLPresetsManager final : public LLSingleton<LLPresetsManager>
void resetCameraPreset(std::string preset_name);
bool createDefaultCameraPreset(std::string preset_name, bool force_reset = false);
void setIgnoreChangeSignal(bool val)
{
mIgnoreChangedSignal = val;
}
// Emitted when a preset gets loaded, deleted, or saved.
boost::signals2::connection setPresetListChangeCameraCallback(const preset_list_signal_t::slot_type& cb);
boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb);
// Emitted when a preset gets loaded or saved.
preset_name_list_t mPresetNames;
preset_list_signal_t mPresetListChangeCameraSignal;
......@@ -106,8 +108,6 @@ class LLPresetsManager final : public LLSingleton<LLPresetsManager>
std::vector<boost::signals2::connection> mCameraChangedSignals;
bool mIgnoreChangedSignal = false;
static bool sCameraDirty;
};
#endif // LL_PRESETSMANAGER_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment