Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-07-02 10:26:37 (GMT)
committer Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-08-20 13:02:26 (GMT)
commitbadc739f713ffdaf7ef3d4d4e7139d69d1dbed47 (patch)
treec125efd164d6d8251af23d6a75905a0a3343bc53
parentfb4ea6f55a59ac59db9c2cc3097b55887fe3a8ce (diff)
Remove src/jarabe/model/owner.py and org.laptop.ShellOwner
-rwxr-xr-xbin/sugar-session1
-rw-r--r--src/jarabe/model/Makefile.am3
-rw-r--r--src/jarabe/model/owner.py74
-rw-r--r--src/jarabe/view/service.py43
4 files changed, 1 insertions, 120 deletions
diff --git a/bin/sugar-session b/bin/sugar-session
index cc8358c..b1f0086 100755
--- a/bin/sugar-session
+++ b/bin/sugar-session
@@ -79,7 +79,6 @@ def start_ui_service():
from jarabe.view.service import UIService
ui_service = UIService()
- ui_service.start()
def start_session_manager():
from jarabe.model.session import get_session_manager
diff --git a/src/jarabe/model/Makefile.am b/src/jarabe/model/Makefile.am
index e6ac5b9..92e8712 100644
--- a/src/jarabe/model/Makefile.am
+++ b/src/jarabe/model/Makefile.am
@@ -8,8 +8,7 @@ sugar_PYTHON = \
friends.py \
invites.py \
olpcmesh.py \
- owner.py \
- mimeregistry.py \
+ mimeregistry.py \
neighborhood.py \
network.py \
notifications.py \
diff --git a/src/jarabe/model/owner.py b/src/jarabe/model/owner.py
deleted file mode 100644
index 7d7e1f5..0000000
--- a/src/jarabe/model/owner.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright (C) 2006-2007 Red Hat, Inc.
-# Copyright (C) 2008 One Laptop Per Child
-#
-# 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 gobject
-import os
-import gconf
-import simplejson
-
-from sugar import env
-from sugar import util
-
-class Owner(gobject.GObject):
- """Class representing the owner of this machine/instance. This class
- runs in the shell and serves up the buddy icon and other stuff. It's the
- server portion of the Owner, paired with the client portion in Buddy.py.
- """
- __gtype_name__ = "ShellOwner"
-
- __gsignals__ = {
- 'nick-changed' : (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
- ([gobject.TYPE_STRING])),
- 'color-changed' : (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
- ([gobject.TYPE_PYOBJECT])),
- 'icon-changed' : (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
- ([gobject.TYPE_PYOBJECT]))
- }
-
- def __init__(self):
- gobject.GObject.__init__(self)
-
- client = gconf.client_get_default()
- self._nick = client.get_string("/desktop/sugar/user/nick")
-
- self._icon = None
- self._icon_hash = ""
- icon = os.path.join(env.get_profile_path(), "buddy-icon.jpg")
- if not os.path.exists(icon):
- raise RuntimeError("missing buddy icon")
-
- fd = open(icon, "r")
- self._icon = fd.read()
- fd.close()
- if not self._icon:
- raise RuntimeError("invalid buddy icon")
-
- # Get the icon's hash
- import hashlib
- digest = hashlib.md5(self._icon).digest()
- self._icon_hash = util.printable_hash(digest)
-
- def get_nick(self):
- return self._nick
-
-_model = None
-
-def get_model():
- global _model
- if _model is None:
- _model = Owner()
- return _model
diff --git a/src/jarabe/view/service.py b/src/jarabe/view/service.py
index bb71694..0b8b5c1 100644
--- a/src/jarabe/view/service.py
+++ b/src/jarabe/view/service.py
@@ -20,12 +20,10 @@ import dbus
import gtk
from jarabe.model import shell
-from jarabe.model import owner
from jarabe.model import bundleregistry
_DBUS_SERVICE = "org.laptop.Shell"
_DBUS_SHELL_IFACE = "org.laptop.Shell"
-_DBUS_OWNER_IFACE = "org.laptop.Shell.Owner"
_DBUS_PATH = "/org/laptop/Shell"
class UIService(dbus.service.Object):
@@ -54,15 +52,6 @@ class UIService(dbus.service.Object):
self._shell_model = shell.get_model()
- def start(self):
- owner_model = owner.get_model()
- owner_model.connect('nick-changed', self._owner_nick_changed_cb)
- owner_model.connect('icon-changed', self._owner_icon_changed_cb)
- owner_model.connect('color-changed', self._owner_color_changed_cb)
-
- self._shell_model.connect('active-activity-changed',
- self._cur_activity_changed_cb)
-
@dbus.service.method(_DBUS_SHELL_IFACE,
in_signature="s", out_signature="s")
def GetBundlePath(self, bundle_id):
@@ -97,35 +86,3 @@ class UIService(dbus.service.Object):
def NotifyLaunchFailure(self, activity_id):
shell.get_model().notify_launch_failed(activity_id)
- @dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
- def ColorChanged(self, color):
- pass
-
- def _owner_color_changed_cb(self, new_color):
- self.ColorChanged(new_color.to_string())
-
- @dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
- def NickChanged(self, nick):
- pass
-
- def _owner_nick_changed_cb(self, new_nick):
- self.NickChanged(new_nick)
-
- @dbus.service.signal(_DBUS_OWNER_IFACE, signature="ay")
- def IconChanged(self, icon_data):
- pass
-
- def _owner_icon_changed_cb(self, new_icon):
- self.IconChanged(dbus.ByteArray(new_icon))
-
- @dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
- def CurrentActivityChanged(self, activity_id):
- pass
-
- def _cur_activity_changed_cb(self, shell_model, new_activity):
- new_id = ""
- if new_activity:
- new_id = new_activity.get_activity_id()
- if new_id:
- self.CurrentActivityChanged(new_id)
-