Example #1
0
    def new_user_story(self):
        self.view.open_user_story_form()

        signals.connect(self.view.user_story_form.cancel_button, "click",
                        lambda _: self.cancel_user_story_form())
        signals.connect(self.view.user_story_form.save_button, "click",
                        lambda _: self.handler_create_user_story_request())
Example #2
0
    def new_issue(self):
        self.view.open_issue_form()

        signals.connect(self.view.issue_form.cancel_button, "click",
                        lambda _: self.cancel_issue_form())
        signals.connect(self.view.issue_form.save_button, "click",
                        lambda _: self.handle_create_issue_request())
Example #3
0
    def edit_issue(self):
        issue = self.view.issues.widget.get_focus()[0].issue
        self.view.open_issue_form(issue=issue)

        signals.connect(self.view.issue_form.cancel_button, "click",
                        lambda _: self.cancel_issue_form())
        signals.connect(self.view.issue_form.save_button, "click",
                        lambda _: self.handle_edit_issue_request(issue))
Example #4
0
    def filters(self):
        self.view.open_filters_popup()

        signals.connect(self.view.filters_popup.filter_button, "click",
                        lambda _: self.apply_filters_from_filters_popup())

        signals.connect(self.view.filters_popup.cancel_button, "click",
                        lambda _: self.cancel_filters_popup())
Example #5
0
    def change_to_milestone(self):
        self.view.open_milestones_selector_popup(current_milestone=self.view._milestone)

        signals.connect(self.view.milestone_selector_popup.cancel_button, "click",
                        lambda _: self.cancel_milestone_selector_popup())

        for option in self.view.milestone_selector_popup.options:
            signals.connect(option, "click", functools.partial(self.handle_change_to_milestone))
Example #6
0
    def edit_user_story(self):
        user_story = self.view.user_stories.widget.get_focus().user_story
        self.view.open_user_story_form(user_story=user_story)

        signals.connect(self.view.user_story_form.cancel_button, "click",
                        lambda _: self.cancel_user_story_form())
        signals.connect(
            self.view.user_story_form.save_button, "click",
            lambda _: self.handler_edit_user_story_request(user_story))
Example #7
0
    def new_user_story(self):
        user_story = {"milestone": self.view._milestone.get("id", None)}

        self.view.open_user_story_form(user_story=user_story)

        signals.connect(self.view.user_story_form.cancel_button, "click",
                lambda _: self.cancel_user_story_form())
        signals.connect(self.view.user_story_form.save_button, "click",
                lambda _: self.handle_create_user_story_request())
Example #8
0
    def handle_projects_response(self, future):
        projects = future.result()
        if projects is None:
            return  # FIXME

        self.view.populate(projects)
        for b, p in zip(self.view.project_buttons, self.view.projects):
            signals.connect(b, "click",
                            functools.partial(self.select_project, p))

        self.state_machine.transition(self.state_machine.PROJECTS)
Example #9
0
    def move_user_story_to_milestone(self):
        user_story = self.view.user_stories.widget.get_focus().user_story
        self.view.open_milestones_selector_popup(user_story=user_story)

        signals.connect(self.view.milestone_selector_popup.cancel_button,
                        "click",
                        lambda _: self.cancel_milestone_selector_popup())

        for option in self.view.milestone_selector_popup.options:
            signals.connect(
                option, "click",
                functools.partial(
                    self.handler_move_user_story_to_milestone_request,
                    user_story=user_story))
Example #10
0
    def new_task(self):
        selected_item = self.view.taskboard.widget.get_focus()[0]

        if isinstance(selected_item, UserStoryEntry):
            task = {"user_story": selected_item.user_story.get("id", None)}
        elif isinstance(selected_item, TaskEntry):
            task = {"user_story": selected_item.task.get("user_story", None)}
        else:
            task = {"user_story": None}

        self.view.open_task_form(task=task)

        signals.connect(self.view.task_form.cancel_button, "click",
                lambda _: self.cancel_task_form())
        signals.connect(self.view.task_form.save_button, "click",
                lambda _: self.handle_create_task_request())
Example #11
0
    def __init__(self, view, executor, state_machine):
        self.view = view
        self.executor = executor
        self.state_machine = state_machine

        signals.connect(self.view.issues_header.issue_button, "click",
                        functools.partial(self.handle_order_by, "issue"))

        signals.connect(self.view.issues_header.status_button, "click",
                        functools.partial(self.handle_order_by, "status"))

        signals.connect(self.view.issues_header.priority_button, "click",
                        functools.partial(self.handle_order_by, "priority"))

        signals.connect(self.view.issues_header.severity_buttton, "click",
                        functools.partial(self.handle_order_by, "severity"))

        signals.connect(self.view.issues_header.assigned_to_button, "click",
                        functools.partial(self.handle_order_by, "assigned_to"))

        self.view.issues.on_issue_status_change = self.handle_change_issue_status_request
        self.view.issues.on_issue_priority_change = self.handle_change_issue_priority_request
        self.view.issues.on_issue_severity_change = self.handle_change_issue_severity_request
        self.view.issues.on_issue_assigned_to_change = self.handle_change_issue_assigned_to_request
Example #12
0
    def edit_user_story_or_task(self):
        selected_item = self.view.taskboard.widget.get_focus()[0]

        if isinstance(selected_item, UserStoryEntry):
            self.view.open_user_story_form(user_story=selected_item.user_story)

            signals.connect(self.view.user_story_form.cancel_button, "click",
                    lambda _: self.cancel_user_story_form())
            signals.connect(self.view.user_story_form.save_button, "click",
                    lambda _: self.handle_edit_user_story_request(selected_item.user_story))
        elif isinstance(selected_item, TaskEntry):
            self.view.open_task_form(task=selected_item.task)

            signals.connect(self.view.task_form.cancel_button, "click",
                    lambda _: self.cancel_task_form())
            signals.connect(self.view.task_form.save_button, "click",
                    lambda _: self.handle_edit_task_request(selected_item.task))
Example #13
0
    def help_info(self):
        self.view.open_help_popup()

        signals.connect(self.view.help_popup.close_button, "click",
                        lambda _: self.close_help_info())
Example #14
0
    def __init__(self, view, executor, state_machine):
        self.view = view
        self.executor = executor
        self.state_machine = state_machine

        signals.connect(self.view.login_button, "click", lambda _: self.handle_login_request())