From bfced6d4c13b06cc6332583bd8808dee547352c7 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 31 May 2010 15:55:08 +0300 Subject: EXT-7485 FIXED Updated 'save as new' button on inventory outfit pane to fit spec. * moved logic related to combo button from LLPanelOutfitEdit to LLSaveOutfitComboBtn class; * used LLSaveOutfitComboBtn class in LLPanelOutfitsInventory; reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/459/ --HG-- branch : product-engine --- indra/newview/llsaveoutfitcombobtn.h | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 indra/newview/llsaveoutfitcombobtn.h (limited to 'indra/newview/llsaveoutfitcombobtn.h') diff --git a/indra/newview/llsaveoutfitcombobtn.h b/indra/newview/llsaveoutfitcombobtn.h new file mode 100644 index 0000000000..afd10316b5 --- /dev/null +++ b/indra/newview/llsaveoutfitcombobtn.h @@ -0,0 +1,60 @@ +/** + * @file llsaveoutfitcombobtn.h + * @brief Represents outfit save/save as combo button. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSAVEOUTFITCOMBOBTN_H +#define LL_LLSAVEOUTFITCOMBOBTN_H + +class LLButton; +class LLToggleableMenu; + + +/** + * Represents outfit Save/Save As combo button. + */ +class LLSaveOutfitComboBtn +{ + LOG_CLASS(LLSaveOutfitComboBtn); +public: + LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAction = false); + + void showSaveMenu(); + void saveOutfit(bool as_new = false); + void setMenuItemEnabled(const std::string& item, bool enabled); + void setSaveBtnEnabled(bool enabled); + +private: + bool mSaveAsDefaultAction; + LLPanel* mParent; + std::auto_ptr mSaveMenu; +}; + +#endif // LL_LLSAVEOUTFITCOMBOBTN_H -- cgit v1.2.3 From 325729b739475b5c6b4227f4d1951a70cb9d7028 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 31 May 2010 17:46:50 +0300 Subject: EXT-7485 ADDITIONAL FIX Fixed crash at viewer exit used raw pointer instead of auto_ptr, since lifetime of mSaveMenu field controlled by parent gMenuHolder --HG-- branch : product-engine --- indra/newview/llsaveoutfitcombobtn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llsaveoutfitcombobtn.h') diff --git a/indra/newview/llsaveoutfitcombobtn.h b/indra/newview/llsaveoutfitcombobtn.h index d505c4bebe..fec7122194 100644 --- a/indra/newview/llsaveoutfitcombobtn.h +++ b/indra/newview/llsaveoutfitcombobtn.h @@ -54,7 +54,7 @@ public: private: bool mSaveAsDefaultAction; LLPanel* mParent; - std::auto_ptr mSaveMenu; + LLToggleableMenu* mSaveMenu; }; #endif // LL_LLSAVEOUTFITCOMBOBTN_H -- cgit v1.2.3