From 4125bebce7116e074aef664026b9ed33ffa9ca19 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Fri, 29 Apr 2016 20:28:11 +0300 Subject: MAINT-6226 Incorporate a customized Snapshot feature to Outfit Browser flow Initial version, further refactoring pending --- indra/newview/llpanelsnapshot.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelsnapshot.cpp') diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index 106fb4997e..ca62f2bdf5 100755 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -76,11 +76,11 @@ void LLPanelSnapshot::onOpen(const LLSD& key) // e.g. attempt to send a large BMP image by email. if (old_format != new_format) { - LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true)); + getParentByType()->notify(LLSD().with("image-format-change", true)); } } -LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const +LLFloaterSnapshotBase::ESnapshotFormat LLPanelSnapshot::getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; } @@ -171,7 +171,7 @@ void LLPanelSnapshot::goBack() void LLPanelSnapshot::cancel() { goBack(); - LLFloaterSnapshot::getInstance()->notify(LLSD().with("set-ready", true)); + getParentByType()->notify(LLSD().with("set-ready", true)); } void LLPanelSnapshot::onCustomResolutionCommit() @@ -179,6 +179,7 @@ void LLPanelSnapshot::onCustomResolutionCommit() LLSD info; LLSpinCtrl *widthSpinner = getChild(getWidthSpinnerName()); LLSpinCtrl *heightSpinner = getChild(getHeightSpinnerName()); + //TODO: Refactoring - move this code into some virtual method of LLPanelSnapshotInventory if (getName() == "panel_snapshot_inventory") { S32 width = widthSpinner->getValue().asInteger(); @@ -197,17 +198,22 @@ void LLPanelSnapshot::onCustomResolutionCommit() info["w"] = widthSpinner->getValue().asInteger(); info["h"] = heightSpinner->getValue().asInteger(); } - LLFloaterSnapshot::getInstance()->notify(LLSD().with("custom-res-change", info)); + getParentByType()->notify(LLSD().with("custom-res-change", info)); } void LLPanelSnapshot::onResolutionComboCommit(LLUICtrl* ctrl) { LLSD info; info["combo-res-change"]["control-name"] = ctrl->getName(); - LLFloaterSnapshot::getInstance()->notify(info); + getParentByType()->notify(info); } void LLPanelSnapshot::onKeepAspectRatioCommit(LLUICtrl* ctrl) { - LLFloaterSnapshot::getInstance()->notify(LLSD().with("keep-aspect-change", ctrl->getValue().asBoolean())); + getParentByType()->notify(LLSD().with("keep-aspect-change", ctrl->getValue().asBoolean())); +} + +LLPanelSnapshot::ESnapshotType LLPanelSnapshot::getSnapshotType() +{ + return ESnapshotType::SNAPSHOT_WEB; } -- cgit v1.2.3 From 8b3f4ec5f58c1488ac7b3403a1a510a4977cebf6 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Thu, 5 May 2016 19:43:02 +0300 Subject: MAINT-6226 Incorporate a customized Snapshot feature to Outfit Browser flow Removed odd controls like custom resolution spinners etc --- indra/newview/llpanelsnapshot.cpp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'indra/newview/llpanelsnapshot.cpp') diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index ca62f2bdf5..284f7aad3f 100755 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -54,10 +54,18 @@ S32 power_of_two(S32 sz, S32 upper) BOOL LLPanelSnapshot::postBuild() { getChild(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onResolutionComboCommit, this, _1)); - getChild(getWidthSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onCustomResolutionCommit, this)); - getChild(getHeightSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onCustomResolutionCommit, this)); - getChild(getAspectRatioCBName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onKeepAspectRatioCommit, this, _1)); - + if (!getWidthSpinnerName().empty()) + { + getChild(getWidthSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onCustomResolutionCommit, this)); + } + if (!getHeightSpinnerName().empty()) + { + getChild(getHeightSpinnerName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onCustomResolutionCommit, this)); + } + if (!getAspectRatioCBName().empty()) + { + getChild(getAspectRatioCBName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onKeepAspectRatioCommit, this, _1)); + } updateControls(LLSD()); return TRUE; } @@ -92,27 +100,32 @@ void LLPanelSnapshot::enableControls(BOOL enable) LLSpinCtrl* LLPanelSnapshot::getWidthSpinner() { + llassert(!getWidthSpinnerName().empty()); return getChild(getWidthSpinnerName()); } LLSpinCtrl* LLPanelSnapshot::getHeightSpinner() { + llassert(!getHeightSpinnerName().empty()); return getChild(getHeightSpinnerName()); } S32 LLPanelSnapshot::getTypedPreviewWidth() const { + llassert(!getWidthSpinnerName().empty()); return getChild(getWidthSpinnerName())->getValue().asInteger(); } S32 LLPanelSnapshot::getTypedPreviewHeight() const { - return getChild(getHeightSpinnerName())->getValue().asInteger(); + llassert(!getHeightSpinnerName().empty()); + return getChild(getHeightSpinnerName())->getValue().asInteger(); } void LLPanelSnapshot::enableAspectRatioCheckbox(BOOL enable) { - getChild(getAspectRatioCBName())->setEnabled(enable); + llassert(!getAspectRatioCBName().empty()); + getChild(getAspectRatioCBName())->setEnabled(enable); } LLSideTrayPanelContainer* LLPanelSnapshot::getParentContainer() @@ -177,9 +190,11 @@ void LLPanelSnapshot::cancel() void LLPanelSnapshot::onCustomResolutionCommit() { LLSD info; - LLSpinCtrl *widthSpinner = getChild(getWidthSpinnerName()); - LLSpinCtrl *heightSpinner = getChild(getHeightSpinnerName()); - //TODO: Refactoring - move this code into some virtual method of LLPanelSnapshotInventory + std::string widthSpinnerName = getWidthSpinnerName(); + std::string heightSpinnerName = getHeightSpinnerName(); + llassert(!widthSpinnerName.empty() && !heightSpinnerName.empty()); + LLSpinCtrl *widthSpinner = getChild(widthSpinnerName); + LLSpinCtrl *heightSpinner = getChild(heightSpinnerName); if (getName() == "panel_snapshot_inventory") { S32 width = widthSpinner->getValue().asInteger(); -- cgit v1.2.3 From 042930b59a82f706f16e4b67a683697aed65112f Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 6 May 2016 12:43:48 +0300 Subject: linux build fix --- indra/newview/llpanelsnapshot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelsnapshot.cpp') diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index 284f7aad3f..e320c4ce8b 100755 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -230,5 +230,5 @@ void LLPanelSnapshot::onKeepAspectRatioCommit(LLUICtrl* ctrl) LLPanelSnapshot::ESnapshotType LLPanelSnapshot::getSnapshotType() { - return ESnapshotType::SNAPSHOT_WEB; + return LLPanelSnapshot::SNAPSHOT_WEB; } -- cgit v1.2.3 From 9f789ddfbad656b0a6e1f59b592795ad22bdd061 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Thu, 2 Jun 2016 20:23:46 +0300 Subject: MAINT-5194 Visual Outfit browser Made refactoring of LLFloaterOutfitSnapshot and LLFloaterSnapshot --- indra/newview/llpanelsnapshot.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanelsnapshot.cpp') diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index e320c4ce8b..a17e3f9e78 100644 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -29,6 +29,8 @@ // libs #include "llcombobox.h" +#include "llfloater.h" +#include "llfloatersnapshot.h" #include "llsliderctrl.h" #include "llspinctrl.h" #include "lltrans.h" @@ -50,6 +52,10 @@ S32 power_of_two(S32 sz, S32 upper) return res; } +LLPanelSnapshot::LLPanelSnapshot() + : mSnapshotFloater(NULL) +{} + // virtual BOOL LLPanelSnapshot::postBuild() { @@ -67,6 +73,8 @@ BOOL LLPanelSnapshot::postBuild() getChild(getAspectRatioCBName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onKeepAspectRatioCommit, this, _1)); } updateControls(LLSD()); + + mSnapshotFloater = getParentByType(); return TRUE; } @@ -88,9 +96,9 @@ void LLPanelSnapshot::onOpen(const LLSD& key) } } -LLFloaterSnapshotBase::ESnapshotFormat LLPanelSnapshot::getImageFormat() const +LLSnapshotModel::ESnapshotFormat LLPanelSnapshot::getImageFormat() const { - return LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; + return LLSnapshotModel::SNAPSHOT_FORMAT_JPEG; } void LLPanelSnapshot::enableControls(BOOL enable) @@ -228,7 +236,7 @@ void LLPanelSnapshot::onKeepAspectRatioCommit(LLUICtrl* ctrl) getParentByType()->notify(LLSD().with("keep-aspect-change", ctrl->getValue().asBoolean())); } -LLPanelSnapshot::ESnapshotType LLPanelSnapshot::getSnapshotType() +LLSnapshotModel::ESnapshotType LLPanelSnapshot::getSnapshotType() { - return LLPanelSnapshot::SNAPSHOT_WEB; + return LLSnapshotModel::SNAPSHOT_WEB; } -- cgit v1.2.3