def get_rigt_task_for_task_screen(taskId,buildId): if buildId == 0 and taskId != 0: task = Task.getTask(taskId) print('editing new parent task') if buildId == 1: task = Task() print('') if buildId == 2 and taskId != 0: task = Task() task.task_id = taskId return task
def createParentTask(self,name,description,duration, deadline): self.task.name = name self.task.description = description self.task.duration = int(duration) self.task.deadline = deadline Task.updateTask(self.task) self.clear_widgets() print('app is running') popup = Popup(title='You have created a new task!',auto_dismiss=False) popup.size_hint = 0.25,0.25 content = Button(text='Close me!',size_hint_y = .10) popup.add_widget(content) # bind the on_press event of the button to the dismiss function content.bind(on_press=popup.dismiss) popup.open()
def giveDetailsObject(id): task = Task.getTask(id) layout = BoxLayout(orientation='vertical') layout.add_widget(Label(text='Name:')) layout.add_widget(Label(text=task.name)) description = task.description if description == None: layout.add_widget(Label(text='Description:')) layout.add_widget(Label(text='No Description Available')) else: layout.add_widget(Label(text='Description:')) layout.add_widget(Label(text=task.description)) duration = str(task.duration) + ' uur' layout.add_widget(Label(text='Duration:')) layout.add_widget(Label(text=duration,)) layout.add_widget(Label(text='Status:')) layout.add_widget(Label(text=task.status)) progress = str(task.progress * 100) + '%' layout.add_widget(Label(text='Progress:')) layout.add_widget(Label(text=progress)) return layout
def build(self): root = AddTaskScreen(task=Task.getTask(self.taskId)) return root