示例#1
0
void LLLandmarksPanel::updateListCommands()
{
	bool add_folder_enabled = isActionEnabled("category");
	bool trash_enabled = isActionEnabled("delete") && (isFolderSelected() || isLandmarkSelected());

	// keep Options & Add Landmark buttons always enabled
	mListCommands->getChildView(ADD_FOLDER_BUTTON_NAME)->setEnabled(add_folder_enabled);
	mListCommands->getChildView(TRASH_BUTTON_NAME)->setEnabled(trash_enabled);
}
void LLPanelOutfitsInventory::updateListCommands()
{
    bool trash_enabled = isActionEnabled("delete");
    bool wear_enabled = isActionEnabled("wear");
    bool make_outfit_enabled = isActionEnabled("make_outfit");

    mListCommands->childSetEnabled("trash_btn", trash_enabled);
    mListCommands->childSetEnabled("wear_btn", wear_enabled);
    mListCommands->childSetVisible("wear_btn", wear_enabled);
    mListCommands->childSetEnabled("make_outfit_btn", make_outfit_enabled);
}
示例#3
0
// virtual
void LLLandmarksPanel::updateVerbs()
{
	if (!isTabVisible()) 
		return;

	bool landmark_selected = isLandmarkSelected();
	mTeleportBtn->setEnabled(landmark_selected && isActionEnabled("teleport"));
	mShowProfile->setEnabled(landmark_selected && isActionEnabled("more_info"));
	mShowOnMapBtn->setEnabled(landmark_selected && isActionEnabled("show_on_map"));

	// TODO: mantipov: Uncomment when mShareBtn is supported
	// Share button should be enabled when neither a folder nor a landmark is selected
	//mShareBtn->setEnabled(NULL != current_item);

	updateListCommands();
}
示例#4
0
void LLPanelOutfitsInventory::updateListCommands()
{
	bool trash_enabled = isActionEnabled("delete");
	bool wear_enabled =  isActionEnabled("wear");
	bool wear_visible = !isCOFPanelActive();
	bool make_outfit_enabled = isActionEnabled("save_outfit");

	mMyOutfitsPanel->childSetEnabled("trash_btn", trash_enabled);
	mListCommands->childSetEnabled("wear_btn", wear_enabled);
	mListCommands->childSetVisible("wear_btn", wear_visible);
	mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled);
	if (mMyOutfitsPanel->hasItemSelected())
	{
		mListCommands->childSetToolTip("wear_btn", getString("wear_items_tooltip"));
	}
	else
	{
		mListCommands->childSetToolTip("wear_btn", getString("wear_outfit_tooltip"));
	}
}
bool LLPanelMainInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept)
{
	*accept = ACCEPT_NO;

	const bool is_enabled = isActionEnabled("delete");
	if (is_enabled) *accept = ACCEPT_YES_MULTI;

	if (is_enabled && drop)
	{
		onClipboardAction("delete");
	}
	return true;
}
示例#6
0
bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data , EAcceptance* accept)
{
	*accept = ACCEPT_NO;

	switch (cargo_type)
	{

	case DAD_LANDMARK:
	case DAD_CATEGORY:
		{
			bool is_enabled = isActionEnabled("delete");

			if (is_enabled) *accept = ACCEPT_YES_MULTI;

			if (is_enabled && drop)
			{
				// don't call onClipboardAction("delete")
				// this lead to removing (N * 2 - 1) items if drag N>1 items into trash. EXT-6757
				// So, let remove items one by one.
				LLInventoryItem* item = static_cast<LLInventoryItem*>(cargo_data);
				if (item)
				{
					LLFolderViewItem* fv_item = mCurrentSelectedList
						? mCurrentSelectedList->getItemByID(item->getUUID())
						: NULL;

					if (fv_item)
					{
						// is Item Removable checked inside of remove()
						fv_item->remove();
					}
				}
			}
		}
		break;
	default:
		break;
	}

	updateVerbs();
	return true;
}
void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata)
{
    if (!isActionEnabled(userdata))
        return;

    const std::string command_name = userdata.asString();
    if (command_name == "new")
    {
        onSave();
    }
    if (command_name == "edit")
    {
        onEdit();
    }
    if (command_name == "wear")
    {
        onWearButtonClick();
    }
    // Note: This option has been removed from the gear menu.
    if (command_name == "add")
    {
        onAdd();
    }
    if (command_name == "remove")
    {
        onRemove();
    }
    if (command_name == "rename")
    {
        onClipboardAction("rename");
    }
    if (command_name == "remove_link")
    {
        onClipboardAction("delete");
    }
    if (command_name == "delete")
    {
        onClipboardAction("delete");
    }
    updateListCommands();
    updateVerbs();
}
void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
{
	if (!isActionEnabled(userdata))
		return;

	const std::string command_name = userdata.asString();
	if (command_name == "new_window")
	{
		newWindow();
	}
	if (command_name == "sort_by_name")
	{
		const LLSD arg = "name";
		setSortBy(arg);
	}
	if (command_name == "sort_by_recent")
	{
		const LLSD arg = "date";
		setSortBy(arg);
	}
	if (command_name == "show_filters")
	{
		toggleFindOptions();
	}
	if (command_name == "reset_filters")
	{
		resetFilters();
	}
	if (command_name == "close_folders")
	{
		closeAllFolders();
	}
	if (command_name == "empty_trash")
	{
		const std::string notification = "ConfirmEmptyTrash";
		gInventory.emptyFolderType(notification, LLFolderType::FT_TRASH);
	}
	if (command_name == "empty_lostnfound")
	{
		const std::string notification = "ConfirmEmptyLostAndFound";
		gInventory.emptyFolderType(notification, LLFolderType::FT_LOST_AND_FOUND);
	}
	if (command_name == "save_texture")
	{
		saveTexture(userdata);
	}
	// This doesn't currently work, since the viewer can't change an assetID an item.
	if (command_name == "regenerate_link")
	{
		LLInventoryPanel *active_panel = getActivePanel();
		LLFolderViewItem* current_item = active_panel->getRootFolder()->getCurSelectedItem();
		if (!current_item)
		{
			return;
		}
		const LLUUID item_id = current_item->getListener()->getUUID();
		LLViewerInventoryItem *item = gInventory.getItem(item_id);
		if (item)
		{
			item->regenerateLink();
		}
		active_panel->setSelection(item_id, TAKE_FOCUS_NO);
	}
	if (command_name == "find_original")
	{
		LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
		if (!current_item)
		{
			return;
		}
		current_item->getListener()->performAction(getActivePanel()->getModel(), "goto");
	}

	if (command_name == "find_links")
	{
		LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
		if (!current_item)
		{
			return;
		}
		const LLUUID& item_id = current_item->getListener()->getUUID();
		const std::string &item_name = current_item->getListener()->getName();
		mFilterSubString = item_name;
		LLInventoryFilter *filter = mActivePanel->getFilter();
		filter->setFilterSubString(item_name);
		mFilterEditor->setText(item_name);

		mFilterEditor->setFocus(TRUE);
		filter->setFilterUUID(item_id);
		filter->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
		filter->setFilterLinks(LLInventoryFilter::FILTERLINK_ONLY_LINKS);
	}
}
void LLPanelMainInventory::updateListCommands()
{
	bool trash_enabled = isActionEnabled("delete");

	mTrashButton->setEnabled(trash_enabled);
}
void LLPanelMainInventory::updateListCommands()
{
	bool trash_enabled = isActionEnabled("delete");

	mListCommands->childSetEnabled("trash_btn", trash_enabled);
}