More work on bundles support
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
from sugar.presence import PresenceService
|
||||
from sugar.activity.bundleregistry import BundleRegistry
|
||||
from sugar import env
|
||||
from model.Friends import Friends
|
||||
from model.MeshModel import MeshModel
|
||||
from model.Owner import ShellOwner
|
||||
@@ -28,9 +30,16 @@ class ShellModel:
|
||||
|
||||
self._owner = ShellOwner()
|
||||
self._owner.announce()
|
||||
|
||||
self._friends = Friends()
|
||||
self._mesh = MeshModel()
|
||||
|
||||
self._bundle_registry = BundleRegistry()
|
||||
self._bundle_registry.add_search_path(env.get_bundles_path())
|
||||
|
||||
def get_bundle_registry(self):
|
||||
return self._bundle_registry
|
||||
|
||||
def get_mesh(self):
|
||||
return self._mesh
|
||||
|
||||
|
||||
@@ -55,14 +55,18 @@ class ActivitiesBox(hippo.CanvasBox):
|
||||
hippo.CanvasBox.__init__(self, orientation=hippo.ORIENTATION_HORIZONTAL)
|
||||
|
||||
self._shell = shell
|
||||
self._shell_model = self._shell.get_model()
|
||||
self._invite_to_item = {}
|
||||
self._invites = self._shell.get_model().get_invites()
|
||||
self._invites = self._shell_model.get_invites()
|
||||
|
||||
registry = conf.get_activity_registry()
|
||||
for activity in registry.list_activities():
|
||||
if activity.get_show_launcher():
|
||||
self.add_activity(activity)
|
||||
|
||||
for bundle in self._shell_model.get_bundle_registry():
|
||||
self.add_activity(bundle)
|
||||
|
||||
for invite in self._invites:
|
||||
self.add_invite(invite)
|
||||
self._invites.connect('invite-added', self._invite_added_cb)
|
||||
|
||||
Reference in New Issue
Block a user