diff options
author | yaderv <yajosev@gmail.com> | 2011-03-08 17:12:56 (GMT) |
---|---|---|
committer | yaderv <yajosev@gmail.com> | 2011-03-08 17:12:56 (GMT) |
commit | e1a19f1d79b08f8dd932b3bd593fc2e0e49ba2ba (patch) | |
tree | c9dbcbb6fcde6ebc92fb0238ff53290e8f615a1b | |
parent | 9f5252f2bf9b05b29fbaaf3d70863d726939c2fa (diff) |
completed button
-rw-r--r-- | archivo.py | 6 | ||||
-rw-r--r-- | calendario.py | 20 |
2 files changed, 20 insertions, 6 deletions
@@ -106,7 +106,7 @@ def guardar_efemeride(path, file_name): file_new.close() archivo.close() -def guardar_dato(indice, contenido, categoria, entero_cat, bolean, bolean_2, path, indice_lista=False): +def guardar_dato(indice, contenido, categoria, entero_cat, bolean, progre, path, indice_lista=False): '''save the content in a file, add the content to a dictionary->list''' color_categoria = ['#6E92FF', '#82FF5F', '#FFE251', '#FF7D7D', '#FFFFFF'] @@ -120,8 +120,10 @@ def guardar_dato(indice, contenido, categoria, entero_cat, bolean, bolean_2, pat else: prioridad = None - if bolean_2: + if progre is 1: progreso = gtk.STOCK_YES + elif progre is 2: + progreso = gtk.STOCK_APPLY else: progreso = None diff --git a/calendario.py b/calendario.py index 26c9055..fe9d216 100644 --- a/calendario.py +++ b/calendario.py @@ -162,13 +162,14 @@ class CalendarioActivity(activity.Activity): self.check = gtk.CheckButton(_('Important')) self.progre_status = 0 self.progre = gtk.CheckButton(_('In Progress')) - #self.compl_status = 0 - #self.compl = gtk.CheckButton(_('Completed')) + self.compl_status = 0 + self.compl = gtk.CheckButton(_('Completed')) + self.compl.set_sensitive(False) self.expandir_h = gtk.HBox() self.expandir_h.pack_start(self.combo, False) self.expandir_h.pack_start(self.check, False) self.expandir_h.pack_start(self.progre, False) - #self.expandir_h.pack_start(self.compl, False) + self.expandir_h.pack_start(self.compl, False) self.expandir.add(self.expandir_h) #file @@ -196,6 +197,7 @@ class CalendarioActivity(activity.Activity): self.boton4.connect('clicked', self._editar_cb) self.check.connect('toggled', self._check_cb) self.progre.connect('toggled', self._progre_cb) + self.compl.connect('toggled', self._compl_cb) ########################### Add Blocks ################################ self.contenedor_h.pack_start(self.contenedor_vi, False, padding = 5) @@ -237,7 +239,14 @@ class CalendarioActivity(activity.Activity): self.progre_status = 0 else: self.progre_status = 1 - + + def _compl_cb(self, widget, data=None): + if self.progre_status is 2: + self.progre_status = 0 + else: + self.progre_status = 2 + desactivar_boton() + def _dia_selec_cb(self, widget, data=None): '''when a date is selected''' self.lista_fecha = self.calendario.get_date() @@ -356,6 +365,7 @@ class CalendarioActivity(activity.Activity): def _editar_cb(self, widget, data=None): '''edit row''' + self.compl.set_sensitive(True) self.seleccion = self.actividades.get_selection() self.model, self.iter = self.seleccion.get_selected() self.enlace = self.modelo.get_path(self.iter) @@ -437,6 +447,8 @@ class CalendarioActivity(activity.Activity): self.check.set_active(False) if self.progre_status is 1: self.progre.set_active(False) + elif self.progre_status is 2: + self.compl.set_active(False) def close(self, skip_save=False): '''Override the close method so we don't try to |