From a5261a5fa8fad810ecb5c260d92c3e771822bf58 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 20 Feb 2024 23:46:23 +0100 Subject: Convert BOOL to bool in llui --- indra/newview/llpanelsnapshotprofile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelsnapshotprofile.cpp') diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp index 38dec78030..84742fad64 100644 --- a/indra/newview/llpanelsnapshotprofile.cpp +++ b/indra/newview/llpanelsnapshotprofile.cpp @@ -49,7 +49,7 @@ class LLPanelSnapshotProfile public: LLPanelSnapshotProfile(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ bool postBuild(); /*virtual*/ void onOpen(const LLSD& key); private: @@ -73,7 +73,7 @@ LLPanelSnapshotProfile::LLPanelSnapshotProfile() } // virtual -BOOL LLPanelSnapshotProfile::postBuild() +bool LLPanelSnapshotProfile::postBuild() { return LLPanelSnapshot::postBuild(); } -- cgit v1.2.3 From e2e37cced861b98de8c1a7c9c0d3a50d2d90e433 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 22 May 2024 21:25:21 +0200 Subject: Fix line endlings --- indra/newview/llpanelsnapshotprofile.cpp | 202 +++++++++++++++---------------- 1 file changed, 101 insertions(+), 101 deletions(-) (limited to 'indra/newview/llpanelsnapshotprofile.cpp') diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp index 3a1d0aa9a9..aa257dea9e 100644 --- a/indra/newview/llpanelsnapshotprofile.cpp +++ b/indra/newview/llpanelsnapshotprofile.cpp @@ -1,101 +1,101 @@ -/** - * @file llpanelsnapshotprofile.cpp - * @brief Posts a snapshot to My Profile feed. - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -// libs -#include "llcombobox.h" -#include "llfloaterreg.h" -#include "llpanel.h" -#include "llspinctrl.h" - -// newview -#include "llfloatersnapshot.h" -#include "llpanelsnapshot.h" -#include "llsidetraypanelcontainer.h" -#include "llwebprofile.h" - -/** - * Posts a snapshot to My Profile feed. - */ -class LLPanelSnapshotProfile -: public LLPanelSnapshot -{ - LOG_CLASS(LLPanelSnapshotProfile); - -public: - LLPanelSnapshotProfile(); - - /*virtual*/ bool postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - -private: - /*virtual*/ std::string getWidthSpinnerName() const { return "profile_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "profile_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "profile_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "profile_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "profile_image_size_lp"; } - /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; } - /*virtual*/ void updateControls(const LLSD& info); - - void onSend(); -}; - -static LLPanelInjector panel_class("llpanelsnapshotprofile"); - -LLPanelSnapshotProfile::LLPanelSnapshotProfile() -{ - mCommitCallbackRegistrar.add("PostToProfile.Send", boost::bind(&LLPanelSnapshotProfile::onSend, this)); - mCommitCallbackRegistrar.add("PostToProfile.Cancel", boost::bind(&LLPanelSnapshotProfile::cancel, this)); -} - -// virtual -bool LLPanelSnapshotProfile::postBuild() -{ - return LLPanelSnapshot::postBuild(); -} - -// virtual -void LLPanelSnapshotProfile::onOpen(const LLSD& key) -{ - LLPanelSnapshot::onOpen(key); -} - -// virtual -void LLPanelSnapshotProfile::updateControls(const LLSD& info) -{ - const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; - getChild("post_btn")->setEnabled(have_snapshot); -} - -void LLPanelSnapshotProfile::onSend() -{ - std::string caption = getChild("caption")->getValue().asString(); - bool add_location = getChild("add_location_cb")->getValue().asBoolean(); - - LLWebProfile::uploadImage(mSnapshotFloater->getImageData(), caption, add_location); - mSnapshotFloater->postSave(); -} +/** + * @file llpanelsnapshotprofile.cpp + * @brief Posts a snapshot to My Profile feed. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +// libs +#include "llcombobox.h" +#include "llfloaterreg.h" +#include "llpanel.h" +#include "llspinctrl.h" + +// newview +#include "llfloatersnapshot.h" +#include "llpanelsnapshot.h" +#include "llsidetraypanelcontainer.h" +#include "llwebprofile.h" + +/** + * Posts a snapshot to My Profile feed. + */ +class LLPanelSnapshotProfile +: public LLPanelSnapshot +{ + LOG_CLASS(LLPanelSnapshotProfile); + +public: + LLPanelSnapshotProfile(); + + /*virtual*/ bool postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + +private: + /*virtual*/ std::string getWidthSpinnerName() const { return "profile_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const { return "profile_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const { return "profile_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const { return "profile_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "profile_image_size_lp"; } + /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; } + /*virtual*/ void updateControls(const LLSD& info); + + void onSend(); +}; + +static LLPanelInjector panel_class("llpanelsnapshotprofile"); + +LLPanelSnapshotProfile::LLPanelSnapshotProfile() +{ + mCommitCallbackRegistrar.add("PostToProfile.Send", boost::bind(&LLPanelSnapshotProfile::onSend, this)); + mCommitCallbackRegistrar.add("PostToProfile.Cancel", boost::bind(&LLPanelSnapshotProfile::cancel, this)); +} + +// virtual +bool LLPanelSnapshotProfile::postBuild() +{ + return LLPanelSnapshot::postBuild(); +} + +// virtual +void LLPanelSnapshotProfile::onOpen(const LLSD& key) +{ + LLPanelSnapshot::onOpen(key); +} + +// virtual +void LLPanelSnapshotProfile::updateControls(const LLSD& info) +{ + const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; + getChild("post_btn")->setEnabled(have_snapshot); +} + +void LLPanelSnapshotProfile::onSend() +{ + std::string caption = getChild("caption")->getValue().asString(); + bool add_location = getChild("add_location_cb")->getValue().asBoolean(); + + LLWebProfile::uploadImage(mSnapshotFloater->getImageData(), caption, add_location); + mSnapshotFloater->postSave(); +} -- cgit v1.2.3