void EvidyonGUIModule_ActionInventoryItemList::sync(void* context_pointer) {
  GUILayer* layer = hide();
  clearButtons();
  for (int i = 0; i < AVATAR_INVENTORY_SIZE; ++i) {
    const ClientAvatarInventoryItem* item = &inventory_[i];
    unsigned int type = item->type;
    if (item->inventory_index != i ||
        item->quantity == 0 ||
        type >= number_of_item_descriptions_) continue;
    const Item::ItemClientDescription* description = &item_descriptions_[type];
    std::string name;
    {
      char buffer[128];
      GUIHelper_GetItemNameString(
        item->quantity,
        description,
        buffer,
        sizeof(buffer));
      name.assign(buffer);
    }
    if (displayItem(item, description, &name, context_pointer)) {
      addButton(i, name.c_str());
    }
  }
  show(layer);
}
void ListViewEditor::itemColChanged( int col )
{
    QListViewItem *i = itemsPreview->currentItem();
    if ( !i )
	return;

    displayItem( i, col );
    itemDeletePixmap->setEnabled( i->pixmap( col ) && !i->pixmap( col )->isNull() );
}
void ListViewEditor::currentItemChanged( QListViewItem *i )
{
    if ( !i ) {
	itemText->setEnabled( FALSE );
	itemChoosePixmap->setEnabled( FALSE );
	itemDeletePixmap->setEnabled( FALSE );
	itemColumn->setEnabled( FALSE );
	return;
    }

    itemText->setEnabled( TRUE );
    itemChoosePixmap->setEnabled( TRUE );
    itemDeletePixmap->setEnabled( i->pixmap( itemColumn->value() ) &&
				  !i->pixmap( itemColumn->value() )->isNull() );
    itemColumn->setEnabled( TRUE );

    displayItem( i, itemColumn->value() );
}