From d32627e8a646d78497cf42e939b7e272b61d62da Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Mon, 19 Oct 2009 20:18:49 +0000 Subject: use the service to launch activities --- diff --git a/src/sugar/activity/widgets.py b/src/sugar/activity/widgets.py index ca38495..1cc3935 100644 --- a/src/sugar/activity/widgets.py +++ b/src/sugar/activity/widgets.py @@ -33,6 +33,7 @@ from sugar.graphics.icon import Icon from sugar.bundle.activitybundle import ActivityBundle from sugar.tutorius.creator import Creator +from sugar.tutorius.service import ServiceProxy from sugar.tutorius.bundler import TutorialStore _ = lambda msg: gettext.dgettext('sugar-toolkit', msg) @@ -193,7 +194,7 @@ class TutorButton(ToolButton): self.connect('clicked', Creator.launch) class TutorialsCombo(ToolComboBox): - + #FIXME class should be moved to the frame def __init__(self, activity, combo=None, **kwargs): ToolComboBox.__init__(self, combo, **kwargs) self.props.label_text = _("Tutorials:") @@ -201,6 +202,7 @@ class TutorialsCombo(ToolComboBox): self.combo.connect('changed', self.__tutorial_changed_cb, activity) # Get tutorial list by file + self._service = ServiceProxy() store = TutorialStore() tutorials = activity.get_tutorials() @@ -220,22 +222,11 @@ class TutorialsCombo(ToolComboBox): """ Callback for tutorial combobox item change """ - store = TutorialStore() - - if activity._current_tutorial: - activity._current_tutorial.detach() - model = combo.get_model() it = combo.get_active_iter() (guid,) = model.get(it, 0) - tutorial = store.load_tutorial(guid) - - if not activity._current_tutorial is None: - activity._current_tutorial.detach() - - activity._current_tutorial = tutorial - tutorial.attach(activity.get_bundle_id()) + self._service.launch(guid) class TitleEntry(gtk.ToolItem): -- cgit v0.9.1