Finish Singu TODO: Texture Save As from inventory menu.
This commit is contained in:
@@ -4254,6 +4254,22 @@ void LLTextureBridge::openItem()
|
||||
}
|
||||
}
|
||||
|
||||
bool LLTextureBridge::canSaveTexture()
|
||||
{
|
||||
const LLInventoryModel* model = getInventoryModel();
|
||||
if (!model)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const LLViewerInventoryItem* item = model->getItem(mUUID);
|
||||
if (item)
|
||||
{
|
||||
return item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
{
|
||||
lldebugs << "LLTextureBridge::buildContextMenu()" << llendl;
|
||||
@@ -4274,13 +4290,12 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
|
||||
getClipboardEntries(true, items, disabled_items, flags);
|
||||
|
||||
/* Singu TODO
|
||||
items.push_back(std::string("Texture Separator"));
|
||||
items.push_back(std::string("Save As"));
|
||||
if (!canSaveTexture())
|
||||
{
|
||||
disabled_items.push_back(std::string("Save As"));
|
||||
}*/
|
||||
}
|
||||
}
|
||||
hide_context_entries(menu, items, disabled_items);
|
||||
}
|
||||
@@ -4288,17 +4303,18 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
// virtual
|
||||
void LLTextureBridge::performAction(LLInventoryModel* model, std::string action)
|
||||
{
|
||||
/* Singu TODO
|
||||
if ("save_as" == action)
|
||||
{
|
||||
LLFloaterReg::showInstance("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES);
|
||||
LLPreviewTexture* preview_texture = LLFloaterReg::findTypedInstance<LLPreviewTexture>("preview_texture", mUUID);
|
||||
const LLViewerInventoryItem* item(getItem());
|
||||
if (!item) return;
|
||||
open_texture(mUUID, std::string("Texture: ") + item->getName(), FALSE);
|
||||
LLPreview* preview_texture = LLPreview::find(mUUID);
|
||||
if (preview_texture)
|
||||
{
|
||||
preview_texture->openToSave();
|
||||
preview_texture->saveAs();
|
||||
}
|
||||
}
|
||||
else*/ LLItemBridge::performAction(model, action);
|
||||
else LLItemBridge::performAction(model, action);
|
||||
}
|
||||
|
||||
// +=================================================+
|
||||
|
||||
@@ -291,6 +291,10 @@
|
||||
name="Deactivate" width="128">
|
||||
<on_click filter="" function="Inventory.DoToSelected" userdata="deactivate" />
|
||||
</menu_item_call>
|
||||
<menu_item_separator name="Texture Separator"/>
|
||||
<menu_item_call label="Save As" name="Save As">
|
||||
<on_click function="Inventory.DoToSelected" userdata="save_as"/>
|
||||
</menu_item_call>
|
||||
<menu_item_separator name="Wearable And Object Separator" />
|
||||
<menu_item_call bottom_delta="-18" height="18" label="Wear" left="0" mouse_opaque="true"
|
||||
name="Wearable And Object Wear" width="128">
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
<menu_item_call name="Conference Chat" label="Iniciar Conferencia Grupal"/>
|
||||
<menu_item_call name="Activate" label="Activar"/>
|
||||
<menu_item_call name="Deactivate" label="Desactivar"/>
|
||||
<menu_item_call label="Guardar como" name="Save As"/>
|
||||
<menu_item_call name="Wearable And Object Wear" label="Vestirse Ítem"/>
|
||||
<menu_item_call name="Wearable Add" label="Añadir al Vestuario"/>
|
||||
<menu_item_call name="Wearable Move Forward" label="▲ Hacia Adelante"/>
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<menu_item_call name="Conference Chat" label="Démarrer le chat conférence"/>
|
||||
<menu_item_call name="Activate" label="Activer"/>
|
||||
<menu_item_call name="Deactivate" label="Désactiver"/>
|
||||
<menu_item_call name="Save As" label="Enregistrer sous"/>
|
||||
<menu_item_call name="Wearable And Object Wear" label="Porter"/>
|
||||
<menu_item_call name="Wearable Add" label="Ajouter"/>
|
||||
<menu_item_call name="Wearable Move Forward" label="▲ Haut"/>
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
<menu_item_call label="Iniciar conversa em conferência" name="Conference Chat"/>
|
||||
<menu_item_call label="Ativar" name="Activate"/>
|
||||
<menu_item_call label="Desativar" name="Deactivate"/>
|
||||
<menu_item_call label="Salvar como" name="Save As"/>
|
||||
<menu_item_call label="Retirar de você" name="Detach From Yourself"/>
|
||||
<menu_item_call label="Recuperar Última Posição" name="Restore to Last Position"/>
|
||||
<menu_item_call label="Vestir" name="Object Wear"/>
|
||||
|
||||
Reference in New Issue
Block a user