ACME-1471 WIP [VWR] Merge multiple Exp Perm dialogs into one
merged multiple experience toasts into a single one reviewed by Chomaster
parent
8a45e1915d
commit
f06b305d9f
|
|
@ -169,6 +169,7 @@ public:
|
|||
virtual ~LLScriptHandler();
|
||||
|
||||
virtual void onDelete(LLNotificationPtr p);
|
||||
virtual void onChange(LLNotificationPtr p);
|
||||
virtual bool processNotification(const LLNotificationPtr& p);
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -116,18 +116,28 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification)
|
|||
return false;
|
||||
}
|
||||
|
||||
void LLScriptHandler::onChange( LLNotificationPtr notification )
|
||||
{
|
||||
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
|
||||
if (channel)
|
||||
{
|
||||
LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification);
|
||||
channel->modifyToastByNotificationID(notification->getID(), notify_box);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void LLScriptHandler::onDelete( LLNotificationPtr notification )
|
||||
{
|
||||
{
|
||||
if(notification->hasFormElements() && !notification->canShowToast())
|
||||
{
|
||||
LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
|
||||
}
|
||||
else
|
||||
{
|
||||
mChannel.get()->removeToastByNotificationID(notification->getID());
|
||||
}
|
||||
{
|
||||
LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
|
||||
}
|
||||
else
|
||||
{
|
||||
mChannel.get()->removeToastByNotificationID(notification->getID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -533,19 +533,23 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
|
|||
{
|
||||
std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), id);
|
||||
|
||||
LLPanel* panel_to_delete = panel;
|
||||
|
||||
if( it != mToastList.end() && panel)
|
||||
{
|
||||
LLToast* toast = it->getToast();
|
||||
if (toast)
|
||||
{
|
||||
LLPanel* old_panel = toast->getPanel();
|
||||
toast->removeChild(old_panel);
|
||||
delete old_panel;
|
||||
toast->insertPanel(panel);
|
||||
toast->startTimer();
|
||||
LLPanel* old_panel = toast->getPanel();
|
||||
toast->removeChild(old_panel);
|
||||
panel_to_delete = old_panel;
|
||||
toast->insertPanel(panel);
|
||||
toast->startTimer();
|
||||
}
|
||||
redrawToasts();
|
||||
}
|
||||
|
||||
delete panel_to_delete;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in New Issue