def on_task_completed(self): taskid = self.listbox.focus.taskid completed = self.listbox.focus.values()[3] self.logw( " Received Signal, Will mark the task %s as complete: %s" % (self.listbox.focus.taskid, str(completed)) ) comp_val = "x" if not completed else utils.now() self.model.update_task(self.current_tasklist, taskid, completed=comp_val) update_text = "complete" if completed else "uncomplete" self.update_footer('Task "%s" marked as %s' % (self.listbox.focus.title, update_text))
def save(self): if not self.dirty: self.logw("save this shit!!") if self.tasks_visible: for twidget in self.tasks: self.logw("Test save count (tasks) " + str(twidget.values())) tt = twidget.values() task_title = tt[1] comp = "x" if not tt[3] else utils.now() # Only save tasks which are not empty if len(task_title) > 0: self.model.update_task( self.current_tasklist, tt[0], title=task_title, position=tt[2], completed=comp ) self.model.save() self.dirty = False else: self.logw("Dirty data exists: CANNOT *save* this shit!!")