From 3618ba9ab56baf8119e7c4eff373f2700a0dc53e Mon Sep 17 00:00:00 2001 From: Charlie Date: Mon, 07 Dec 2009 18:59:03 +0000 Subject: Can start activity from workshop if related activities are open --- (limited to 'Workshop.activity') diff --git a/Workshop.activity/Rating.py b/Workshop.activity/Rating.py index a13e5a2..684175b 100644 --- a/Workshop.activity/Rating.py +++ b/Workshop.activity/Rating.py @@ -1,3 +1,18 @@ +# Copyright (C) 2009, Tutorius.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import gtk from gtk import gdk import logging @@ -141,4 +156,4 @@ class Rating(gtk.Widget): if (self.rating > 5): self.rating = 5 # redraw the widget - self.queue_draw() \ No newline at end of file + self.queue_draw() diff --git a/Workshop.activity/TutorialStoreCategories.py b/Workshop.activity/TutorialStoreCategories.py index c321d66..aa3b4c6 100644 --- a/Workshop.activity/TutorialStoreCategories.py +++ b/Workshop.activity/TutorialStoreCategories.py @@ -1,3 +1,18 @@ +# Copyright (C) 2009, Tutorius.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys, os import gtk diff --git a/Workshop.activity/TutorialStoreDetails.py b/Workshop.activity/TutorialStoreDetails.py index 83c5366..3b8fc89 100644 --- a/Workshop.activity/TutorialStoreDetails.py +++ b/Workshop.activity/TutorialStoreDetails.py @@ -1,3 +1,18 @@ +# Copyright (C) 2009, Tutorius.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys, os import gtk from Workshop import WorkshopDetail @@ -5,7 +20,7 @@ from Workshop import WorkshopDetail class TutorialStoreDetails(WorkshopDetail): def __init__(self,tutorial,controller): - WorkshopDetail.__init__(self,tutorial,controller) + WorkshopDetail.__init__(self,tutorial,controller,True) download_button = gtk.Button('Download') infos_button = gtk.Button('Informations') diff --git a/Workshop.activity/TutorialStoreHome.py b/Workshop.activity/TutorialStoreHome.py index a9051e7..5fce564 100644 --- a/Workshop.activity/TutorialStoreHome.py +++ b/Workshop.activity/TutorialStoreHome.py @@ -1,3 +1,18 @@ +# Copyright (C) 2009, Tutorius.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import logging import TutorialStoreCategories import TutorialStoreSearch diff --git a/Workshop.activity/TutorialStoreResults.py b/Workshop.activity/TutorialStoreResults.py index 3a7f78d..a6bda76 100644 --- a/Workshop.activity/TutorialStoreResults.py +++ b/Workshop.activity/TutorialStoreResults.py @@ -1,3 +1,18 @@ +# Copyright (C) 2009, Tutorius.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys, os import gtk from Workshop import WorkshopListItem @@ -106,7 +121,7 @@ class TutorialStoreResults(gtk.VBox): class TutorialStoreListItem(WorkshopListItem): def __init__(self,tutorial,controller): - WorkshopListItem.__init__(self,tutorial,controller) + WorkshopListItem.__init__(self,tutorial,controller,True) self.last_row = gtk.HBox(False,15) self.btn_detail = gtk.Button('Details') @@ -117,4 +132,4 @@ class TutorialStoreListItem(WorkshopListItem): self.last_row.show_all() #connect the buttons - self.btn_detail.connect("clicked",self.controller.show_details,self.tutorial) \ No newline at end of file + self.btn_detail.connect("clicked",self.controller.show_details,self.tutorial) diff --git a/Workshop.activity/TutorialStoreSearch.py b/Workshop.activity/TutorialStoreSearch.py index 4303a07..9007599 100644 --- a/Workshop.activity/TutorialStoreSearch.py +++ b/Workshop.activity/TutorialStoreSearch.py @@ -1,3 +1,18 @@ +# Copyright (C) 2009, Tutorius.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys, os import gtk @@ -35,4 +50,4 @@ class TutorialStoreSearch(gtk.HBox): for category in categories: self.search_combobox.append_text(category) - \ No newline at end of file + diff --git a/Workshop.activity/TutorialStoreSuggestion.py b/Workshop.activity/TutorialStoreSuggestion.py index 45fc1c3..a1c7e45 100644 --- a/Workshop.activity/TutorialStoreSuggestion.py +++ b/Workshop.activity/TutorialStoreSuggestion.py @@ -1,3 +1,18 @@ +# Copyright (C) 2009, Tutorius.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys, os import gtk @@ -77,4 +92,4 @@ class SuggestionListItem(gtk.Frame): self.add(self.container) #tutorial5_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0)) - self.container.show_all() \ No newline at end of file + self.container.show_all() diff --git a/Workshop.activity/Workshop.py b/Workshop.activity/Workshop.py index 857bf8c..09ac402 100644 --- a/Workshop.activity/Workshop.py +++ b/Workshop.activity/Workshop.py @@ -257,7 +257,7 @@ class SearchBar(gtk.HBox): self.sort_combo.connect("changed",self.controller.sort_selection_changed,None) class WorkshopDetail(gtk.VBox): - def __init__(self,tutorial,controller): + def __init__(self,tutorial,controller,rating_editable=False): """ Constructor @@ -302,7 +302,7 @@ class WorkshopDetail(gtk.VBox): label_holder.pack_start(self.title_label) label_holder.pack_start(self.author_label) - self.rating = Rating(tutorial,controller,rating = tutorial.rating) + self.rating = Rating(tutorial,controller,tutorial.rating,rating_editable) second_row = gtk.HBox(False) second_row.pack_start(icon,False,False) @@ -359,7 +359,7 @@ class WorkshopListItem(gtk.Alignment): """ A list item containing the details of a tutorial """ - def __init__(self,tutorial,controller): + def __init__(self,tutorial,controller,rating_editable=False): """ Constructor @@ -388,7 +388,7 @@ class WorkshopListItem(gtk.Alignment): self.icon = gtk.Image() self.icon.set_from_file('icon.svg') - self.rating = Rating(tutorial,controller,tutorial.rating, True) + self.rating = Rating(tutorial,controller,tutorial.rating,rating_editable) #Add the controls to the table self.table.attach(self.icon,0,1,0,1,0,0) @@ -408,7 +408,7 @@ class WorkshopListItem(gtk.Alignment): class MyTutorialListItem(WorkshopListItem): def __init__(self,tutorial,controller): - WorkshopListItem.__init__(self,tutorial,controller) + WorkshopListItem.__init__(self,tutorial,controller,False) self.last_row = gtk.HBox(False,15) self.btn_launch = gtk.Button('Launch') @@ -427,7 +427,7 @@ class MyTutorialListItem(WorkshopListItem): class MyTutorialDetail(WorkshopDetail): def __init__(self,tutorial,controller): - WorkshopDetail.__init__(self,tutorial,controller) + WorkshopDetail.__init__(self,tutorial,controller,False) #The bottom of the screen contains the button(fourth and fifth row self.launch_button = gtk.Button('Launch') diff --git a/Workshop.activity/WorkshopController.py b/Workshop.activity/WorkshopController.py index 84b5999..8d7fca2 100644 --- a/Workshop.activity/WorkshopController.py +++ b/Workshop.activity/WorkshopController.py @@ -1,3 +1,18 @@ +# Copyright (C) 2009, Tutorius.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ WorkshopController diff --git a/Workshop.activity/WorkshopModel.py b/Workshop.activity/WorkshopModel.py index c52ab5b..9d2b804 100644 --- a/Workshop.activity/WorkshopModel.py +++ b/Workshop.activity/WorkshopModel.py @@ -171,7 +171,10 @@ class WorkshopModel(): @param tutorial The tutorial to launch """ - pass + from sugar.tutorius.service import ServiceProxy + service = ServiceProxy() + + service.launch(tutorial.id) @Login(store_proxy,login_view) def rate_tutorial(self,tutorial,rating): -- cgit v0.9.1