Exemplo n.º 1
0
	def tasks_set_completed_status(self, tasks_uuid, compl):
		if compl:
			if not mbox.message_box_question(self.wnd, _("Set tasks completed?"),
					None, _("Set complete"), _("Close")):
				return False
		else:
			if not mbox.message_box_question(self.wnd,
					_("Set tasks not completed?"), None, _("Set complete"),
					_("Close")):
				return False
		tasks_to_save = []
		for task_uuid in tasks_uuid:
			task = OBJ.Task.get(self._session, uuid=task_uuid)
			if not task:
				_LOG.warn("tasks_set_completed_status: task %r not found", task_uuid)
				continue
			if task.task_completed != compl:
				if compl:
					task_logic.complete_task(task, self._session)
				else:
					task.task_completed = False
				tasks_to_save.append(task)
		if tasks_to_save:
			return task_logic.save_modified_tasks(tasks_to_save, self._session)
		return False
Exemplo n.º 2
0
	def _on_save(self, evt):
		if not self._validate():
			return
		if not self._transfer_data_from_window():
			return
		if not self._data['prev_completed'] and self._task.completed:
			# zakonczono zadanie
			if (self._appconfig.get('gui', 'confirm_complete_dlg') and
					not self._controller.confirm_set_task_complete()):
				return
			if not task_logic.complete_task(self._task, self._session):
				return
		task_logic.save_modified_task(self._task, self._session)
		self._on_ok(evt)