Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/PrestametuVoz.activity/tarjeta.py
diff options
context:
space:
mode:
Diffstat (limited to 'PrestametuVoz.activity/tarjeta.py')
-rwxr-xr-xPrestametuVoz.activity/tarjeta.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/PrestametuVoz.activity/tarjeta.py b/PrestametuVoz.activity/tarjeta.py
new file mode 100755
index 0000000..929d91c
--- /dev/null
+++ b/PrestametuVoz.activity/tarjeta.py
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+''' Clase de la Tarjeta'''
+
+#Copyright (C) 2009 Federico Moreira - <federico@piensalibre.info>
+# Alejandro Esperón - <ratman26@gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>
+
+import gtk
+import os
+
+class Tarjeta(gtk.Button):
+ '''
+ Clase Tarjeta:
+ --------------
+
+ titulo --> Nombre de la tarjeta, aparece arriba de la imagen
+ imagen --> Imagen que se le agrega al botón al cargar el archivo
+ audio --> Audio que se reproduce al hacer click en la imagen
+ hijo --> En caso de que la accion sea la de cargar una nueva
+ plantilla aqui iria el nombre de la plantilla o la
+ posicion de la que se encuentra si tarian cargadas
+ en listas desde inicio.
+ '' = Uso normal, reproduccion de sonido
+ n = numero de plantilla (o nombre)
+ padre --> Desde donde viene, ya que seria necesario para retornar
+ a la plantilla anterior, dependeria si hijo tuviera algo
+
+ '''
+
+ def __init__(self, titulo='', imagen='', audio='', hijo='', padre=''):
+ super(Tarjeta, self).__init__()
+ self.titulo = titulo
+ self.audio = audio
+ self.imagen = imagen
+ self.hijo = hijo
+ self.padre = padre
+
+ def refresh_image(self):
+ imagen = gtk.Image()
+ imagen.set_from_file(os.path.join(os.getcwd(), self.imagen))
+ self.set_image(imagen)