Exemplo n.º 1
0
static bool sort_toasts_predicate(LLHandle<LLToast> first, LLHandle<LLToast> second)
{
	if (!first.get() || !second.get()) return false; // STORM-1352

	F32 v1 = first.get()->getTimeLeftToLive();
	F32 v2 = second.get()->getTimeLeftToLive();
	return v1 > v2;
}
Exemplo n.º 2
0
// static
void LLPanelGroupGeneral::callbackConfirmMatureApply(S32 option, void* data)
{
	LLHandle<LLPanel>* handlep = (LLHandle<LLPanel>*)data;
	LLPanelGroupGeneral* self = dynamic_cast<LLPanelGroupGeneral*>(handlep->get());
	delete handlep;
	if (self)
	{
		self->confirmMatureApply(option);
	}
}
Exemplo n.º 3
0
// static
void LLPreviewAnim::endAnimCallback( void *userdata )
{
	LLHandle<LLFloater>* handlep = ((LLHandle<LLFloater>*)userdata);
	LLFloater* self = handlep->get();
	delete handlep; // done with the handle
	if (self)
	{
		self->childSetValue("Anim play btn", FALSE);
		self->childSetValue("Anim audition btn", FALSE);
	}
}
	static bool onVisible(LLHandle<LLPanel> inventory_panel_handle,
						  LLSD::String sort_order_str)
	{
		if (inventory_panel_handle.isDead()) return false;

		LLInventoryPanel* inventory_panel = dynamic_cast<LLInventoryPanel*>(inventory_panel_handle.get());

		// Enable sorting by type only for the flat list of items
		// because inventory panel doesn't support this kind of sorting.
		return ( "by_type" == sort_order_str )
				&&	( !inventory_panel || !inventory_panel->getVisible() );
	}
Exemplo n.º 5
0
	/*virtual*/ void httpSuccess()
	{
		if (mHandle.isDead())
		{
			return;
		}

		LLPanelGroupExperiences* panel = mHandle.get();
		if (panel)
		{
			panel->setExperienceList(getContent().get("experience_ids"));
		}
	}
	static bool onCheck(LLHandle<LLView> flat_list_handle,
						LLHandle<LLPanel> inventory_panel_handle,
						LLSD::String sort_order_str)
	{
		if (flat_list_handle.isDead() || inventory_panel_handle.isDead()) return false;

		LLWearableItemsList* flat_list = dynamic_cast<LLWearableItemsList*>(flat_list_handle.get());
		LLInventoryPanel* inventory_panel = dynamic_cast<LLInventoryPanel*>(inventory_panel_handle.get());

		if (!inventory_panel || !flat_list) return false;

		// Inventory panel uses its own sort order independent from
		// flat list view so this flag is used to distinguish between
		// currently visible "tree" or "flat" representation of inventory.
		bool inventory_tree_visible = inventory_panel->getVisible();

		if (inventory_tree_visible)
		{
			U32 sort_order = inventory_panel->getSortOrder();

			if ("by_most_recent" == sort_order_str)
			{
				return LLWearableItemsList::E_SORT_BY_MOST_RECENT & sort_order;
			}
			else if ("by_name" == sort_order_str)
			{
				// If inventory panel is not sorted by date then it is sorted by name.
				return LLWearableItemsList::E_SORT_BY_MOST_RECENT & ~sort_order;
			}
			llwarns << "Unrecognized inventory panel sort order" << llendl;
		}
		else
		{
			LLWearableItemsList::ESortOrder	sort_order = flat_list->getSortOrder();

			if ("by_most_recent" == sort_order_str)
			{
				return LLWearableItemsList::E_SORT_BY_MOST_RECENT == sort_order;
			}
			else if ("by_name" == sort_order_str)
			{
				return LLWearableItemsList::E_SORT_BY_NAME == sort_order;
			}
			else if ("by_type" == sort_order_str)
			{
				return LLWearableItemsList::E_SORT_BY_TYPE_NAME == sort_order;
			}
			llwarns << "Unrecognized wearable list sort order" << llendl;
		}
		return false;
	}
Exemplo n.º 7
0
// static
bool LLUICtrl::controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type)
{
	LLUICtrl* ctrl = handle.get();
	if (ctrl)
	{
		if (type == "value")
		{
			ctrl->setValue(newvalue);
			return true;
		}
		else if (type == "enabled")
		{
			ctrl->setEnabled(newvalue.asBoolean());
			return true;
		}
		else if(type =="disabled")
		{
			ctrl->setEnabled(!newvalue.asBoolean());
			return true;
		}
		else if (type == "visible")
		{
			ctrl->setVisible(newvalue.asBoolean());
			return true;
		}
		else if (type == "invisible")
		{
			ctrl->setVisible(!newvalue.asBoolean());
			return true;
		}
	}
	return false;
}
Exemplo n.º 8
0
// static
void LLPreviewAnim::downloadCompleteCallback(LLVFS *vfs, const LLUUID& uuid, LLAssetType::EType type, void *userdata, S32 result, LLExtStat extstat)
{
	LLHandle<LLFloater>* handlep = ((LLHandle<LLFloater>*)userdata);
	LLPreviewAnim* self = (LLPreviewAnim*)handlep->get();
	delete handlep; // done with the handle
	if (self)
	{
		if(result == LL_ERR_NOERR) {
			self->childSetEnabled("Anim remake btn", TRUE);
			self->childSetEnabled("Anim export btn", TRUE);
			self->childSetEnabled("Anim .anim btn", TRUE);
			self->mAnimBufferSize = vfs->getSize(uuid, type);
			self->mAnimBuffer = new U8[self->mAnimBufferSize];
			vfs->getData(uuid, type, self->mAnimBuffer, 0, self->mAnimBufferSize);
		}
	}
}
Exemplo n.º 9
0
	  void completeAny(U32 status, const std::string& mime_type)
	  {
		  // Set empty type to none/none.  Empty string is reserved for legacy parcels
		  // which have no mime type set.
		  std::string resolved_mime_type = ! mime_type.empty() ? mime_type : LLMIMETypes::getDefaultMimeType();
		  LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mParent.get();
		  if ( floater_url_entry )
			  floater_url_entry->headerFetchComplete( status, resolved_mime_type );
	  }
Exemplo n.º 10
0
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
									   const LLAvatarName& av_name,
									   std::string suffix,
									   LLHandle<LLNameListItem> item)
{
	avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
	if (it != mAvatarNameCacheConnections.end())
	{
		if (it->second.connected())
		{
			it->second.disconnect();
		}
		mAvatarNameCacheConnections.erase(it);
	}

	std::string name;
	if (mShortNames)
		name = av_name.getDisplayName();
	else
		name = av_name.getCompleteName();

	// Append optional suffix.
	if (!suffix.empty())
	{
		name.append(suffix);
	}

	LLNameListItem* list_item = item.get();
	if (list_item && list_item->getUUID() == agent_id)
	{
		LLScrollListCell* cell = list_item->getColumn(mNameColumnIndex);
		if (cell)
		{
			cell->setValue(name);
			setNeedsSort();
		}
	}
	
	//////////////////////////////////////////////////////////////////////////
	// BAKER - FIX NameListCtrl
 	//if (mPendingLookupsRemaining <= 0)
 	{
 		// We might get into a state where mPendingLookupsRemaining might
 		//	go negative.  So just reset it right now and figure out if it's
 		//	possible later :)
 		//mPendingLookupsRemaining = 0;
		
 		mNameListCompleteSignal(true);
 	}
 	//else
 	{
 	//	mPendingLookupsRemaining--;
 	}
	//////////////////////////////////////////////////////////////////////////

	dirtyColumns();
}
Exemplo n.º 11
0
bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y)
{
	std::list< LLHandle<LLView> > dead_handles;
	
	bool res = true;
	for (controls_set_t::iterator it = set.begin(); it
			!= set.end(); it++)
	{
		LLView* control_view = NULL;

		LLHandle<LLView> handle = *it;
		if (handle.isDead())
		{
			dead_handles.push_back(handle);
			continue;
		}

		control_view = handle.get();

		if (!control_view->getVisible())
		{
			continue;
		}

		LLRect rect = control_view->calcScreenRect();
		// if click inside view rect
		if (rect.pointInRect(x, y))
		{
			res = false;
			break;
		}
	}

	for (std::list< LLHandle<LLView> >::iterator it = dead_handles.begin(); it != dead_handles.end(); ++it)
	{
		LLHandle<LLView> handle = *it;
		mGroupControls.find(group)->second.erase(handle);
	}
	
	return res;
}
	static void onSort(LLHandle<LLView> flat_list_handle,
					   LLHandle<LLPanel> inventory_panel_handle,
					   LLSD::String sort_order_str)
	{
		if (flat_list_handle.isDead() || inventory_panel_handle.isDead()) return;

		LLWearableItemsList* flat_list = dynamic_cast<LLWearableItemsList*>(flat_list_handle.get());
		LLInventoryPanel* inventory_panel = dynamic_cast<LLInventoryPanel*>(inventory_panel_handle.get());

		if (!flat_list || !inventory_panel) return;

		LLWearableItemsList::ESortOrder	sort_order;

		if ("by_most_recent" == sort_order_str)
		{
			sort_order = LLWearableItemsList::E_SORT_BY_MOST_RECENT;
		}
		else if ("by_name" == sort_order_str)
		{
			sort_order = LLWearableItemsList::E_SORT_BY_NAME;
		}
		else if ("by_type" == sort_order_str)
		{
			sort_order = LLWearableItemsList::E_SORT_BY_TYPE_NAME;
		}
		else
		{
			llwarns << "Unrecognized sort order action" << llendl;
			return;
		}

		if (inventory_panel->getVisible())
		{
			inventory_panel->setSortOrder(sort_order);
		}
		else
		{
			flat_list->setSortOrder(sort_order);
		}
	}
Exemplo n.º 13
0
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
									   const LLAvatarName& av_name,
									   LLHandle<LLScrollListItem> item)
{
	std::string name;
	if (mShortNames)
		name = av_name.mDisplayName;
	else
		name = av_name.getCompleteName();

	LLScrollListItem* list_item = item.get();
	if (list_item && list_item->getUUID() == agent_id)
	{
		LLScrollListCell* cell = list_item->getColumn(mNameColumnIndex);
		if (cell)
		{
			cell->setValue(name);
			setNeedsSort();
		}
	}

	dirtyColumns();
}
Exemplo n.º 14
0
int sort_toasts_predicate(LLHandle<LLToast> first, LLHandle<LLToast> second)
{
	F32 v1 = first.get()->getTimeLeftToLive();
	F32 v2 = second.get()->getTimeLeftToLive();
	return v1 > v2;
}