diff options
author | yaderv <yajosev@gmail.com> | 2011-03-04 18:15:09 (GMT) |
---|---|---|
committer | yaderv <yajosev@gmail.com> | 2011-03-04 18:15:09 (GMT) |
commit | 4f20818f573f778d057a688504e540de4dd89866 (patch) | |
tree | bbb42acdd7dcd692e3f9cfea8c0f806532b083e7 /calendario.py | |
parent | 0d7d5930f717b71798c7c7aaec2a7caa739612ae (diff) |
status okk
Diffstat (limited to 'calendario.py')
-rw-r--r-- | calendario.py | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/calendario.py b/calendario.py index e056e62..e7ead8f 100644 --- a/calendario.py +++ b/calendario.py @@ -159,9 +159,15 @@ class CalendarioActivity(activity.Activity): self.expandir = gtk.Expander(_('Expand for options')) self.check_status = 0 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.expandir_h = gtk.HBox() self.expandir_h.pack_start(self.combo, False) - self.expandir_h.pack_start(self.check) + 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.add(self.expandir_h) #file @@ -187,6 +193,7 @@ class CalendarioActivity(activity.Activity): self.boton2.connect('clicked', self._borrar_fila_cb) self.boton3.connect('clicked', self._importar_archivo_cb) self.check.connect('toggled', self._check_cb) + self.progre.connect('toggled', self._progre_cb) ########################### Add Blocks ################################ self.contenedor_h.pack_start(self.contenedor_vi, False, padding = 5) @@ -220,6 +227,14 @@ class CalendarioActivity(activity.Activity): else: self.check_status = 1 + def _progre_cb(self, widget, data=None): + '''return 1 if the chckbutton is now enable, else + return 0''' + if self.progre_status is 1: + self.progre_status = 0 + else: + self.progre_status = 1 + def _dia_selec_cb(self, widget, data=None): '''when a date is selected''' self.lista_fecha = self.calendario.get_date() @@ -333,14 +348,14 @@ class CalendarioActivity(activity.Activity): self.modelocombo = self.combo.get_model() self.index = self.combo.get_active() self.categoria = self.modelocombo[self.index][0] - guardar_dato(self.indice, self.cadena, self.categoria, self.index, self.check_status, self.path) + guardar_dato(self.indice, self.cadena, self.categoria, self.index, self.check_status, \ + self.progre_status, self.path) self.buffer.set_text(' ') self.modelo = crear_modelo(self.indice, self.path) self.actividades.set_model(self.modelo) self.marcar_calendario(self.marcar_dia) #mark the day in the calendar - if self.check_status is 1: #make inactive again the checkbutton - self.check.set_active(False) - + self.desactivar_boton() #make inactive again the checkbutton + def _importar_cb(self, widget, data=None): '''change to the import view''' self.set_canvas(self.archivo) @@ -362,26 +377,37 @@ class CalendarioActivity(activity.Activity): self.actividad = (_('Activity')) self.categoria = (_('Category')) self.prioridad = (_('Priority')) + self.estado = (_('Status')) - self.columna = gtk.TreeViewColumn('', self.celda, text = 0, cell_background = 4) + self.columna = gtk.TreeViewColumn('', self.celda, text = 0, cell_background = 5) self.actividades.append_column(self.columna) - self.columna = gtk.TreeViewColumn(self.actividad, self.celda, text = 1, cell_background = 4) + self.columna = gtk.TreeViewColumn(self.actividad, self.celda, text = 1, cell_background = 5) self.columna.set_min_width(365) self.actividades.append_column(self.columna) - self.columna = gtk.TreeViewColumn(self.categoria, self.celda, text = 2, cell_background = 4) + self.columna = gtk.TreeViewColumn(self.categoria, self.celda, text = 2, cell_background = 5) + self.actividades.append_column(self.columna) + self.columna = gtk.TreeViewColumn(self.prioridad, self.icono, stock_id = 3, cell_background = 5) self.actividades.append_column(self.columna) - self.columna = gtk.TreeViewColumn(self.prioridad, self.icono, stock_id = 3, cell_background = 4) + self.columna = gtk.TreeViewColumn(self.estado, self.icono, stock_id = 4, cell_background = 5) self.actividades.append_column(self.columna) + def marcar_calendario(self, fecha=None): '''mark the days that have activities stored''' - self._log.debug(fecha) guardar = 1 self.lista_dias_marcados = dict_meses(self.path, fecha, guardar) indice = fecha[:4] for dia in self.lista_dias_marcados[indice]: self.calendario.mark_day(dia) + def desactivar_boton(self): + '''inactive the checkbuttons''' + if self.check_status is 1: + self.check.set_active(False) + if self.progre_status is 1: + self.progre.set_active(False) + + def close(self, skip_save=False): '''Override the close method so we don't try to create a Journal entry''' |