s/publish/share
This commit is contained in:
parent
8d232ae292
commit
e5065263a9
@ -105,11 +105,11 @@ class BrowserActivity(Activity):
|
||||
def get_embed(self):
|
||||
return self.embed
|
||||
|
||||
def publish(self):
|
||||
def share(self):
|
||||
escaped_title = xml.sax.saxutils.escape(self.embed.get_title())
|
||||
escaped_url = xml.sax.saxutils.escape(self.embed.get_address())
|
||||
|
||||
# Publish ourselves on the network
|
||||
# Share this activity with others
|
||||
properties = {_SERVICE_URI_TAG: escaped_url, _SERVICE_TITLE_TAG: escaped_title}
|
||||
self._share_service = self._pservice.share_activity(self,
|
||||
stype=self._default_type, properties=properties)
|
||||
|
@ -20,8 +20,8 @@ class ActivityHost:
|
||||
def get_id(self):
|
||||
return self._id
|
||||
|
||||
def publish(self):
|
||||
self._activity.publish()
|
||||
def share(self):
|
||||
self._activity.share()
|
||||
|
||||
def get_shared(self):
|
||||
return self._activity.get_shared()
|
||||
|
@ -103,7 +103,7 @@ class PresenceView(gtk.VBox):
|
||||
button_box.show()
|
||||
|
||||
def _share_button_clicked_cb(self, button):
|
||||
self._activity.publish()
|
||||
self._activity.share()
|
||||
|
||||
def _on_buddyList_buddy_selected(self, view, *args):
|
||||
(model, aniter) = view.get_selection().get_selected()
|
||||
|
@ -13,7 +13,7 @@ import sugar.util
|
||||
ACTIVITY_SERVICE_NAME = "com.redhat.Sugar.Activity"
|
||||
ACTIVITY_SERVICE_PATH = "/com/redhat/Sugar/Activity"
|
||||
|
||||
ON_PUBLISH_CB = "publish"
|
||||
ON_SHARE_CB = "share"
|
||||
|
||||
def get_path(activity_name):
|
||||
"""Returns the activity path"""
|
||||
@ -87,7 +87,7 @@ class ActivityDbusService(dbus.service.Object):
|
||||
The dbus service is separate from the actual Activity object so that we can
|
||||
tightly control what stuff passes through the dbus python bindings."""
|
||||
|
||||
_ALLOWED_CALLBACKS = [ON_PUBLISH_CB]
|
||||
_ALLOWED_CALLBACKS = [ON_SHARE_CB]
|
||||
|
||||
def __init__(self, xid, activity):
|
||||
self._activity = activity
|
||||
@ -119,9 +119,9 @@ class ActivityDbusService(dbus.service.Object):
|
||||
gobject.idle_add(self._call_callback_cb, self._callbacks[name], *args)
|
||||
|
||||
@dbus.service.method(ACTIVITY_SERVICE_NAME)
|
||||
def publish(self):
|
||||
"""Called by the shell to request the activity to publish itself on the network."""
|
||||
self._call_callback(ON_PUBLISH_CB)
|
||||
def share(self):
|
||||
"""Called by the shell to request the activity to share itself on the network."""
|
||||
self._call_callback(ON_SHARE_CB)
|
||||
|
||||
@dbus.service.method(ACTIVITY_SERVICE_NAME)
|
||||
def get_id(self):
|
||||
@ -170,7 +170,7 @@ class Activity(gtk.Window):
|
||||
|
||||
def _register_service(self):
|
||||
self._dbus_service = self._get_new_dbus_service()
|
||||
self._dbus_service.register_callback(ON_PUBLISH_CB, self._internal_on_publish_cb)
|
||||
self._dbus_service.register_callback(ON_SHARE_CB, self._internal_on_share_cb)
|
||||
|
||||
def _cleanup(self):
|
||||
if self._dbus_service:
|
||||
@ -204,9 +204,9 @@ class Activity(gtk.Window):
|
||||
"""Return whether or not this Activity is visible to the user."""
|
||||
return self._has_focus
|
||||
|
||||
def _internal_on_publish_cb(self):
|
||||
"""Callback when the dbus service object tells us the user has closed our activity."""
|
||||
self.publish()
|
||||
def _internal_on_share_cb(self):
|
||||
"""Callback when the dbus service object tells us the user has shared our activity."""
|
||||
self.share()
|
||||
|
||||
def get_id(self):
|
||||
return self._activity_id
|
||||
@ -215,6 +215,6 @@ class Activity(gtk.Window):
|
||||
# Pure Virtual methods that subclasses may/may not implement
|
||||
#############################################################
|
||||
|
||||
def publish(self):
|
||||
"""Called to request the activity to publish itself on the network."""
|
||||
def share(self):
|
||||
"""Called to request the activity to share itself on the network."""
|
||||
pass
|
||||
|
@ -38,8 +38,8 @@ class ActivityChat(GroupChat):
|
||||
address=addr, port=port)
|
||||
self._setup_stream(self._chat_service)
|
||||
|
||||
def publish(self):
|
||||
"""Only called when we publish the activity this chat is tied to."""
|
||||
def share(self):
|
||||
"""Only called when we share the activity this chat is tied to."""
|
||||
self._chat_service = self._pservice.share_activity(self._activity,
|
||||
stype=ActivityChat.SERVICE_TYPE)
|
||||
self._setup_stream(self._chat_service)
|
||||
|
Loading…
Reference in New Issue
Block a user