def METHOD_NAME(self, tasks):
    """ Show and run dialog for selected tasks """
    if len(tasks) == 0:
        return
    self.tasks = tasks
    self.tag_entry.set_text(self.last_tag_entry)
    self.tag_entry.grab_focus()
    self.apply_to_subtasks.set_active(self.last_apply_to_subtasks)
    self.dialog.run()
    self.dialog.hide()
    self.tasks = []