From 5c4ae5b11a44ab4711f0148cb721f35be9f18100 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 23 Feb 2017 17:50:36 -0500 Subject: STORM-2145 Camera Presets -- some initial work --- indra/newview/llfloaterdeleteprefpreset.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterdeleteprefpreset.cpp') diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index 7dedbbf984..bd62849b42 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -60,13 +60,15 @@ void LLFloaterDeletePrefPreset::onOpen(const LLSD& key) { mSubdirectory = key.asString(); std::string floater_title = getString(std::string("title_") + mSubdirectory); - setTitle(floater_title); LLComboBox* combo = getChild("preset_combo"); - EDefaultOptions option = DEFAULT_HIDE; - LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); + bool action; + action = LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); + + LLButton* delete_btn = getChild("delete"); + delete_btn->setEnabled(action); } void LLFloaterDeletePrefPreset::onBtnDelete() @@ -87,12 +89,10 @@ void LLFloaterDeletePrefPreset::onBtnDelete() void LLFloaterDeletePrefPreset::onPresetsListChange() { LLComboBox* combo = getChild("preset_combo"); - LLButton* delete_btn = getChild("delete"); EDefaultOptions option = DEFAULT_HIDE; - LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); - delete_btn->setEnabled(0 != combo->getItemCount()); + LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); } void LLFloaterDeletePrefPreset::onBtnCancel() -- cgit v1.2.3 From 3e560022459bf3534b873a7f6499dfb5eb75a7d9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 11 Mar 2019 08:11:09 -0700 Subject: Tabs -> spaces. --- indra/newview/llfloaterdeleteprefpreset.cpp | 66 ++++++++++++++--------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'indra/newview/llfloaterdeleteprefpreset.cpp') diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index bd62849b42..dd8117f95f 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -37,65 +37,65 @@ #include "llfloaterreg.h" LLFloaterDeletePrefPreset::LLFloaterDeletePrefPreset(const LLSD &key) -: LLFloater(key) +: LLFloater(key) { } // virtual BOOL LLFloaterDeletePrefPreset::postBuild() { - LLFloaterPreference* preferences = LLFloaterReg::getTypedInstance("preferences"); - if (preferences) - { - preferences->addDependentFloater(this); - } - getChild("delete")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnDelete, this)); - getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnCancel, this)); - LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterDeletePrefPreset::onPresetsListChange, this)); - - return TRUE; + LLFloaterPreference* preferences = LLFloaterReg::getTypedInstance("preferences"); + if (preferences) + { + preferences->addDependentFloater(this); + } + getChild("delete")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnDelete, this)); + getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnCancel, this)); + LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterDeletePrefPreset::onPresetsListChange, this)); + + return TRUE; } void LLFloaterDeletePrefPreset::onOpen(const LLSD& key) { - mSubdirectory = key.asString(); - std::string floater_title = getString(std::string("title_") + mSubdirectory); - setTitle(floater_title); + mSubdirectory = key.asString(); + std::string floater_title = getString(std::string("title_") + mSubdirectory); + setTitle(floater_title); - LLComboBox* combo = getChild("preset_combo"); - EDefaultOptions option = DEFAULT_HIDE; - bool action; - action = LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); + LLComboBox* combo = getChild("preset_combo"); + EDefaultOptions option = DEFAULT_HIDE; + bool action; + action = LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); - LLButton* delete_btn = getChild("delete"); - delete_btn->setEnabled(action); + LLButton* delete_btn = getChild("delete"); + delete_btn->setEnabled(action); } void LLFloaterDeletePrefPreset::onBtnDelete() { - LLComboBox* combo = getChild("preset_combo"); - std::string name = combo->getSimple(); + LLComboBox* combo = getChild("preset_combo"); + std::string name = combo->getSimple(); - if (!LLPresetsManager::getInstance()->deletePreset(mSubdirectory, name)) - { - LLSD args; - args["NAME"] = name; - LLNotificationsUtil::add("PresetNotDeleted", args); - } + if (!LLPresetsManager::getInstance()->deletePreset(mSubdirectory, name)) + { + LLSD args; + args["NAME"] = name; + LLNotificationsUtil::add("PresetNotDeleted", args); + } - closeFloater(); + closeFloater(); } void LLFloaterDeletePrefPreset::onPresetsListChange() { - LLComboBox* combo = getChild("preset_combo"); + LLComboBox* combo = getChild("preset_combo"); - EDefaultOptions option = DEFAULT_HIDE; + EDefaultOptions option = DEFAULT_HIDE; - LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); + LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); } void LLFloaterDeletePrefPreset::onBtnCancel() { - closeFloater(); + closeFloater(); } -- cgit v1.2.3 From ac2fc3029f3b9b6ba182949c29a7919f2f87eb02 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 12 Mar 2019 08:56:26 -0700 Subject: Backout tabs v spaces changes. 'warn-on-failure:no-tabs' --- indra/newview/llfloaterdeleteprefpreset.cpp | 66 ++++++++++++++--------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'indra/newview/llfloaterdeleteprefpreset.cpp') diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index dd8117f95f..bd62849b42 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -37,65 +37,65 @@ #include "llfloaterreg.h" LLFloaterDeletePrefPreset::LLFloaterDeletePrefPreset(const LLSD &key) -: LLFloater(key) +: LLFloater(key) { } // virtual BOOL LLFloaterDeletePrefPreset::postBuild() { - LLFloaterPreference* preferences = LLFloaterReg::getTypedInstance("preferences"); - if (preferences) - { - preferences->addDependentFloater(this); - } - getChild("delete")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnDelete, this)); - getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnCancel, this)); - LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterDeletePrefPreset::onPresetsListChange, this)); - - return TRUE; + LLFloaterPreference* preferences = LLFloaterReg::getTypedInstance("preferences"); + if (preferences) + { + preferences->addDependentFloater(this); + } + getChild("delete")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnDelete, this)); + getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnCancel, this)); + LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterDeletePrefPreset::onPresetsListChange, this)); + + return TRUE; } void LLFloaterDeletePrefPreset::onOpen(const LLSD& key) { - mSubdirectory = key.asString(); - std::string floater_title = getString(std::string("title_") + mSubdirectory); - setTitle(floater_title); + mSubdirectory = key.asString(); + std::string floater_title = getString(std::string("title_") + mSubdirectory); + setTitle(floater_title); - LLComboBox* combo = getChild("preset_combo"); - EDefaultOptions option = DEFAULT_HIDE; - bool action; - action = LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); + LLComboBox* combo = getChild("preset_combo"); + EDefaultOptions option = DEFAULT_HIDE; + bool action; + action = LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); - LLButton* delete_btn = getChild("delete"); - delete_btn->setEnabled(action); + LLButton* delete_btn = getChild("delete"); + delete_btn->setEnabled(action); } void LLFloaterDeletePrefPreset::onBtnDelete() { - LLComboBox* combo = getChild("preset_combo"); - std::string name = combo->getSimple(); + LLComboBox* combo = getChild("preset_combo"); + std::string name = combo->getSimple(); - if (!LLPresetsManager::getInstance()->deletePreset(mSubdirectory, name)) - { - LLSD args; - args["NAME"] = name; - LLNotificationsUtil::add("PresetNotDeleted", args); - } + if (!LLPresetsManager::getInstance()->deletePreset(mSubdirectory, name)) + { + LLSD args; + args["NAME"] = name; + LLNotificationsUtil::add("PresetNotDeleted", args); + } - closeFloater(); + closeFloater(); } void LLFloaterDeletePrefPreset::onPresetsListChange() { - LLComboBox* combo = getChild("preset_combo"); + LLComboBox* combo = getChild("preset_combo"); - EDefaultOptions option = DEFAULT_HIDE; + EDefaultOptions option = DEFAULT_HIDE; - LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); + LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); } void LLFloaterDeletePrefPreset::onBtnCancel() { - closeFloater(); + closeFloater(); } -- cgit v1.2.3 From dd8128114c8cfe812e1dd8f2cfd449a4050d9aea Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 8 Nov 2019 17:31:59 +0200 Subject: SL-12186 WIP Minor updates for 'Camera controls' and 'Save preset' floaters --- indra/newview/llfloaterdeleteprefpreset.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llfloaterdeleteprefpreset.cpp') diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index bd62849b42..0765756b43 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -82,6 +82,13 @@ void LLFloaterDeletePrefPreset::onBtnDelete() args["NAME"] = name; LLNotificationsUtil::add("PresetNotDeleted", args); } + else if (mSubdirectory == PRESETS_CAMERA) + { + if (gSavedSettings.getString("PresetCameraActive") == name) + { + gSavedSettings.setString("PresetCameraActive", ""); + } + } closeFloater(); } -- cgit v1.2.3