diff options
author | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-03-10 11:24:22 +0200 |
---|---|---|
committer | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-03-10 11:24:22 +0200 |
commit | d6b32cd0a83385c10fa6a450337379aae5a04dd4 (patch) | |
tree | 3410e3bcd1f0f85004ce6450b4448e62e6af20cc | |
parent | 2197304984f8e32d8b8fcddf7271188a98259c64 (diff) |
Update for major bug EXT-5942 - Entering a Classified with a banned keyword doesn't publish, and doesn't let you edit.
Updated code for disabling verbs for unpublished classified.
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llpanelpicks.h | 2 |
2 files changed, 27 insertions, 8 deletions
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 287896bf65..0a7c39db46 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -423,6 +423,22 @@ bool LLPanelPicks::isActionEnabled(const LLSD& userdata) const return true; } +bool LLPanelPicks::isClassifiedPublished(LLClassifiedItem* c_item) +{ + if(c_item) + { + LLPanelClassifiedEdit* panel = mEditClassifiedPanels[c_item->getClassifiedId()]; + if(panel) + { + return !panel->isNewWithErrors(); + } + + // we've got this classified from server - it's published + return true; + } + return false; +} + void LLPanelPicks::onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab) { if(!mPicksAccTab->getDisplayChildren()) @@ -659,6 +675,12 @@ void LLPanelPicks::updateButtons() childSetEnabled(XML_BTN_INFO, has_selected); childSetEnabled(XML_BTN_TELEPORT, has_selected); childSetEnabled(XML_BTN_SHOW_ON_MAP, has_selected); + + LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); + if(c_item) + { + childSetEnabled(XML_BTN_INFO, isClassifiedPublished(c_item)); + } } void LLPanelPicks::setProfilePanel(LLPanelProfile* profile_panel) @@ -988,15 +1010,10 @@ bool LLPanelPicks::onEnableMenuItem(const LLSD& user_data) std::string param = user_data.asString(); LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); - if(c_item) + if(c_item && "info" == param) { - LLPanelClassifiedEdit* panel = mEditClassifiedPanels[c_item->getClassifiedId()]; - - if(panel && "info" == param) - { - // dont show Info panel if classified was not created - return ! panel->isNewWithErrors(); - } + // dont show Info panel if classified was not created + return isClassifiedPublished(c_item); } return true; diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 6d013035a2..a98b8c413e 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -98,6 +98,8 @@ private: void onPlusMenuItemClicked(const LLSD& param); bool isActionEnabled(const LLSD& userdata) const; + bool isClassifiedPublished(LLClassifiedItem* c_item); + void onListCommit(const LLFlatListView* f_list); void onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab); |