BOOL LLFloaterCustomize::isDirty() const
{
	LLWearableType::EType cur = getCurrentWearableType();
	for(U32 i = 0; i < gAgentWearables.getWearableCount(cur); ++i)
	{
		LLWearable* wearable = gAgentWearables.getWearable(cur,i);
		if(wearable && wearable->isDirty())
			return TRUE;
	}
	return FALSE;
}
bool LLFloaterCustomize::onSaveDialog(const LLSD& notification, const LLSD& response )
{
	S32 option = LLNotification::getSelectedOption(notification, response);

	BOOL proceed = FALSE;
	LLWearableType::EType cur = getCurrentWearableType();

	for(U32 i = 0;i < gAgentWearables.getWearableCount(cur);++i)
	{
		LLWearable* wearable = gAgentWearables.getWearable(cur,i);
		if(wearable && wearable->isDirty())
		{
			switch( option )
			{
			case 0:  // "Save"
				gAgentWearables.saveWearable( cur, i );
				proceed = TRUE;
				break;

			case 1:  // "Don't Save"
				{
					gAgentWearables.revertWearable( cur, i );
					proceed = TRUE;
				}
				break;

			case 2: // "Cancel"
				break;

			default:
				llassert(0);
				break;
			}
		}
	}


	mNextStepAfterSaveCallback(proceed);
	mNextStepAfterSaveCallback.disconnect_all_slots();	//Should this be done?

	return false;
}