Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/shell.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-06-23 16:49:57 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-06-23 16:49:57 (GMT)
commita929dc0b4655eb2fe0c88b437314b80848e16749 (patch)
treec9d0a5fce2bc6cc57eb850b0acdcab27b8188e58 /shell/shell.py
parent5fa4d3426e7f786b327a25d9f4de83ac8394303b (diff)
Fix up focus handling some
Diffstat (limited to 'shell/shell.py')
-rwxr-xr-xshell/shell.py30
1 files changed, 11 insertions, 19 deletions
diff --git a/shell/shell.py b/shell/shell.py
index 5d9e9ae..a5dc0b7 100755
--- a/shell/shell.py
+++ b/shell/shell.py
@@ -33,6 +33,8 @@ class ActivityHostSignalHelper(gobject.GObject):
class ActivityHost(dbus.service.Object):
def __init__(self, activity_container, activity_name, default_type, activity_id = None):
+ self.peer_service = None
+
self.activity_name = activity_name
self.ellipsize_tab = False
self._shared = False
@@ -99,6 +101,13 @@ class ActivityHost(dbus.service.Object):
def _create_chat(self):
self._activity_chat = ActivityChat(self)
+ def got_focus(self):
+ if self.peer_service != None:
+ self.peer_service.got_focus()
+
+ def lost_focus(self):
+ self.peer_service.lost_focus()
+
def get_chat(self):
return self._activity_chat
@@ -365,12 +374,6 @@ class ActivityContainer(dbus.service.Object):
def show(self):
self.window.show()
- def __focus_reply_cb(self):
- pass
-
- def __focus_error_cb(self, error):
- pass
-
def set_current_activity(self, activity):
self.current_activity = activity
self._presence_window.set_activity(activity)
@@ -388,23 +391,12 @@ class ActivityContainer(dbus.service.Object):
new_activity = notebook.get_nth_page(page_number).get_data("sugar-activity")
if self.current_activity != None:
- if self.has_activity(self.current_activity):
- self.current_activity.peer_service.lost_focus(reply_handler = self.__focus_reply_cb, error_handler = self.__focus_error_cb)
+ self.current_activity.lost_focus()
- #if self.has_activity(new_activity):
self.set_current_activity(new_activity)
if self.current_activity != None:
- if self.has_activity(self.current_activity):
- self.current_activity.peer_service.got_focus(reply_handler = self.__focus_reply_cb, error_handler = self.__focus_error_cb)
-
-
- def has_activity(self, activity_to_check_for):
- for owner, activity in self.activities[:]:
- if activity_to_check_for == activity:
- return True
- return False
-
+ self.current_activity.got_focus()
def name_owner_changed(self, service_name, old_service_name, new_service_name):
#print "in name_owner_changed: svc=%s oldsvc=%s newsvc=%s"%(service_name, old_service_name, new_service_name)