Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-09-15 09:49:04 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-09-15 09:49:04 (GMT)
commit0232dc73b55b5246c927bcbc4b63d4a195b1e9c1 (patch)
tree4fe0471f448a93b984078515b525a501f4c505b8 /shell
parent207f643d388fc24d997f622d7980c26a5494dabf (diff)
Remove unused code
Diffstat (limited to 'shell')
-rw-r--r--shell/ChatController.py54
-rw-r--r--shell/Makefile.am1
-rwxr-xr-xshell/Shell.py7
3 files changed, 0 insertions, 62 deletions
diff --git a/shell/ChatController.py b/shell/ChatController.py
deleted file mode 100644
index 022d608..0000000
--- a/shell/ChatController.py
+++ /dev/null
@@ -1,54 +0,0 @@
-import conf
-from sugar.chat.BuddyChat import BuddyChat
-from sugar.activity import ActivityFactory
-from sugar.presence import PresenceService
-from sugar.p2p.Stream import Stream
-from sugar.chat.Chat import Chat
-
-class ChatController:
- def __init__(self, shell):
- self._shell = shell
- self._id_to_name = {}
- self._name_to_chat = {}
-
- self._shell.connect('activity-closed', self.__activity_closed_cb)
-
- def __activity_closed_cb(self, shell, activity):
- activity_id = activity.get_id()
- if self._id_to_name.has_key(activity_id):
- name = self._id_to_name[activity_id]
- del self._name_to_chat[name]
- del self._id_to_name[activity_id]
-
- def listen(self):
- self._pservice = PresenceService.get_instance()
-
- self._pservice.register_service_type(BuddyChat.SERVICE_TYPE)
- profile = conf.get_profile()
- self._service = self._pservice.register_service(profile.get_nick_name(),
- BuddyChat.SERVICE_TYPE)
-
- self._buddy_stream = Stream.new_from_service(self._service)
- self._buddy_stream.set_data_listener(self._recv_message)
-
- def open_chat_activity(self, buddy):
- service = buddy.get_service_of_type(BuddyChat.SERVICE_TYPE)
- if service:
- activity = self._shell.start_activity('com.redhat.Sugar.ChatActivity')
- activity.execute('connect', [service.object_path()])
- self._name_to_chat[buddy.get_name()] = activity
- self._id_to_name[activity.get_id()] = buddy.get_name()
-
- def _get_chat_activity(self, buddy):
- nick = buddy.get_name()
- if not self._name_to_chat.has_key(nick):
- self.open_chat_activity(buddy)
- return self._name_to_chat[nick]
-
- def _recv_message(self, address, message):
- [nick, msg] = Chat.deserialize_message(message)
- buddy = self._pservice.get_buddy_by_name(nick)
- if buddy:
- activity = self._get_chat_activity(buddy)
- if activity:
- activity.execute('message', [message])
diff --git a/shell/Makefile.am b/shell/Makefile.am
index f48be4e..80aad02 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -11,7 +11,6 @@ sugardir = $(pkgdatadir)/shell
sugar_PYTHON = \
__init__.py \
ActivityHost.py \
- ChatController.py \
ConsoleWindow.py \
FirstTimeDialog.py \
FriendIcon.py \
diff --git a/shell/Shell.py b/shell/Shell.py
index 044d25d..92baaa2 100755
--- a/shell/Shell.py
+++ b/shell/Shell.py
@@ -11,7 +11,6 @@ from home.HomeWindow import HomeWindow
from Owner import ShellOwner
from sugar.presence import PresenceService
from ActivityHost import ActivityHost
-from ChatController import ChatController
from sugar.activity import ActivityFactory
from sugar.activity import Activity
from frame.Frame import Frame
@@ -78,9 +77,6 @@ class Shell(gobject.GObject):
self._home_window.set_owner(self._owner)
- self._chat_controller = ChatController(self)
- self._chat_controller.listen()
-
self._frame = Frame(self, self._owner)
self._frame.show_and_hide(10)
@@ -166,9 +162,6 @@ class Shell(gobject.GObject):
activity.execute('test', [])
return activity
- def get_chat_controller(self):
- return self._chat_controller
-
def set_zoom_level(self, level):
if level == sugar.ZOOM_ACTIVITY:
self._screen.toggle_showing_desktop(False)