diff options
Diffstat (limited to 'activity/Workshop.activity/WorkshopController.py')
-rw-r--r-- | activity/Workshop.activity/WorkshopController.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/activity/Workshop.activity/WorkshopController.py b/activity/Workshop.activity/WorkshopController.py index 50c1fb4..ba192cf 100644 --- a/activity/Workshop.activity/WorkshopController.py +++ b/activity/Workshop.activity/WorkshopController.py @@ -4,7 +4,8 @@ WorkshopController This module handles user action from the workshop view """ - +import logging +from WorkshopModel import Tutorial class WorkshopController(): def __init__(self,view,model): self.view = view @@ -17,16 +18,18 @@ class WorkshopController(): @param widget the widget that sent the query @param keyword the keyword for the query, empty to get all tutorials """ - pass + self.model.query(keyword) - def sort_selection_changed(self,widget,sort): + def sort_selection_changed(self,widget,data): """ Handles selection changes in the sorting selection @param widget the widget that sent the query @param sort the property to use to sort tutorial """ - pass + sorting = widget.get_active_text() + self.view.change_sorting(sorting) + def launch_tutorial_triggered(self,widget,tutorial): """ @@ -44,7 +47,7 @@ class WorkshopController(): @param widget the widget that made the call @param tutorial the tutorial to """ - pass + self.view.display_detail(tutorial) def back_pressed(self,widget,data): """ @@ -53,7 +56,7 @@ class WorkshopController(): @param widget the widget that made the call @param data not used """ - pass + self.view.display_main_view() def rate_tutorial(self,widget,data): """ @@ -95,7 +98,7 @@ class WorkshopController(): @param widget the widget that made the call @param tutorial the tutorial to delete """ - pass + self.model.delete_tutorial(tutorial) def publish_tutorial(self,widget,tutorial): """ @@ -104,7 +107,7 @@ class WorkshopController(): @param widget the widget that made the call @param tutorial the tutorial to publish """ - pass + self.model.publish_tutorial(tutorial) def unpublish_tutorial(self,widget,tutorial): """ @@ -113,4 +116,4 @@ class WorkshopController(): @param widget the widget that made the call @param tutorial the tutorial to unpublish """ - pass + self.model.unpublish_tutorial(tutorial) |