diff options
Diffstat (limited to 'indra')
| -rwxr-xr-x | indra/newview/llfloaterregioninfo.cpp | 56 | ||||
| -rwxr-xr-x | indra/newview/llnotificationhandler.h | 2 | ||||
| -rwxr-xr-x | indra/newview/llnotificationscripthandler.cpp | 69 | ||||
| -rwxr-xr-x | indra/newview/llscreenchannel.cpp | 14 | ||||
| -rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 84 | 
5 files changed, 186 insertions, 39 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index a63f1173d1..d2e8a4907b 100755 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3720,15 +3720,57 @@ BOOL LLPanelRegionExperiences::sendUpdate()  void LLPanelRegionExperiences::itemChanged( U32 event_type, const LLUUID& id )  { -	if(id == mDefaultExperience) +	std::string dialog_name; +	switch (event_type)  	{ -		return; +		case ESTATE_EXPERIENCE_ALLOWED_ADD: +			dialog_name = "EstateAllowedExperienceAdd"; +			break; + +		case ESTATE_EXPERIENCE_ALLOWED_REMOVE: +			dialog_name = "EstateAllowedExperienceRemove"; +			break; + +		case ESTATE_EXPERIENCE_TRUSTED_ADD: +			dialog_name = "EstateTrustedExperienceAdd"; +			break; + +		case ESTATE_EXPERIENCE_TRUSTED_REMOVE: +			dialog_name = "EstateTrustedExperienceRemove"; +			break; + +		case ESTATE_EXPERIENCE_BLOCKED_ADD: +			dialog_name = "EstateBlockedExperienceAdd"; +			break; + +		case ESTATE_EXPERIENCE_BLOCKED_REMOVE: +			dialog_name = "EstateAllowedExperienceAdd"; +			break; + +		default: +			return; +	} + +	LLSD payload; +	payload["operation"] = (S32)event_type; +	payload["dialog_name"] = dialog_name; +	payload["allowed_ids"].append(id); + +	LLSD args; +	args["ALL_ESTATES"] = all_estates_text(); + +	LLNotification::Params params(dialog_name); +	params.payload(payload) +		.substitutions(args) +		.functor.function(LLPanelEstateInfo::accessCoreConfirm); +	if (LLPanelEstateInfo::isLindenEstate()) +	{ +		LLNotifications::instance().forceResponse(params, 0); +	} +	else +	{ +		LLNotifications::instance().add(params);  	} -	strings_t str(3, std::string()); -	gAgent.getID().toString(str[0]); -	str[1] = llformat("%u", event_type); -	id.toString(str[2]); -	sendEstateOwnerMessage(gMessageSystem, "estateexperiencedelta", LLFloaterRegionInfo::getLastInvoice(), str);  	onChangeAnything();  } diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index bff4efa9ea..3e7f05b5e1 100755 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -169,7 +169,9 @@ public:  	virtual ~LLScriptHandler();  	virtual void onDelete(LLNotificationPtr p); +	virtual void onChange(LLNotificationPtr p);  	virtual bool processNotification(const LLNotificationPtr& p); +	virtual void addToastWithNotification(const LLNotificationPtr& p);  protected:  	virtual void onDeleteToast(LLToast* toast); diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index a3b15931c6..7acb2f9e90 100755 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -68,6 +68,30 @@ void LLScriptHandler::initChannel()  }  //-------------------------------------------------------------------------- +void LLScriptHandler::addToastWithNotification(const LLNotificationPtr& notification) +{ +	LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); + +	LLToast::Params p; +	p.notif_id = notification->getID(); +	p.notification = notification; +	p.panel = notify_box; +	p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1); +	if(gAgent.isDoNotDisturb()) +	{  +		p.force_show = notification->getName() == "SystemMessage"  +						||	notification->getName() == "GodMessage"  +						|| notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH; +	} + +	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get()); +	if(channel) +	{ +		channel->addToast(p); +	} +} + +//--------------------------------------------------------------------------  bool LLScriptHandler::processNotification(const LLNotificationPtr& notification)  {  	if(mChannel.isDead()) @@ -92,42 +116,33 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification)  	}  	else if (notification->canShowToast())  	{ -		LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); - -		LLToast::Params p; -		p.notif_id = notification->getID(); -		p.notification = notification; -		p.panel = notify_box; -		p.on_delete_toast = boost::bind(&LLScriptHandler::onDeleteToast, this, _1); -		if(gAgent.isDoNotDisturb()) -		{  -			p.force_show = notification->getName() == "SystemMessage"  -							||	notification->getName() == "GodMessage"  -							|| notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH; -		} - -		LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get()); -		if(channel) -		{ -			channel->addToast(p); -		} +		addToastWithNotification(notification);  	}  	return false;  } +void LLScriptHandler::onChange( LLNotificationPtr notification ) +{ +	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get()); +	if (channel) +	{ +		channel->removeToastByNotificationID(notification->getID()); +		addToastWithNotification(notification); +	} +}  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()); +	} +}  //-------------------------------------------------------------------------- diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 6a840f3f40..0318199050 100755 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -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;  }  //-------------------------------------------------------------------------- diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 2e804c2404..b207051ec8 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4360,6 +4360,90 @@ Remove estate manager for this estate only or for [ALL_ESTATES]?    <notification     icon="alert.tga" +   label="Select estate" +   name="EstateAllowedExperienceAdd" +   type="alert"> +    Add to allowed list for this estate only or for [ALL_ESTATES]? +    <tag>confirm</tag> +    <usetemplate +     canceltext="Cancel" +     name="yesnocancelbuttons" +     notext="All Estates" +     yestext="This Estate"/> +  </notification> + +  <notification +   icon="alert.tga" +   label="Select estate" +   name="EstateAllowedExperienceRemove" +   type="alert"> +    Remove from allowed list for this estate only or for [ALL_ESTATES]? +    <tag>confirm</tag> +    <usetemplate +     canceltext="Cancel" +     name="yesnocancelbuttons" +     notext="All Estates" +     yestext="This Estate"/> +  </notification> + +  <notification +   icon="alert.tga" +   label="Select estate" +   name="EstateBlockedExperienceAdd" +   type="alert"> +    Add to blocked list for this estate only or for [ALL_ESTATES]? +    <tag>confirm</tag> +    <usetemplate +     canceltext="Cancel" +     name="yesnocancelbuttons" +     notext="All Estates" +     yestext="This Estate"/> +  </notification> + +  <notification +   icon="alert.tga" +   label="Select estate" +   name="EstateBlockedExperienceRemove" +   type="alert"> +    Remove from blocked list for this estate only or for [ALL_ESTATES]? +    <tag>confirm</tag> +    <usetemplate +     canceltext="Cancel" +     name="yesnocancelbuttons" +     notext="All Estates" +     yestext="This Estate"/> +  </notification> + +  <notification +   icon="alert.tga" +   label="Select estate" +   name="EstateTrustedExperienceAdd" +   type="alert"> +    Add to trusted list for this estate only or for [ALL_ESTATES]? +    <tag>confirm</tag> +    <usetemplate +     canceltext="Cancel" +     name="yesnocancelbuttons" +     notext="All Estates" +     yestext="This Estate"/> +  </notification> + +  <notification +   icon="alert.tga" +   label="Select estate" +   name="EstateTrustedExperienceRemove" +   type="alert"> +    Remove from trusted list for this estate only or for [ALL_ESTATES]? +    <tag>confirm</tag> +    <usetemplate +     canceltext="Cancel" +     name="yesnocancelbuttons" +     notext="All Estates" +     yestext="This Estate"/> +  </notification>   + +  <notification +   icon="alert.tga"     label="Confirm Kick"     name="EstateKickUser"     type="alert">  | 
