Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormike <michael.jmontcalm@gmail.com>2009-10-21 04:46:28 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-10-21 04:46:28 (GMT)
commit3fe40f2eeeb791b0510001bcbc5ffca48a52af7e (patch)
tree77934d0e4df8192b5e14df34732e26cf26aa9131
parent912528253fcf1fc43c1a2d02ffe6e540fe60d8e7 (diff)
Audit : Adding Workshop activity straight into the tree. Do not merge this in the mainline please!
-rw-r--r--Workshop.activity/MANIFEST5
-rw-r--r--Workshop.activity/TutorialStoreCategories.py28
-rw-r--r--Workshop.activity/TutorialStoreDetails.py74
-rw-r--r--Workshop.activity/TutorialStoreHome.py109
-rw-r--r--Workshop.activity/TutorialStoreResults.py124
-rw-r--r--Workshop.activity/TutorialStoreSearch.py33
-rw-r--r--Workshop.activity/TutorialStoreSuggestion.py139
-rwxr-xr-xWorkshop.activity/TutoriusActivity.py77
-rw-r--r--Workshop.activity/Workshop.py285
-rw-r--r--Workshop.activity/WorkshopController.py119
-rw-r--r--Workshop.activity/WorkshopListItem.py78
-rw-r--r--Workshop.activity/WorkshopModel.py162
-rw-r--r--Workshop.activity/activity/activity.info8
-rw-r--r--Workshop.activity/activity/someicon.svg21
-rw-r--r--Workshop.activity/arrow_back.pngbin0 -> 310 bytes
-rw-r--r--Workshop.activity/dialogs.py139
-rw-r--r--Workshop.activity/full_star.pngbin0 -> 1031 bytes
-rw-r--r--Workshop.activity/grayed_star.pngbin0 -> 930 bytes
-rw-r--r--Workshop.activity/half_star.pngbin0 -> 890 bytes
-rw-r--r--Workshop.activity/icon.svg21
-rwxr-xr-xWorkshop.activity/setup.py3
21 files changed, 1425 insertions, 0 deletions
diff --git a/Workshop.activity/MANIFEST b/Workshop.activity/MANIFEST
new file mode 100644
index 0000000..c5c6d42
--- /dev/null
+++ b/Workshop.activity/MANIFEST
@@ -0,0 +1,5 @@
+TutoriusActivity.py
+activity/someicon.svg
+activity/activity.info
+setup.py
+MANIFEST
diff --git a/Workshop.activity/TutorialStoreCategories.py b/Workshop.activity/TutorialStoreCategories.py
new file mode 100644
index 0000000..2bf843d
--- /dev/null
+++ b/Workshop.activity/TutorialStoreCategories.py
@@ -0,0 +1,28 @@
+import sys, os
+import gtk
+
+class TutorialStoreCategories:
+
+ def __init__(self):
+ categorie_math = gtk.Label('Math (8)')
+ categorie_physics = gtk.Label('Phyisics (16)')
+ categorie_history = gtk.Label('History (32)')
+ categorie_learning = gtk.Label('Learning (53)')
+
+ categorie_box = gtk.VBox(True, 5)
+ self.categorie_box_frame = gtk.Frame('Categories')
+ self.categorie_box_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0))
+
+ categorie_box.pack_start(categorie_math, True, True, 4)
+ categorie_box.pack_start(categorie_physics, True, True, 4)
+ categorie_box.pack_start(categorie_history, True, True, 4)
+ categorie_box.pack_start(categorie_learning, True, True, 4)
+
+ self.categorie_box_frame.add(categorie_box)
+
+ categorie_math.show()
+ categorie_physics.show()
+ categorie_history.show()
+ categorie_learning.show()
+ categorie_box.show()
+ self.categorie_box_frame.show() \ No newline at end of file
diff --git a/Workshop.activity/TutorialStoreDetails.py b/Workshop.activity/TutorialStoreDetails.py
new file mode 100644
index 0000000..67b85d0
--- /dev/null
+++ b/Workshop.activity/TutorialStoreDetails.py
@@ -0,0 +1,74 @@
+import sys, os
+import gtk
+
+class TutorialStoreDetails:
+
+ def __init__(self):
+ tuto_icon = gtk.Image()
+ tuto_icon.set_from_file('icon.svg')
+
+ full_star_icon1 = gtk.Image()
+ full_star_icon1.set_from_file('full_star.svg')
+ full_star_icon2 = gtk.Image()
+ full_star_icon2.set_from_file('full_star.svg')
+ full_star_icon3 = gtk.Image()
+ full_star_icon3.set_from_file('full_star.svg')
+
+ grayed_star_icon = gtk.Image()
+ grayed_star_icon.set_from_file('grayed_star.svg')
+
+ half_star_icon= gtk.Image()
+ half_star_icon.set_from_file('half_star.svg')
+
+ title_autor_box = gtk.VBox()
+ tuto_title_label = gtk.Label('<Title>')
+ tuto_author_label = gtk.Label('by <Author>')
+ title_autor_box.pack_start(tuto_title_label)
+ title_autor_box.pack_start(tuto_author_label)
+
+ tuto_descrip_label = gtk.Label('Description 1 : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.')
+ tuto_descrip_label.set_line_wrap(True)
+ tuto_descrip_label.set_width_chars(50)
+
+ download_button = gtk.Button('Download')
+ infos_button = gtk.Button('Informations')
+ comp_button = gtk.Button('Compatibility')
+
+ tutorial_title_bar = gtk.HBox (False, 4)
+ tutorial_title_bar.pack_start(tuto_icon)
+ tutorial_title_bar.pack_start(title_autor_box)
+ tutorial_title_bar.pack_start(full_star_icon1)
+ tutorial_title_bar.pack_start(full_star_icon2)
+ tutorial_title_bar.pack_start(full_star_icon3)
+ tutorial_title_bar.pack_start(half_star_icon)
+ tutorial_title_bar.pack_start(grayed_star_icon)
+ tutorial_button_bar = gtk.HBox(True, 25)
+ tutorial_button_bar.pack_start(download_button)
+ tutorial_button_bar.pack_start(infos_button)
+ tutorial_button_bar.pack_start(comp_button)
+
+ self.tutorial_store_details = gtk.VBox (False, 5)
+ back_button = gtk.Button('Back')
+
+ self.tutorial_store_details.pack_start(back_button)
+ self.tutorial_store_details.pack_start(tutorial_title_bar)
+ self.tutorial_store_details.pack_start(tuto_descrip_label)
+ self.tutorial_store_details.pack_start(tutorial_button_bar)
+
+
+ tuto_icon.show()
+ full_star_icon1.show()
+ full_star_icon2.show()
+ full_star_icon3.show()
+ grayed_star_icon.show()
+ half_star_icon.show()
+ tuto_title_label.show()
+ tuto_author_label.show()
+ title_autor_box.show()
+ tuto_descrip_label.show()
+ tutorial_title_bar.show()
+ tutorial_button_bar.show()
+ download_button.show()
+ infos_button.show()
+ comp_button.show()
+ self.tutorial_store_details.show()
diff --git a/Workshop.activity/TutorialStoreHome.py b/Workshop.activity/TutorialStoreHome.py
new file mode 100644
index 0000000..8a361dc
--- /dev/null
+++ b/Workshop.activity/TutorialStoreHome.py
@@ -0,0 +1,109 @@
+import logging
+import TutorialStoreCategories
+import TutorialStoreSearch
+import TutorialStoreSuggestion
+import TutorialStoreResults
+import TutorialStoreDetails
+
+import sys, os
+import gtk
+
+class TutorialStoreHome:
+ def log(self,widget,data=None):
+ logging.info('Tutorial Store Home start')
+
+ def __init__(self):
+
+ self.categories = TutorialStoreCategories.TutorialStoreCategories()
+ categories_frame = self.categories.categorie_box_frame
+
+ self.search = TutorialStoreSearch.TutorialStoreSearch()
+ tutorial_store_search = self.search.tutorial_store_search
+
+ self.search_button = self.search.search_button_access()
+
+ self.suggestion = TutorialStoreSuggestion.TutorialStoreSuggestion()
+
+ tut_store_suggestion = gtk.HBox(homogeneous=True, spacing=5)
+ tut_store_suggestion.pack_start(self.suggestion.top_five_frame, expand=False, fill=False, padding=0)
+ tut_store_suggestion.pack_start(self.suggestion.also_like_frame, expand=False, fill=False, padding=0)
+
+ self.results = TutorialStoreResults.TutorialStoreResults()
+
+ tut_store_home_base = gtk.VBox(False, 5)
+ tut_store_home_base.pack_start(tutorial_store_search, False, False, 25)
+ tut_store_home_base.pack_start(tut_store_suggestion, False, False, 0)
+
+ self.labeltest = gtk.Label('Test')
+
+ self.tutorial_store_home = gtk.HBox(False, 5)
+ self.tutorial_store_home.pack_start(categories_frame, True, True, 5)
+ self.tutorial_store_home.pack_start(tut_store_home_base, True, True, 5)
+ self.tutorial_store_home.pack_start(tut_store_home_base, True, True, 5)
+
+ tut_store_suggestion.show()
+ categories_frame.show()
+ tut_store_home_base.show()
+ self.tutorial_store_home.show()
+
+ def get_search_button(self):
+
+ return self.search_button
+
+ def get_more_button(self):
+ return self.suggestion.get_more_button()
+
+ def get_results_widget(self):
+
+ self.search = TutorialStoreSearch.TutorialStoreSearch()
+ tutorial_store_search = self.search.tutorial_store_search
+
+ self.results = TutorialStoreResults.TutorialStoreResults()
+ tutorial_store_results = self.results.tutorial_store_results
+
+ self.categories = TutorialStoreCategories.TutorialStoreCategories()
+ categories_frame = self.categories.categorie_box_frame
+
+ tut_store_home_base = gtk.VBox(False, 5)
+ tut_store_home_base.pack_start(tutorial_store_search, False, False, 25)
+ tut_store_home_base.pack_start(tutorial_store_results, False, False, 0)
+
+ self.tutorial_store_home = gtk.HBox(False, 5)
+ self.tutorial_store_home.pack_start(categories_frame, True, True, 5)
+ self.tutorial_store_home.pack_start(tut_store_home_base, True, True, 5)
+
+ tut_store_home_base.show()
+ tutorial_store_search.show()
+ tutorial_store_results.show()
+ categories_frame.show()
+ self.tutorial_store_home.show()
+
+ return self.tutorial_store_home
+
+ def get_details_widget(self):
+
+ self.search = TutorialStoreSearch.TutorialStoreSearch()
+ tutorial_store_search = self.search.tutorial_store_search
+
+ self.details = TutorialStoreDetails.TutorialStoreDetails()
+ tutorial_store_details = self.details.tutorial_store_details
+
+ self.categories = TutorialStoreCategories.TutorialStoreCategories()
+ categories_frame = self.categories.categorie_box_frame
+
+ tut_store_home_base = gtk.VBox(False, 5)
+ tut_store_home_base.pack_start(tutorial_store_search, False, False, 25)
+ tut_store_home_base.pack_start(tutorial_store_details, False, False, 0)
+
+ self.tutorial_store_home = gtk.HBox(False, 5)
+ self.tutorial_store_home.pack_start(categories_frame, True, True, 5)
+ self.tutorial_store_home.pack_start(tut_store_home_base, True, True, 5)
+
+ tut_store_home_base.show()
+ tutorial_store_search.show()
+ tutorial_store_details.show()
+ categories_frame.show()
+ self.tutorial_store_home.show()
+
+ return self.tutorial_store_home
+
diff --git a/Workshop.activity/TutorialStoreResults.py b/Workshop.activity/TutorialStoreResults.py
new file mode 100644
index 0000000..0e8e54c
--- /dev/null
+++ b/Workshop.activity/TutorialStoreResults.py
@@ -0,0 +1,124 @@
+import sys, os
+import gtk
+
+class TutorialStoreResults:
+
+ def __init__(self):
+ tuto_icon1 = gtk.Image()
+ tuto_icon1.set_from_file('icon.svg')
+ tuto_icon2 = gtk.Image()
+ tuto_icon2.set_from_file('icon.svg')
+
+ full_star_icon1 = gtk.Image()
+ full_star_icon1.set_from_file('full_star.svg')
+ full_star_icon2 = gtk.Image()
+ full_star_icon2.set_from_file('full_star.svg')
+ full_star_icon3 = gtk.Image()
+ full_star_icon3.set_from_file('full_star.svg')
+ full_star_icon4 = gtk.Image()
+ full_star_icon4.set_from_file('full_star.svg')
+ full_star_icon5 = gtk.Image()
+ full_star_icon5.set_from_file('full_star.svg')
+
+ grayed_star_icon1 = gtk.Image()
+ grayed_star_icon1.set_from_file('grayed_star.svg')
+ grayed_star_icon2 = gtk.Image()
+ grayed_star_icon2.set_from_file('grayed_star.svg')
+ grayed_star_icon3 = gtk.Image()
+ grayed_star_icon3.set_from_file('grayed_star.svg')
+ grayed_star_icon4 = gtk.Image()
+ grayed_star_icon4.set_from_file('grayed_star.svg')
+
+ half_star_icon1= gtk.Image()
+ half_star_icon1.set_from_file('half_star.svg')
+
+ tuto_title_label1 = gtk.Label('Titre 1')
+ tuto_title_label2 = gtk.Label('Titre 2')
+
+ tuto_descrip_label1 = gtk.Label('Description 1 : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')
+ tuto_descrip_label1.set_line_wrap(True)
+ tuto_descrip_label1.set_width_chars(50)
+ tuto_descrip_label2 = gtk.Label('Description 2 : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')
+ tuto_descrip_label2.set_line_wrap(True)
+ tuto_descrip_label2.set_width_chars(50)
+
+ download_button1 = gtk.Button('Download')
+ download_button2 = gtk.Button('Download')
+ details_button1 = gtk.Button('Details')
+ details_button2 = gtk.Button('Details')
+
+ show_resuls_label = gtk.Label('Showing results 1-29 of 109')
+ # TODO : Probably must be something else than a label, or find a way to listen to click event on label ...
+ next_results_label = gtk.Label('< 1 2 3 4 >')
+
+ tutorial_title_bar1 = gtk.HBox (False, 0)
+ tutorial_title_bar1.pack_start(tuto_icon1)
+ tutorial_title_bar1.pack_start(tuto_title_label1)
+ tutorial_title_bar1.pack_start(full_star_icon1)
+ tutorial_title_bar1.pack_start(full_star_icon2)
+ tutorial_title_bar1.pack_start(full_star_icon3)
+ tutorial_title_bar1.pack_start(grayed_star_icon1)
+ tutorial_title_bar1.pack_start(grayed_star_icon2)
+
+ tutorial_button_bar1 = gtk.HBox(True, 25)
+ tutorial_button_bar1.pack_start(download_button1)
+ tutorial_button_bar1.pack_start(details_button1)
+
+ tutorial1 = gtk.VBox (False, 5)
+ tutorial1.pack_start(tutorial_title_bar1)
+ tutorial1.pack_start(tuto_descrip_label1)
+ tutorial1.pack_start(tutorial_button_bar1)
+
+ tutorial_title_bar2 = gtk.HBox (False, 5)
+ tutorial_title_bar2.pack_start(tuto_icon2)
+ tutorial_title_bar2.pack_start(tuto_title_label2)
+ tutorial_title_bar2.pack_start(full_star_icon4)
+ tutorial_title_bar2.pack_start(full_star_icon5)
+ tutorial_title_bar2.pack_start(half_star_icon1)
+ tutorial_title_bar2.pack_start(grayed_star_icon3)
+ tutorial_title_bar2.pack_start(grayed_star_icon4)
+
+ tutorial_button_bar2 = gtk.HBox(True, 55)
+ tutorial_button_bar2.pack_start(download_button2)
+ tutorial_button_bar2.pack_start(details_button2)
+
+ tutorial2 = gtk.VBox (False, 5)
+ tutorial2.pack_start(tutorial_title_bar2)
+ tutorial2.pack_start(tuto_descrip_label2)
+ tutorial2.pack_start(tutorial_button_bar2)
+
+ self.tutorial_store_results = gtk.VBox(False, 10)
+ self.tutorial_store_results.pack_start(tutorial1, True, True, 10)
+ self.tutorial_store_results.pack_start(tutorial2, True, True, 10)
+ self.tutorial_store_results.pack_start(show_resuls_label)
+ self.tutorial_store_results.pack_start(next_results_label)
+
+ tuto_icon1.show()
+ tuto_icon2.show()
+ full_star_icon1.show()
+ full_star_icon2.show()
+ full_star_icon3.show()
+ full_star_icon4.show()
+ full_star_icon5.show()
+ grayed_star_icon1.show()
+ grayed_star_icon2.show()
+ grayed_star_icon3.show()
+ grayed_star_icon4.show()
+ half_star_icon1.show()
+ tuto_title_label1.show()
+ tuto_title_label2.show()
+ tuto_descrip_label1.show()
+ tuto_descrip_label2.show()
+ download_button1.show()
+ download_button2.show()
+ details_button1.show()
+ details_button2.show()
+ show_resuls_label.show()
+ next_results_label.show()
+ tutorial_title_bar1.show()
+ tutorial_title_bar2.show()
+ tutorial_button_bar1.show()
+ tutorial_button_bar2.show()
+ tutorial1.show()
+ tutorial2.show()
+ self.tutorial_store_results.show() \ No newline at end of file
diff --git a/Workshop.activity/TutorialStoreSearch.py b/Workshop.activity/TutorialStoreSearch.py
new file mode 100644
index 0000000..1663f80
--- /dev/null
+++ b/Workshop.activity/TutorialStoreSearch.py
@@ -0,0 +1,33 @@
+import sys, os
+import gtk
+
+class TutorialStoreSearch:
+
+ def __init__(self):
+ search_label = gtk.Label('Search :')
+ search_box = gtk.Entry(400)
+ in_label = gtk.Label('in')
+ search_combobox = gtk.combo_box_new_text()
+ search_combobox.insert_text(0, 'all Categories (109)')
+ search_combobox.insert_text(1, 'Math (8)')
+ search_combobox.insert_text(2, 'Physics (16)')
+ search_combobox.insert_text(3, 'History (32)')
+ search_combobox.insert_text(4, 'Learning (53)')
+ self.search_button = gtk.Button('Search')
+
+ self.tutorial_store_search = gtk.HBox(False, 5)
+ self.tutorial_store_search.pack_start(search_label, True, True, 5)
+ self.tutorial_store_search.pack_start(search_box, True, True, 5)
+ self.tutorial_store_search.pack_start(in_label, True, True, 5)
+ self.tutorial_store_search.pack_start(search_combobox, True, True, 5)
+ self.tutorial_store_search.pack_start(self.search_button, True, True, 5)
+
+ search_label.show()
+ search_box.show()
+ in_label.show()
+ search_combobox.show()
+ self.search_button.show()
+ self.tutorial_store_search.show()
+
+ def search_button_access(self):
+ return self.search_button \ No newline at end of file
diff --git a/Workshop.activity/TutorialStoreSuggestion.py b/Workshop.activity/TutorialStoreSuggestion.py
new file mode 100644
index 0000000..9164ca0
--- /dev/null
+++ b/Workshop.activity/TutorialStoreSuggestion.py
@@ -0,0 +1,139 @@
+import sys, os
+import gtk
+
+class TutorialStoreSuggestion:
+
+ def __init__(self):
+
+ tutorial1 = gtk.HBox(homogeneous=True, spacing=0)
+ tutorial2 = gtk.HBox(homogeneous=True, spacing=0)
+ tutorial3 = gtk.HBox(homogeneous=True, spacing=0)
+ tutorial4 = gtk.HBox(homogeneous=True, spacing=0)
+ tutorial5 = gtk.HBox(homogeneous=True, spacing=0)
+ tutorial6 = gtk.HBox(homogeneous=True, spacing=0)
+
+ icon1 = gtk.Image()
+ icon1.set_from_file('icon.svg')
+ icon2 = gtk.Image()
+ icon2.set_from_file('icon.svg')
+ icon3 = gtk.Image()
+ icon3.set_from_file('icon.svg')
+ icon4 = gtk.Image()
+ icon4.set_from_file('icon.svg')
+ icon5 = gtk.Image()
+ icon5.set_from_file('icon.svg')
+ icon6 = gtk.Image()
+ icon6.set_from_file('icon.svg')
+
+ label1 = gtk.Label('Tuto 1')
+ label2 = gtk.Label('Tuto 2')
+ label3 = gtk.Label('Tuto 3')
+
+ label4 = gtk.Label('Tuto 4')
+ label5 = gtk.Label('Tuto 5')
+ label6 = gtk.Label('Tuto 6')
+
+ self.more_button1 = gtk.Button('More')
+ more_button2 = gtk.Button('More')
+ more_button3 = gtk.Button('More')
+ more_button4 = gtk.Button('More')
+ more_button5 = gtk.Button('More')
+ more_button6 = gtk.Button('More')
+
+ tutorial1.pack_start(icon1, expand=True, fill=True, padding=4)
+ tutorial1.pack_start(label1, expand=True, fill=True, padding=0)
+ tutorial1.pack_start(self.more_button1, expand=False, fill=False, padding=5)
+ tutorial1_frame = gtk.Frame()
+ tutorial1_frame.add(tutorial1)
+ tutorial1_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0))
+
+ tutorial2.pack_start(icon2, expand=True, fill=True, padding=4)
+ tutorial2.pack_start(label2, expand=True, fill=True, padding=0)
+ tutorial2.pack_start(more_button2, expand=False, fill=False, padding=5)
+ tutorial2_frame = gtk.Frame()
+ tutorial2_frame.add(tutorial2)
+ tutorial2_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0))
+
+ tutorial3.pack_start(icon3, expand=True, fill=True, padding=4)
+ tutorial3.pack_start(label3, expand=True, fill=True, padding=0)
+ tutorial3.pack_start(more_button3, expand=False, fill=False, padding=5)
+ tutorial3_frame = gtk.Frame()
+ tutorial3_frame.add(tutorial3)
+ tutorial3_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0))
+
+ tutorial4.pack_start(icon4, expand=True, fill=True, padding=4)
+ tutorial4.pack_start(label4, expand=True, fill=True, padding=0)
+ tutorial4.pack_start(more_button4, expand=False, fill=False, padding=5)
+ tutorial4_frame = gtk.Frame()
+ tutorial4_frame.add(tutorial4)
+ tutorial4_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0))
+
+ tutorial5.pack_start(icon5, expand=True, fill=True, padding=4)
+ tutorial5.pack_start(label5, expand=True, fill=True, padding=0)
+ tutorial5.pack_start(more_button5, expand=False, fill=False, padding=5)
+ tutorial5_frame = gtk.Frame()
+ tutorial5_frame.add(tutorial5)
+ tutorial5_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0))
+
+ tutorial6.pack_start(icon6, expand=True, fill=True, padding=4)
+ tutorial6.pack_start(label6, expand=True, fill=True, padding=0)
+ tutorial6.pack_start(more_button6, expand=False, fill=False, padding=5)
+ tutorial6_frame = gtk.Frame()
+ tutorial6_frame.add(tutorial6)
+ tutorial6_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0))
+
+ top_five = gtk.VBox(homogeneous=True, spacing=0)
+ self.top_five_frame = gtk.Frame('Top 5 Most Popular')
+## top_five_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0))
+
+ top_five.pack_start(tutorial1_frame, expand=True, fill=True, padding=0)
+ top_five.pack_start(tutorial2_frame, expand=True, fill=True, padding=0)
+ top_five.pack_start(tutorial3_frame, expand=True, fill=True, padding=0)
+
+ also_like = gtk.VBox(homogeneous=True, spacing=0)
+ self.also_like_frame = gtk.Frame('You might also like :')
+
+ also_like.pack_start(tutorial4_frame, expand=True, fill=True, padding=0)
+ also_like.pack_start(tutorial5_frame, expand=True, fill=True, padding=0)
+ also_like.pack_start(tutorial6_frame, expand=True, fill=True, padding=0)
+
+ self.top_five_frame.add(top_five)
+ self.also_like_frame.add(also_like)
+
+ label1.show()
+ label2.show()
+ label3.show()
+ label4.show()
+ label5.show()
+ label6.show()
+ icon1.show()
+ icon2.show()
+ icon3.show()
+ icon4.show()
+ icon5.show()
+ icon6.show()
+ self.more_button1.show()
+ more_button2.show()
+ more_button3.show()
+ more_button4.show()
+ more_button5.show()
+ more_button6.show()
+ tutorial1_frame.show()
+ tutorial2_frame.show()
+ tutorial3_frame.show()
+ tutorial4_frame.show()
+ tutorial5_frame.show()
+ tutorial6_frame.show()
+ tutorial1.show()
+ tutorial2.show()
+ tutorial3.show()
+ tutorial4.show()
+ tutorial5.show()
+ tutorial6.show()
+ top_five.show()
+ self.top_five_frame.show()
+ also_like.show()
+ self.also_like_frame.show()
+
+ def get_more_button(self):
+ return self.more_button1 \ No newline at end of file
diff --git a/Workshop.activity/TutoriusActivity.py b/Workshop.activity/TutoriusActivity.py
new file mode 100755
index 0000000..b262a9f
--- /dev/null
+++ b/Workshop.activity/TutoriusActivity.py
@@ -0,0 +1,77 @@
+from sugar.activity import activity
+import TutorialStoreHome
+from Workshop import WorkshopView
+import logging
+
+import sys, os
+import gtk
+from dialogs import LoginDialog
+
+class TutoriusActivity(activity.Activity):
+ def hello(self,widget,data=None):
+ logging.info('Hello world')
+
+ def callback(self, widget, button_string):
+
+ if button_string == 'search_button':
+ self.right_container.remove(self.tutorial_store_home.tutorial_store_home)
+
+ results_widget = self.tutorial_store_home.get_results_widget()
+
+ self.right_container.pack_start(results_widget)
+
+ results_widget.show()
+ self.right_container.show()
+
+ elif button_string == 'more_button':
+ self.right_container.remove(self.tutorial_store_home.tutorial_store_home)
+
+ details_widget = self.tutorial_store_home.get_details_widget()
+
+ self.right_container.pack_start(details_widget)
+
+ details_widget.show()
+ self.right_container.show()
+
+ def __init__(self,handle):
+ print "running activity init", handle
+ activity.Activity.__init__(self,handle)
+ print "actiity running"
+
+ toolbox = activity.ActivityToolbox(self)
+ self.set_toolbox(toolbox)
+ toolbox.show()
+
+ self.table = gtk.HPaned()
+ self.table.set_position(100)
+ self.left_container = gtk.VBox()
+ btn1 = gtk.Button("My tutorials")
+ btn2 = gtk.Button("Tutorial Store")
+ btn3 = gtk.Button("test button")
+
+ self.left_container.pack_start(btn1,expand=False)
+ self.left_container.pack_start(btn2,expand=False)
+ self.tutorial_store_home = TutorialStoreHome.TutorialStoreHome()
+
+ tutorial_store_search_button = self.tutorial_store_home.get_search_button()
+ tutorial_store_search_button.connect("clicked", self.callback, 'search_button')
+
+ tutorial_store_more_button = self.tutorial_store_home.get_more_button()
+ tutorial_store_more_button.connect("clicked", self.callback, 'more_button')
+
+ self.right_container = gtk.VBox()
+ #self.right_container.pack_start(self.tutorial_store_home.tutorial_store_home)
+
+ self.workshop = WorkshopView()
+
+ self.table.add1(self.left_container)
+ self.table.add2(self.workshop)
+ self.set_canvas(self.table)
+ btn3.show()
+ btn1.show()
+ btn2.show()
+ self.left_container.show()
+ self.workshop.show()
+ self.table.show()
+
+ print "AT THE END OF THE CLASS"
diff --git a/Workshop.activity/Workshop.py b/Workshop.activity/Workshop.py
new file mode 100644
index 0000000..1ca6be2
--- /dev/null
+++ b/Workshop.activity/Workshop.py
@@ -0,0 +1,285 @@
+import gtk
+
+from WorkshopListItem import WorkshopListItem,Rating
+from WorkshopModel import WorkshopModel
+from WorkshopController import WorkshopController
+
+class WorkshopView(gtk.Alignment):
+ def __init__(self):
+ gtk.Alignment.__init__(self,0.0,0.0,1.0,1.0)
+ self.model = WorkshopModel(self)
+ self.controller = WorkshopController(self,self.model)
+
+ self.mainView = WorkshopMain(self.controller)
+ self.detailView = WorkshopDetail(None,self.controller)
+
+ self.add(self.mainView)
+
+ self.mainView.show()
+ self.detailView.show()
+
+ self.controller.tutorial_query(None,None)
+
+ def set_tutorial_list(self,tutorial_list):
+ """
+ Set the list of tutorial to display in the main View
+ Refresh the View
+
+ @param tutorial_list the list of tutorial
+ """
+ self.mainView.set_tutorial_list(tutorial_list)
+
+
+ def change_sorting(self,sorting_key):
+ """
+ Sort the list of tutorial base on the sorting_key
+
+ @param sorting_key the tutorial metadata to use to sort the tutorials
+ """
+ self.mainView.change_sorting(sorting_key)
+
+ def refresh_tutorial_info(self):
+ """
+ Tell the view to refresh the content of the tutorial list because some info have changed
+
+ Call this function when information about tutorial have changed, but the tutorial to display are the same
+ """
+ pass
+
+ def toggle_tutorial_publish(self,tutorial,published):
+ """
+ Change the publish/unpublish status of the tutorial on the view
+
+ @param tutorial the tutorial to change the status
+ @param published True if the tutorial is published, False if not
+ """
+ pass
+
+ def display_detail(self,tutorial):
+ """
+ Displays the detail view of a tutorial
+
+ @param tutorial the tutorial to display
+ """
+ self.mainView.hide()
+ self.remove(self.mainView)
+ print tutorial.name
+ self.detailView = WorkshopDetail(tutorial,self.controller)
+ self.add(self.detailView)
+ self.detailView.show()
+
+ def display_main_view(self):
+ """
+ Displays the main view of the Workshop
+ """
+ self.detailView.hide()
+ self.remove(self.detailView)
+ self.add(self.mainView)
+ self.mainView.show()
+
+ def display_info_dialog(self,tutorial):
+ """
+ Displays the infos dialog on a tutorial
+
+ @param tutorial the tutorial to edit
+ """
+ pass
+
+class WorkshopMain(gtk.VBox):
+ def __init__(self,controller):
+ gtk.VBox.__init__(self,False,10)
+
+ self.controller = controller
+
+ self.set_border_width(10)
+ self.search_bar = SearchBar(self.controller)
+ self.pack_start(self.search_bar,False,False)
+
+ sep = gtk.HSeparator()
+ self.pack_start(sep,False,False)
+ self.main_container = gtk.ScrolledWindow()
+ self.main_container.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
+
+ self.list_container= gtk.VBox()
+
+ self.main_container.add_with_viewport(self.list_container)
+ self.pack_start(self.main_container)
+
+ self.search_bar.show()
+ self.list_container.show()
+ self.main_container.show()
+ sep.show()
+ self.tutorial_list = []
+ self.sorting_key = 'Name'
+
+
+ def change_sorting(self,sorting):
+ self.sorting_key = sorting
+ self.sort_tutorial()
+
+ def sort_tutorial(self):
+ self.tutorial_list.sort(lambda x, y:
+ cmp(str(getattr(x,self.sorting_key.lower())).lower(),str(getattr(y,self.sorting_key.lower())).lower()))
+ self.refresh_tutorial_display()
+
+ def set_tutorial_list(self,tutorial_list):
+ self.tutorial_list = tutorial_list
+ self.sort_tutorial()
+
+ def refresh_tutorial_display(self):
+ for child in self.list_container.get_children():
+ self.list_container.remove(child)
+ for tuto in self.tutorial_list:
+ item = WorkshopListItem(tuto,self.controller)
+ self.list_container.pack_start(item)
+ item.show()
+
+class SearchBar(gtk.HBox):
+ def __init__(self,controller):
+ gtk.HBox.__init__(self,False,10)
+ self.set_border_width(5)
+ self.controller = controller
+
+ self.search_entry = gtk.Entry(400)
+ self.search_button = gtk.Button("Go")
+ self.separator = gtk.VSeparator()
+ self.sort_label = gtk.Label("Sort by")
+ self.sort_combo = gtk.combo_box_new_text()
+ self.sort_combo.insert_text(0,"Name")
+ self.sort_combo.insert_text(1,"Rating")
+ self.sort_combo.set_active(0)
+ self.selected_sorting = self.sort_combo.get_active_text()
+
+ self.pack_start(self.search_entry,padding=5)
+ self.pack_start(self.search_button,False,False,padding=10)
+ self.pack_start(self.separator,False,False,padding=10)
+ self.pack_start(self.sort_label,False,False,padding=5)
+ self.pack_start(self.sort_combo,)
+
+ self.search_entry.show()
+ self.search_button.show()
+ self.separator.show()
+ self.sort_label.show()
+ self.sort_combo.show()
+
+ self.search_button.connect("clicked",self.controller.tutorial_query,self.search_entry.get_text())
+ self.sort_combo.connect("changed",self.controller.sort_selection_changed,None)
+
+ def get_sorting(self):
+ return self.selected_sorting
+
+ sorting = property(get_sorting)
+
+
+
+class WorkshopDetail(gtk.VBox):
+ def __init__(self,tutorial,controller):
+ if tutorial is None:
+ return
+
+ self.title_text = '<span size="xx-large">%(title)s</span>'
+ self.author_text = '<span size="large">by %(author)s</span>'
+ self.desc_text = 'Description: %(description)s'
+ self.controller = controller
+ gtk.VBox.__init__(self,False,10)
+ self.set_border_width(10)
+
+ first_row = gtk.HBox(False)
+ back_image = gtk.Image()
+ back_image.set_from_file('arrow_back.png')
+ self.back_button = gtk.Button("Back")
+ self.back_button.set_image(back_image)
+
+ first_row.pack_start(self.back_button,False,False)
+
+ second_row = gtk.HBox(False)
+ icon = gtk.Image()
+ icon.set_from_file('icon.svg')
+
+ label_holder = gtk.VBox(False,10)
+
+ self.title_label = gtk.Label(tutorial.name)
+ self.title_label.set_alignment(0.0,0.5)
+ self.author_label = gtk.Label(tutorial.author)
+ self.author_label.set_alignment(0.05,0.5)
+
+ label_holder.pack_start(self.title_label)
+ label_holder.pack_start(self.author_label)
+
+ self.rating = Rating(tutorial.rating)
+
+ second_row.pack_start(icon,False,False)
+ second_row.pack_start(label_holder)
+ second_row.pack_end(self.rating,False,False)
+
+ self.desc_view = gtk.TextView()
+ self.desc_buff = gtk.TextBuffer()
+ self.desc_buff.set_text(tutorial.description)
+ self.desc_view.set_buffer(self.desc_buff)
+ self.desc_view.set_editable(False)
+ self.desc_view.set_wrap_mode(gtk.WRAP_WORD)
+ self.desc_view.set_cursor_visible(False)
+ self.desc_view.connect("realize",self.realize_cb,None)
+ self.desc_view.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("gray") )
+
+ fourth_row = gtk.HBox(False,15)
+ self.launch_button = gtk.Button('Launch')
+ self.launch_button.get_child().set_markup(self.title_text %{"title":"Launch"})
+ self.edit_button = gtk.Button('Edit')
+ self.edit_button.get_child().set_markup(self.title_text %{"title":"Edit"})
+ self.update_button = gtk.Button('Update')
+ self.update_button.get_child().set_markup(self.title_text %{"title":"Update"})
+ self.info_button = gtk.Button('Infos')
+ self.info_button.get_child().set_markup(self.title_text %{"title":"Infos"})
+ self.delete_button = gtk.Button('Delete')
+ self.delete_button.get_child().set_markup(self.title_text %{"title":"Delete"})
+
+ fourth_row.pack_start(self.launch_button,False,False)
+ fourth_row.pack_start(self.edit_button,False,False)
+ fourth_row.pack_start(self.update_button,False,False)
+ fourth_row.pack_start(self.info_button,False,False)
+ fourth_row.pack_end(self.delete_button,False,False)
+
+ fifth_row = gtk.HBox(False,15)
+ self.publish_button = gtk.Button('')
+ self.publish_button.get_child().set_markup(self.title_text %{"title":"Publish"})
+ self.unpublish_button = gtk.Button('')
+ self.unpublish_button.get_child().set_markup(self.title_text %{"title":"Unpublish"})
+
+ fifth_row.pack_start(self.publish_button,False,False)
+ fifth_row.pack_start(self.unpublish_button,False,False)
+
+ self.pack_start(first_row,False,False)
+ self.pack_start(second_row,False,False)
+ self.pack_start(self.desc_view)
+ self.pack_end(fifth_row,False,False)
+ self.pack_end(fourth_row,False,False)
+
+
+ self.back_button.show()
+ first_row.show()
+ self.title_label.show()
+ self.author_label.show()
+ self.rating.show()
+ label_holder.show()
+ second_row.show()
+ icon.show()
+ self.desc_view.show()
+ self.launch_button.show()
+ self.edit_button.show()
+ self.update_button.show()
+ self.info_button.show()
+ self.delete_button.show()
+ fourth_row.show()
+
+ self.publish_button.show()
+ self.unpublish_button.show()
+ fifth_row.show()
+
+ self.title_label.set_markup(self.title_text % {"title":tutorial.name})
+ self.author_label.set_markup(self.author_text % {"author":tutorial.author})
+
+ self.back_button.connect("clicked",self.controller.back_pressed,None)
+
+ def realize_cb(self,widget,data=None):
+ widget.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)) \ No newline at end of file
diff --git a/Workshop.activity/WorkshopController.py b/Workshop.activity/WorkshopController.py
new file mode 100644
index 0000000..ba192cf
--- /dev/null
+++ b/Workshop.activity/WorkshopController.py
@@ -0,0 +1,119 @@
+"""
+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
+ self.model = model
+
+ def tutorial_query(self,widget,keyword):
+ """
+ Handles query from the view
+
+ @param widget the widget that sent the query
+ @param keyword the keyword for the query, empty to get all tutorials
+ """
+ self.model.query(keyword)
+
+ 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
+ """
+ sorting = widget.get_active_text()
+ self.view.change_sorting(sorting)
+
+
+ def launch_tutorial_triggered(self,widget,tutorial):
+ """
+ Handles start tutorial action
+
+ @param widget the widget that triggered the action
+ @param tutorial the tutorial to launch
+ """
+ pass
+
+ def show_details(self,widget,tutorial):
+ """
+ show the details for a tutorial
+
+ @param widget the widget that made the call
+ @param tutorial the tutorial to
+ """
+ self.view.display_detail(tutorial)
+
+ def back_pressed(self,widget,data):
+ """
+ When in detail view, go back to general view
+
+ @param widget the widget that made the call
+ @param data not used
+ """
+ self.view.display_main_view()
+
+ def rate_tutorial(self,widget,data):
+ """
+ Change the rating for a tutorial
+
+ @param widget the widget that made the call
+ @param data a tuple (tutorial,new_rating)
+ """
+ pass
+
+ def edit_tutorial(self,widget,tutorial):
+ """
+ Edit the tutorial in the detail view
+
+ @param widget the widget that made the call
+ @param tutorial the tutorial to edit
+ """
+ pass
+
+ def update_tutorial(self,widget,tutorial):
+ """
+ Need to know what this do
+ """
+ pass
+
+ def info_tutorial(self,widget,tutorial):
+ """
+ Edit the infos about the tutorial
+
+ @param widget the widget that made the call
+ @param tutorial the tutorial to edit
+ """
+ pass
+
+ def delete_tutorial(self,widget,tutorial):
+ """
+ Delete a tutorial
+
+ @param widget the widget that made the call
+ @param tutorial the tutorial to delete
+ """
+ self.model.delete_tutorial(tutorial)
+
+ def publish_tutorial(self,widget,tutorial):
+ """
+ Publish a tutorial
+
+ @param widget the widget that made the call
+ @param tutorial the tutorial to publish
+ """
+ self.model.publish_tutorial(tutorial)
+
+ def unpublish_tutorial(self,widget,tutorial):
+ """
+ Unpublish a tutorial
+
+ @param widget the widget that made the call
+ @param tutorial the tutorial to unpublish
+ """
+ self.model.unpublish_tutorial(tutorial)
diff --git a/Workshop.activity/WorkshopListItem.py b/Workshop.activity/WorkshopListItem.py
new file mode 100644
index 0000000..0828f2c
--- /dev/null
+++ b/Workshop.activity/WorkshopListItem.py
@@ -0,0 +1,78 @@
+import gtk
+
+class WorkshopListItem(gtk.Alignment):
+ def __init__(self,tutorial,controller):
+ gtk.Alignment.__init__(self,0.0,0.0,1.0,1.0)
+ self.tutorial = tutorial
+ self.controller = controller
+
+ self.title_text = '<span size="xx-large">%(title)s</span>'
+ self.table = gtk.Table(3,3,False)
+
+ self.lbl_title = gtk.Label('')
+ self.lbl_desc = gtk.Label(tutorial.description)
+ self.lbl_desc.set_line_wrap(True)
+ self.btn_launch = gtk.Button('Launch')
+ launch_align= gtk.Alignment(0.0,1.0,0.0,0.0)
+ launch_align.add(self.btn_launch)
+ self.btn_details = gtk.Button('Details')
+ self.icon = gtk.Image()
+ self.icon.set_from_file('icon.svg')
+ self.rating = Rating(tutorial.rating)
+
+ self.table.attach(self.icon,0,1,0,1,0,0)
+ self.table.attach(self.lbl_title,1,2,0,1,yoptions=0)
+ self.table.attach(self.lbl_desc,1,2,1,2,xoptions=gtk.FILL,yoptions=gtk.EXPAND)
+ self.table.attach(launch_align,1,2,2,3,gtk.FILL)
+ self.table.attach(self.btn_details,2,3,2,3,0,0)
+ self.table.attach(self.rating,2,3,0,2,0,0)
+
+ self.table.set_row_spacing(1,10)
+
+ self.lbl_title.set_alignment(0.0,0.5)
+ self.lbl_title.set_markup(self.title_text % {'title':tutorial.name})
+ self.lbl_desc.set_alignment(0.0,0.5)
+
+ self.table.show()
+ self.icon.show()
+ self.lbl_title.show()
+ launch_align.show()
+ self.lbl_desc.show()
+ self.btn_launch.show()
+ self.btn_details.show()
+ self.rating.show()
+
+ self.add(self.table)
+
+ self.btn_details.connect("clicked",self.controller.show_details,self.tutorial)
+
+class Rating(gtk.HBox):
+ def __init__(self,rating):
+ gtk.HBox.__init__(self,False,4)
+ value = rating
+ self.stars = [0,0,0,0,0]
+ for x in range(5):
+ if value -1 > 0:
+ self.stars[x]=1
+ elif value -1 == -0.5:
+ self.stars[x] = 0.5
+ break
+ else:
+ self.stars[x]=1
+ break
+ value -= 1
+ self.prepare_image()
+
+ def prepare_image(self):
+ for x in self.stars:
+ if x == 0:
+ filename='grayed_star.png'
+ elif x == 0.5:
+ filename='half_star.png'
+ elif x == 1:
+ filename='full_star.png'
+ image = gtk.Image()
+ image.set_from_file(filename)
+ self.pack_start(image)
+ image.show()
+
diff --git a/Workshop.activity/WorkshopModel.py b/Workshop.activity/WorkshopModel.py
new file mode 100644
index 0000000..79e8f74
--- /dev/null
+++ b/Workshop.activity/WorkshopModel.py
@@ -0,0 +1,162 @@
+"""
+WorkshopModel
+
+This module is the model of the Workshop Activity
+"""
+
+#import sugar.tutorius.vault
+
+class WorkshopModel():
+ def __init__(self,view):
+ self.view = view
+
+ def query(self,keyword):
+ """
+ Query the vault for tutorial that are linked with the keyword
+ Update the currently managed tutorials and notifies the view that the managed tutorials have changed
+
+ @param keyword the keyword for the query
+ """
+ t1 = Tutorial({'name':'tuto 1',"description":"This is the description","rating":5})
+ t2 = Tutorial({'name':'tuto 2',"description":"This is the description of another","rating":4})
+ t3 = Tutorial({'name':'tuto 3',"description":"This is the description oh the last","rating":3})
+ t4 = Tutorial({'name':'tuto 4',"description":"This is the description oh the last","rating":1})
+ t5 = Tutorial({'name':'tuto 5',"description":"This is the description oh the last","rating":1})
+ t6 = Tutorial({'name':'tuto 6',"description":"This is the description oh the last","rating":1})
+ t7 = Tutorial({'name':'tuto 7',"description":"This is the description oh the last","rating":1})
+ tutorial_list = [t1,t2,t3,t4,t5,t6,t7]
+
+## vault_return = vault.query({},{},{})
+## tutorial_list = []
+## for tuto in vault_return:
+## tutorial_list.append(Tutorial(tuto))
+
+ self.view.set_tutorial_list(tutorial_list)
+
+ def delete_tutorial(self,tutorial):
+ """
+ Delete a tutorial and updated the currently managed tutorials
+ Notifies the view that the manages tutorials have changed
+
+ @param tutorial the tutorial to delete
+ """
+ pass
+
+ def update_tutorial_infos(self,tutorial, new_infos):
+ """
+ Updates the metadata on a tutorial and updates the currently managed tutorials
+ Notifies the view tha the managed tutorials have changed
+
+ @param tutorial the tutorial to update
+ @param new_infos a dictionnary of the new informations i.e. {"title":"tut1","author":"Max Power"}
+ """
+ pass
+
+ def publish_tutorial(self,tutorial):
+ """
+ Publishes a tutorial
+
+ Details to come
+ """
+ pass
+
+ def unpublish_tutorial(self,tutorial):
+ """
+ Unpublishes a tutorial
+
+ Details to come
+ """
+ pass
+
+
+class Tutorial():
+ """
+ Wrapper for tutorial metadata
+ """
+ def __init__(self,metadata_dict):
+ self.__original_dict = metadata_dict
+ self.__update_dict = metadata_dict
+
+ if 'name' in self.__original_dict:
+ self.__name = self.__original_dict['name']
+ else:
+ self.__description = name
+
+ if 'description' in self.__original_dict:
+ self.__description = self.__original_dict['description']
+ else:
+ self.__description = None
+
+ if 'author' in self.__original_dict:
+ self.__author = self.__original_dict['author']
+ else:
+ self.__author = None
+
+ if 'rating' in self.__original_dict:
+ self.__rating = self.__original_dict['rating']
+ else:
+ self.__rating = None
+
+ if 'publish_state' in self.__original_dict:
+ self.__published_state = original_dict['publish_state']
+ else:
+ self.__published_state = None
+
+ if 'guid' in self.__original_dict:
+ self.__id = original_state['guid']
+ else:
+ self.__id = None
+
+ def get_name(self):
+ return self.__name
+
+ def set_name(self,name):
+ self.__name = name
+
+ def get_description(self):
+ return self.__description
+
+ def set_description(self,description):
+ self.__description = description
+ self.__update_dict['Description'] = description
+
+ def get_author(self):
+ return self.__author
+
+ def set_author(self,author):
+ self.__author = author
+ self.__update_dict['Author'] = author
+
+ def get_rating(self):
+ return self.__rating
+
+ def set_rating(self,rating):
+ self.__rating = rating
+ self.__update_dict['Rating'] = rating
+
+ def get_published_state(self):
+ return self.__published_state
+
+ def set_published_state(self,published_state):
+ self.__published_state = published_state
+ self.__update_dict['PublishedState'] = published_state
+
+ def get_id(self):
+ return self.__id
+
+ def set_id(self,id):
+ self.__id = id
+ self.__update_dict['TutorialId'] = id
+
+ def get_updated_metadata(self):
+ return self.__update_dict
+
+ name = property(get_name,set_name)
+ description = property(get_description,set_description)
+ author = property(get_author,set_author)
+ rating = property(get_rating,set_rating)
+ published_state = property(get_published_state,set_published_state)
+ id = property(get_id,set_id)
+ updated_metadata = property(get_updated_metadata)
+
+
diff --git a/Workshop.activity/activity/activity.info b/Workshop.activity/activity/activity.info
new file mode 100644
index 0000000..02dbee1
--- /dev/null
+++ b/Workshop.activity/activity/activity.info
@@ -0,0 +1,8 @@
+[Activity]
+name = Tutorius
+bundle_id = org.laptop.TutoriusActivity
+class = TutoriusActivity.TutoriusActivity
+icon = someicon
+activity_version = 1
+host_version = 1
+show_launcher = yes
diff --git a/Workshop.activity/activity/someicon.svg b/Workshop.activity/activity/someicon.svg
new file mode 100644
index 0000000..bb28f04
--- /dev/null
+++ b/Workshop.activity/activity/someicon.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0" ?><!-- Created with Inkscape (http://www.inkscape.org/) --><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [
+ <!ENTITY stroke_color "#000000">
+ <!ENTITY fill_color "#ffffff">
+]><svg height="55px" id="svg2393" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:version="0.47pre1 r21720" sodipodi:docname="tutortool.svg" sodipodi:version="0.32" version="1.1" width="55px" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
+ <defs id="defs2395">
+ <inkscape:perspective id="perspective2401" inkscape:persp3d-origin="16 : 10.666667 : 1" inkscape:vp_x="0 : 16 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="32 : 16 : 1" sodipodi:type="inkscape:persp3d"/>
+ </defs>
+ <sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="3.7661233" inkscape:cy="33.132055" inkscape:document-units="px" inkscape:grid-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="675" inkscape:window-maximized="0" inkscape:window-width="1057" inkscape:window-x="108" inkscape:window-y="45" inkscape:zoom="3.9590209" pagecolor="#ffffff" showgrid="true"/>
+ <metadata id="metadata2398">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1" transform="translate(0,23)">
+ <path d="m 38.01548,1.5478747 c 0,7.1837999 -7.3667,13.0141283 -16.443525,13.0141283 -2.269208,0 -8.124729,3.152936 -13.9608513,4.252763 C 13.382177,14.110994 11.434521,11.926642 9.9463815,10.748864 6.9701032,8.3933076 5.1284282,5.1397735 5.1284282,1.5478747 c 0,-7.1837994 7.3666998,-13.0141297 16.4435268,-13.0141297 9.076825,0 16.443525,5.8303303 16.443525,13.0141297 z" id="path2403" sodipodi:nodetypes="cscsssc" style="fill:&fill_color;;fill-opacity:1;fill-rule:nonzero;stroke:&stroke_color;;stroke-width:1.96931934;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"/>
+ <path d="m 50.150276,6.4721386 c 0,2.621116 -1.428036,4.9953144 -3.735846,6.7142344 -1.153905,0.85946 -1.824287,2.434433 1.398853,6.784273 -6.258422,-3.991066 -8.65379,-4.001712 -10.413335,-4.001712 -7.03818,0 -12.750327,-4.254565 -12.750327,-9.4967954 0,-5.2422321 5.712147,-9.4967971 12.750327,-9.4967971 7.038182,0 12.750328,4.254565 12.750328,9.4967971 z" id="path3175" sodipodi:nodetypes="cccsssc" style="fill:&fill_color;;fill-opacity:1;fill-rule:nonzero;stroke:&stroke_color;;stroke-width:1.96931934;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"/>
+ </g>
+</svg> \ No newline at end of file
diff --git a/Workshop.activity/arrow_back.png b/Workshop.activity/arrow_back.png
new file mode 100644
index 0000000..8263674
--- /dev/null
+++ b/Workshop.activity/arrow_back.png
Binary files differ
diff --git a/Workshop.activity/dialogs.py b/Workshop.activity/dialogs.py
new file mode 100644
index 0000000..1cf135d
--- /dev/null
+++ b/Workshop.activity/dialogs.py
@@ -0,0 +1,139 @@
+import gtk
+
+class LoginDialog(gtk.Dialog):
+ def __init__(self):
+ gtk.Dialog.__init__(self,"Login",None,gtk.DIALOG_MODAL)
+ ok_button = gtk.Button("Login")
+ ok_button.connect("clicked",self.ok_clicked,None)
+ ok_button.show()
+ self.action_area.pack_start(ok_button)
+ self.add_button("Cancel",gtk.RESPONSE_REJECT)
+ self.set_resizable(False)
+ self.prepare_dialog()
+
+
+ def prepare_dialog(self):
+ self.user_line = gtk.HBox(False,10)
+ self.pass_line = gtk.HBox(False,10)
+ self.register_line = gtk.HBox(False)
+ self.remember_line = gtk.HBox(False)
+
+ self.username_lbl = gtk.Label("Username:")
+ self.username_entry = gtk.Entry()
+ self.username_entry.set_width_chars(40)
+
+ self.password_lbl = gtk.Label("Password:")
+ self.password_entry = gtk.Entry()
+ self.password_entry.set_visibility(False)
+ self.password_entry.set_width_chars(40)
+
+ self.register_me = gtk.LinkButton("","Register Now!")
+ self.not_registered = gtk.Label("Not Registered? ")
+
+ self.remember_user = gtk.CheckButton("Remember my username",False)
+
+ self.register_me.connect("clicked",self.click_link,None)
+
+ self.user_line.pack_start(self.username_lbl,False)
+ self.user_line.pack_end(self.username_entry,False)
+
+ self.pass_line.pack_start(self.password_lbl,False)
+ self.pass_line.pack_end(self.password_entry,False)
+
+ self.register_line.pack_end(self.register_me,False)
+ self.register_line.pack_end(self.not_registered,False)
+
+ self.remember_line.pack_start(self.remember_user,False,padding=80)
+
+ self.vbox.pack_start(self.register_line,False)
+ self.vbox.pack_start(self.user_line,False,padding=10)
+ self.vbox.pack_start(self.pass_line,False,padding=10)
+ self.vbox.pack_start(self.remember_line,False)
+
+ self.vbox.show()
+ self.user_line.show()
+ self.pass_line.show()
+ self.register_line.show()
+ self.remember_line.show()
+
+ self.username_lbl.show()
+ self.username_entry.show()
+
+ self.password_lbl.show()
+ self.password_entry.show()
+
+ self.register_me.show()
+ self.not_registered.show()
+
+ self.remember_user.show()
+
+ def ok_clicked(self,widget,data=None):
+ self.response(gtk.RESPONSE_ACCEPT)
+
+ def click_link(self,widget,data=None):
+ self.register_dialog = RegisterDialog()
+ self.register_dialog.run()
+ self.register_dialog.destroy()
+
+class RegisterDialog(gtk.Dialog):
+ def __init__(self):
+ gtk.Dialog.__init__(self,"Register",None,gtk.DIALOG_MODAL)
+ ok_button = gtk.Button("Register")
+ ok_button.connect("clicked",self.ok_clicked,None)
+ ok_button.show()
+ self.action_area.pack_start(ok_button)
+ self.add_button("Cancel",gtk.RESPONSE_REJECT)
+ self.set_resizable(False)
+ self.create_content()
+
+ def ok_clicked(self,widget,data=None):
+ self.response(gtk.RESPONSE_ACCEPT)
+
+ def create_content(self):
+ entry_length = 40
+ table = gtk.Table(10,4,False)
+ labels = ["Email address","Name","Username","Password","Confirmation","Location","Web Site"]
+ required=[True,True,True,True,True,False,False]
+ hidden=[False,False,False,True,True,False,False]
+ for x in range(6):
+ lbl = gtk.Label(labels[x]+":")
+ entry = gtk.Entry()
+ entry.set_width_chars(entry_length)
+ table.attach(lbl,0,1,x,x+1,xpadding=10)
+ table.attach(entry,1,2,x,x+1,ypadding=10)
+ if hidden[x]:
+ entry.set_visibility(False)
+ if required[x]:
+ required_lbl = gtk.Label("*")
+ table.attach(required_lbl,2,3,x,x+1)
+ required_lbl.show()
+ lbl.set_alignment(0.0,0.5)
+ lbl.show()
+ entry.show()
+
+
+ if_required = gtk.Label(" * Required Field")
+ table.attach(if_required,3,4,0,1)
+
+ under_13 = gtk.CheckButton("I am 13 years old or younger",False)
+ legal = gtk.CheckButton("I have read the",False)
+ legal_notices=gtk.LinkButton('',"legal notices")
+ and_lbl = gtk.Label("and")
+ privacy = gtk.LinkButton('',"privacy statement")
+ hbox = gtk.HBox(False,0)
+ hbox.pack_start(legal)
+ hbox.pack_start(legal_notices)
+ hbox.pack_start(and_lbl)
+ hbox.pack_start(privacy)
+
+ table.attach(under_13,1,2,7,8)
+ table.attach(hbox,1,2,8,9)
+ under_13.show()
+ legal.show()
+ legal_notices.show()
+ and_lbl.show()
+ privacy.show()
+ hbox.show()
+ if_required.show()
+ table.show()
+ self.vbox.pack_start(table)
diff --git a/Workshop.activity/full_star.png b/Workshop.activity/full_star.png
new file mode 100644
index 0000000..9f7d095
--- /dev/null
+++ b/Workshop.activity/full_star.png
Binary files differ
diff --git a/Workshop.activity/grayed_star.png b/Workshop.activity/grayed_star.png
new file mode 100644
index 0000000..7f8b1e1
--- /dev/null
+++ b/Workshop.activity/grayed_star.png
Binary files differ
diff --git a/Workshop.activity/half_star.png b/Workshop.activity/half_star.png
new file mode 100644
index 0000000..48ebae3
--- /dev/null
+++ b/Workshop.activity/half_star.png
Binary files differ
diff --git a/Workshop.activity/icon.svg b/Workshop.activity/icon.svg
new file mode 100644
index 0000000..bb28f04
--- /dev/null
+++ b/Workshop.activity/icon.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0" ?><!-- Created with Inkscape (http://www.inkscape.org/) --><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [
+ <!ENTITY stroke_color "#000000">
+ <!ENTITY fill_color "#ffffff">
+]><svg height="55px" id="svg2393" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:version="0.47pre1 r21720" sodipodi:docname="tutortool.svg" sodipodi:version="0.32" version="1.1" width="55px" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
+ <defs id="defs2395">
+ <inkscape:perspective id="perspective2401" inkscape:persp3d-origin="16 : 10.666667 : 1" inkscape:vp_x="0 : 16 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="32 : 16 : 1" sodipodi:type="inkscape:persp3d"/>
+ </defs>
+ <sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="3.7661233" inkscape:cy="33.132055" inkscape:document-units="px" inkscape:grid-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="675" inkscape:window-maximized="0" inkscape:window-width="1057" inkscape:window-x="108" inkscape:window-y="45" inkscape:zoom="3.9590209" pagecolor="#ffffff" showgrid="true"/>
+ <metadata id="metadata2398">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1" transform="translate(0,23)">
+ <path d="m 38.01548,1.5478747 c 0,7.1837999 -7.3667,13.0141283 -16.443525,13.0141283 -2.269208,0 -8.124729,3.152936 -13.9608513,4.252763 C 13.382177,14.110994 11.434521,11.926642 9.9463815,10.748864 6.9701032,8.3933076 5.1284282,5.1397735 5.1284282,1.5478747 c 0,-7.1837994 7.3666998,-13.0141297 16.4435268,-13.0141297 9.076825,0 16.443525,5.8303303 16.443525,13.0141297 z" id="path2403" sodipodi:nodetypes="cscsssc" style="fill:&fill_color;;fill-opacity:1;fill-rule:nonzero;stroke:&stroke_color;;stroke-width:1.96931934;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"/>
+ <path d="m 50.150276,6.4721386 c 0,2.621116 -1.428036,4.9953144 -3.735846,6.7142344 -1.153905,0.85946 -1.824287,2.434433 1.398853,6.784273 -6.258422,-3.991066 -8.65379,-4.001712 -10.413335,-4.001712 -7.03818,0 -12.750327,-4.254565 -12.750327,-9.4967954 0,-5.2422321 5.712147,-9.4967971 12.750327,-9.4967971 7.038182,0 12.750328,4.254565 12.750328,9.4967971 z" id="path3175" sodipodi:nodetypes="cccsssc" style="fill:&fill_color;;fill-opacity:1;fill-rule:nonzero;stroke:&stroke_color;;stroke-width:1.96931934;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"/>
+ </g>
+</svg> \ No newline at end of file
diff --git a/Workshop.activity/setup.py b/Workshop.activity/setup.py
new file mode 100755
index 0000000..f95b630
--- /dev/null
+++ b/Workshop.activity/setup.py
@@ -0,0 +1,3 @@
+#! /usr/bin/env python
+from sugar.activity import bundlebuilder
+bundlebuilder.start()