Updated normal task EXT-5905 - Resolving offers.
Implemented requested feature - "Resolving offer in the notification toast shouldn't remove offer panel form IM log until IM session is restarted" --HG-- branch : product-enginemeow-7.2.2
parent
3874823bd8
commit
97dea26dfc
|
|
@ -486,6 +486,7 @@ void LLNotification::updateFrom(LLNotificationPtr other)
|
|||
mForm = other->mForm;
|
||||
mResponseFunctorName = other->mResponseFunctorName;
|
||||
mRespondedTo = other->mRespondedTo;
|
||||
mResponse = other->mResponse;
|
||||
mTemporaryResponder = other->mTemporaryResponder;
|
||||
|
||||
update();
|
||||
|
|
@ -563,7 +564,9 @@ std::string LLNotification::getSelectedOptionName(const LLSD& response)
|
|||
|
||||
void LLNotification::respond(const LLSD& response)
|
||||
{
|
||||
// *TODO may remove mRespondedTo and use mResponce.isDefined() in isRespondedTo()
|
||||
mRespondedTo = true;
|
||||
mResponse = response;
|
||||
// look up the functor
|
||||
LLNotificationFunctorRegistry::ResponseFunctor functor =
|
||||
LLNotificationFunctorRegistry::instance().getFunctor(mResponseFunctorName);
|
||||
|
|
@ -875,7 +878,11 @@ bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPt
|
|||
if (wasFound)
|
||||
{
|
||||
abortProcessing = mChanged(payload);
|
||||
mItems.erase(pNotification);
|
||||
// do not delete the notification to make LLChatHistory::appendMessage add notification panel to IM window
|
||||
if( ! pNotification->getPayload()["reusable"].asBoolean() )
|
||||
{
|
||||
mItems.erase(pNotification);
|
||||
}
|
||||
onDelete(pNotification);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -344,6 +344,7 @@ private:
|
|||
LLDate mExpiresAt;
|
||||
bool mCancelled;
|
||||
bool mRespondedTo; // once the notification has been responded to, this becomes true
|
||||
LLSD mResponse;
|
||||
bool mIgnored;
|
||||
ENotificationPriority mPriority;
|
||||
LLNotificationFormPtr mForm;
|
||||
|
|
@ -445,6 +446,8 @@ public:
|
|||
return mRespondedTo;
|
||||
}
|
||||
|
||||
const LLSD& getResponse() { return mResponse; }
|
||||
|
||||
bool isIgnored() const
|
||||
{
|
||||
return mIgnored;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ S32 BUTTON_WIDTH = 90;
|
|||
const LLFontGL* LLToastNotifyPanel::sFont = NULL;
|
||||
const LLFontGL* LLToastNotifyPanel::sFontSmall = NULL;
|
||||
|
||||
LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal;
|
||||
LLToastNotifyPanel::LLToastNotifyPanel(LLNotificationPtr& notification, const LLRect& rect) :
|
||||
|
||||
LLToastPanel(notification),
|
||||
mTextBox(NULL),
|
||||
mInfoPanel(NULL),
|
||||
|
|
@ -202,6 +204,18 @@ mCloseNotificationOnDestroy(true)
|
|||
// adjust panel's height to the text size
|
||||
mInfoPanel->setFollowsAll();
|
||||
snapToMessageHeight(mTextBox, MAX_LENGTH);
|
||||
|
||||
if(notification->getPayload()["reusable"].asBoolean())
|
||||
{
|
||||
mButtonClickConnection = sButtonClickSignal.connect(
|
||||
boost::bind(&LLToastNotifyPanel::onToastPanelButtonClicked, this, _1, _2));
|
||||
|
||||
if(notification->isRespondedTo())
|
||||
{
|
||||
// User selected an option in toast, now disable required buttons in IM window
|
||||
disableRespondedOptions(notification);
|
||||
}
|
||||
}
|
||||
}
|
||||
void LLToastNotifyPanel::addDefaultButton()
|
||||
{
|
||||
|
|
@ -269,6 +283,8 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt
|
|||
|
||||
LLToastNotifyPanel::~LLToastNotifyPanel()
|
||||
{
|
||||
mButtonClickConnection.disconnect();
|
||||
|
||||
std::for_each(mBtnCallbackData.begin(), mBtnCallbackData.end(), DeletePointer());
|
||||
if (mCloseNotificationOnDestroy && LLNotificationsUtil::find(mNotification->getID()) != NULL)
|
||||
{
|
||||
|
|
@ -431,7 +447,7 @@ void LLToastNotifyPanel::onClickButton(void* data)
|
|||
|
||||
if(is_reusable)
|
||||
{
|
||||
self->disableButtons(self->mNotification->getName(), button_name);
|
||||
sButtonClickSignal(self->mNotification->getID(), button_name);
|
||||
|
||||
if(new_info)
|
||||
{
|
||||
|
|
@ -445,3 +461,28 @@ void LLToastNotifyPanel::onClickButton(void* data)
|
|||
self->mControlPanel->setEnabled(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void LLToastNotifyPanel::onToastPanelButtonClicked(const LLUUID& notification_id, const std::string btn_name)
|
||||
{
|
||||
if(mNotification->getID() == notification_id)
|
||||
{
|
||||
disableButtons(mNotification->getName(), btn_name);
|
||||
}
|
||||
}
|
||||
|
||||
void LLToastNotifyPanel::disableRespondedOptions(LLNotificationPtr& notification)
|
||||
{
|
||||
LLSD response = notification->getResponse();
|
||||
for (LLSD::map_const_iterator response_it = response.beginMap();
|
||||
response_it != response.endMap(); ++response_it)
|
||||
{
|
||||
if (response_it->second.isBoolean() && response_it->second.asBoolean())
|
||||
{
|
||||
// that after multiple responses there can be many pressed buttons
|
||||
// need to process them all
|
||||
disableButtons(notification->getName(), response_it->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
|
|
|||
|
|
@ -108,6 +108,21 @@ private:
|
|||
// internal handler for button being clicked
|
||||
static void onClickButton(void* data);
|
||||
|
||||
typedef boost::signals2::signal <void (const LLUUID& notification_id, const std::string btn_name)>
|
||||
button_click_signal_t;
|
||||
static button_click_signal_t sButtonClickSignal;
|
||||
boost::signals2::connection mButtonClickConnection;
|
||||
|
||||
/**
|
||||
* handle sButtonClickSignal (to disable buttons) across all panels with given notification_id
|
||||
*/
|
||||
void onToastPanelButtonClicked(const LLUUID& notification_id, const std::string btn_name);
|
||||
|
||||
/**
|
||||
* Process response data. Will disable selected options
|
||||
*/
|
||||
void disableRespondedOptions(LLNotificationPtr& notification);
|
||||
|
||||
bool mIsTip;
|
||||
bool mAddedDefaultBtn;
|
||||
bool mIsScriptDialog;
|
||||
|
|
|
|||
Loading…
Reference in New Issue