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-11-30 22:24:58 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-12-04 02:09:04 (GMT)
commitb8c9419f0381c1864035af76853ed1c02ad434cc (patch)
tree7d17027912045062c8221795c141340d95f29fa9
parent43d86d699eb1abc66d7ea6472590382a6e351bad (diff)
Remote : Adding comments
-rwxr-xr-xsrc/extensions/tutoriusremote.py18
-rw-r--r--tutorius/TProbe.py2
2 files changed, 16 insertions, 4 deletions
diff --git a/src/extensions/tutoriusremote.py b/src/extensions/tutoriusremote.py
index 50fd736..918f3da 100755
--- a/src/extensions/tutoriusremote.py
+++ b/src/extensions/tutoriusremote.py
@@ -84,39 +84,51 @@ class TPalette(Palette):
# default_creator().start_authoring(tutorial=None)
def _list_tutorials(self, widget):
+ # Create the selection dialog
dlg = gtk.Dialog('Run a tutorial',
None,
gtk.DIALOG_MODAL,
(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
- dlg.vbox.pack_start(gtk.Label(_('Which tutorial do you want to run?')))
+ # Write the user prompt
+ dlg.vbox.pack_start(gtk.Label(_('Which tutorial do you want to run?\n')))
+ # Fetchthe current activity name
activity = get_model().get_active_activity()
-
act_name = activity.get_activity_name()
+
+ # Query the vault to get the tutorials related to this activity
tutorial_dict = Vault.list_available_tutorials(act_name)
# Build the combo box
combo = ComboBox()
+
+ # Insert all the related tutorials
for (tuto_name, tuto_guid) in tutorial_dict.items():
combo.append_item(tuto_name, tuto_guid)
dlg.vbox.pack_end(combo)
dlg.show_all()
+ # Show the dialog to the user
result = dlg.run()
+ # If the user cliked OK
if result == gtk.RESPONSE_ACCEPT:
+ # Get the current active item in the
row = combo.get_active_item()
if row:
+ # Fetch the name and Guid
guid = row[0]
name = row[1]
+
LOGGER.debug("TPalette :: Got message to launch tutorial %s with guid %s"%(str(name), str(guid)))
+ # Send a DBus message to the Engine to run this tutorial
from sugar.tutorius.service import ServiceProxy
service = ServiceProxy()
-
service.launch(guid)
+ # Close the dialog
dlg.destroy()
def setup(tray):
diff --git a/tutorius/TProbe.py b/tutorius/TProbe.py
index 4e458a0..d0cc6e1 100644
--- a/tutorius/TProbe.py
+++ b/tutorius/TProbe.py
@@ -480,7 +480,7 @@ class ProbeManager(object):
def setCurrentActivity(self, activity_id):
if not activity_id in self._probes:
- raise RuntimeError("Activity not attached")
+ raise RuntimeError("Activity not attached, id : %s"%activity_id)
self._current_activity = activity_id
def getCurrentActivity(self):