From 9eabb2797ea6a485c2b82efb0c31da55755cbca2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 8 May 2018 12:42:35 +0000 Subject: MAINT-8586 XUI cleanup --- indra/newview/llsidepanelinventorysubpanel.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'indra/newview/llsidepanelinventorysubpanel.cpp') diff --git a/indra/newview/llsidepanelinventorysubpanel.cpp b/indra/newview/llsidepanelinventorysubpanel.cpp index 2918bb388a..3b73b6b7dd 100644 --- a/indra/newview/llsidepanelinventorysubpanel.cpp +++ b/indra/newview/llsidepanelinventorysubpanel.cpp @@ -50,8 +50,7 @@ LLSidepanelInventorySubpanel::LLSidepanelInventorySubpanel(const LLPanel::Params : LLPanel(p), mIsDirty(TRUE), mIsEditing(FALSE), - mCancelBtn(NULL), - mSaveBtn(NULL) + mCancelBtn(NULL) { } @@ -63,11 +62,12 @@ LLSidepanelInventorySubpanel::~LLSidepanelInventorySubpanel() // virtual BOOL LLSidepanelInventorySubpanel::postBuild() { - mSaveBtn = getChild("save_btn"); - mSaveBtn->setClickedCallback(boost::bind(&LLSidepanelInventorySubpanel::onSaveButtonClicked, this)); - mCancelBtn = getChild("cancel_btn"); - mCancelBtn->setClickedCallback(boost::bind(&LLSidepanelInventorySubpanel::onCancelButtonClicked, this)); + mCancelBtn = findChild("cancel_btn"); + if (mCancelBtn) + { + mCancelBtn->setClickedCallback(boost::bind(&LLSidepanelInventorySubpanel::onCancelButtonClicked, this)); + } return TRUE; } @@ -118,8 +118,10 @@ void LLSidepanelInventorySubpanel::dirty() void LLSidepanelInventorySubpanel::updateVerbs() { - mSaveBtn->setVisible(mIsEditing); - mCancelBtn->setVisible(mIsEditing); + if (mCancelBtn) + { + mCancelBtn->setVisible(mIsEditing); + } } void LLSidepanelInventorySubpanel::onEditButtonClicked() @@ -129,14 +131,6 @@ void LLSidepanelInventorySubpanel::onEditButtonClicked() updateVerbs(); } -void LLSidepanelInventorySubpanel::onSaveButtonClicked() -{ - save(); - setIsEditing(FALSE); - refresh(); - updateVerbs(); -} - void LLSidepanelInventorySubpanel::onCancelButtonClicked() { setIsEditing(FALSE); -- cgit v1.2.3