Finish Singu TODO: Texture Save As from inventory menu.

This commit is contained in:
Inusaito Sayori
2013-08-24 19:35:30 -04:00
parent cde66a4169
commit e9d8ceaa38
5 changed files with 30 additions and 7 deletions

View File

@@ -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) void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{ {
lldebugs << "LLTextureBridge::buildContextMenu()" << llendl; lldebugs << "LLTextureBridge::buildContextMenu()" << llendl;
@@ -4274,13 +4290,12 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
getClipboardEntries(true, items, disabled_items, flags); getClipboardEntries(true, items, disabled_items, flags);
/* Singu TODO
items.push_back(std::string("Texture Separator")); items.push_back(std::string("Texture Separator"));
items.push_back(std::string("Save As")); items.push_back(std::string("Save As"));
if (!canSaveTexture()) if (!canSaveTexture())
{ {
disabled_items.push_back(std::string("Save As")); disabled_items.push_back(std::string("Save As"));
}*/ }
} }
hide_context_entries(menu, items, disabled_items); hide_context_entries(menu, items, disabled_items);
} }
@@ -4288,17 +4303,18 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
// virtual // virtual
void LLTextureBridge::performAction(LLInventoryModel* model, std::string action) void LLTextureBridge::performAction(LLInventoryModel* model, std::string action)
{ {
/* Singu TODO
if ("save_as" == action) if ("save_as" == action)
{ {
LLFloaterReg::showInstance("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES); const LLViewerInventoryItem* item(getItem());
LLPreviewTexture* preview_texture = LLFloaterReg::findTypedInstance<LLPreviewTexture>("preview_texture", mUUID); if (!item) return;
open_texture(mUUID, std::string("Texture: ") + item->getName(), FALSE);
LLPreview* preview_texture = LLPreview::find(mUUID);
if (preview_texture) if (preview_texture)
{ {
preview_texture->openToSave(); preview_texture->saveAs();
} }
} }
else*/ LLItemBridge::performAction(model, action); else LLItemBridge::performAction(model, action);
} }
// +=================================================+ // +=================================================+

View File

@@ -291,6 +291,10 @@
name="Deactivate" width="128"> name="Deactivate" width="128">
<on_click filter="" function="Inventory.DoToSelected" userdata="deactivate" /> <on_click filter="" function="Inventory.DoToSelected" userdata="deactivate" />
</menu_item_call> </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_separator name="Wearable And Object Separator" />
<menu_item_call bottom_delta="-18" height="18" label="Wear" left="0" mouse_opaque="true" <menu_item_call bottom_delta="-18" height="18" label="Wear" left="0" mouse_opaque="true"
name="Wearable And Object Wear" width="128"> name="Wearable And Object Wear" width="128">

View File

@@ -74,6 +74,7 @@
<menu_item_call name="Conference Chat" label="Iniciar Conferencia Grupal"/> <menu_item_call name="Conference Chat" label="Iniciar Conferencia Grupal"/>
<menu_item_call name="Activate" label="Activar"/> <menu_item_call name="Activate" label="Activar"/>
<menu_item_call name="Deactivate" label="Desactivar"/> <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 And Object Wear" label="Vestirse Ítem"/>
<menu_item_call name="Wearable Add" label="Añadir al Vestuario"/> <menu_item_call name="Wearable Add" label="Añadir al Vestuario"/>
<menu_item_call name="Wearable Move Forward" label="&#9650; Hacia Adelante"/> <menu_item_call name="Wearable Move Forward" label="&#9650; Hacia Adelante"/>

View File

@@ -69,6 +69,7 @@
<menu_item_call name="Conference Chat" label="Démarrer le chat conférence"/> <menu_item_call name="Conference Chat" label="Démarrer le chat conférence"/>
<menu_item_call name="Activate" label="Activer"/> <menu_item_call name="Activate" label="Activer"/>
<menu_item_call name="Deactivate" label="Désactiver"/> <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 And Object Wear" label="Porter"/>
<menu_item_call name="Wearable Add" label="Ajouter"/> <menu_item_call name="Wearable Add" label="Ajouter"/>
<menu_item_call name="Wearable Move Forward" label="&#9650; Haut"/> <menu_item_call name="Wearable Move Forward" label="&#9650; Haut"/>

View File

@@ -55,6 +55,7 @@
<menu_item_call label="Iniciar conversa em conferência" name="Conference Chat"/> <menu_item_call label="Iniciar conversa em conferência" name="Conference Chat"/>
<menu_item_call label="Ativar" name="Activate"/> <menu_item_call label="Ativar" name="Activate"/>
<menu_item_call label="Desativar" name="Deactivate"/> <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="Retirar de você" name="Detach From Yourself"/>
<menu_item_call label="Recuperar Última Posição" name="Restore to Last Position"/> <menu_item_call label="Recuperar Última Posição" name="Restore to Last Position"/>
<menu_item_call label="Vestir" name="Object Wear"/> <menu_item_call label="Vestir" name="Object Wear"/>