Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
This commit is contained in:
commit
8421d5c04d
@ -44,26 +44,18 @@ class ActivityToolbar(gtk.Toolbar):
|
|||||||
activity.connect('shared', self._activity_shared_cb)
|
activity.connect('shared', self._activity_shared_cb)
|
||||||
activity.connect('joined', self._activity_shared_cb)
|
activity.connect('joined', self._activity_shared_cb)
|
||||||
|
|
||||||
button = ToolButton('window-close')
|
self.close = ToolButton('window-close')
|
||||||
button.connect('clicked', self._close_button_clicked_cb)
|
self.insert(self.close, -1)
|
||||||
self.insert(button, -1)
|
self.close.show()
|
||||||
button.show()
|
|
||||||
|
|
||||||
self._share_button = ToolButton('stock-share-mesh')
|
self.share = ToolButton('stock-share-mesh')
|
||||||
self._share_button.connect('clicked', self._share_button_clicked_cb)
|
self.insert(self.share, -1)
|
||||||
self.insert(self._share_button, -1)
|
|
||||||
if activity.get_shared():
|
if activity.get_shared():
|
||||||
self._share_button.set_sensitive(False)
|
self.share.set_sensitive(False)
|
||||||
self._share_button.show()
|
self.share.show()
|
||||||
|
|
||||||
def _close_button_clicked_cb(self, button):
|
|
||||||
self.emit('close-clicked')
|
|
||||||
|
|
||||||
def _share_button_clicked_cb(self, button):
|
|
||||||
self.emit('share-clicked')
|
|
||||||
|
|
||||||
def _activity_shared_cb(self, activity):
|
def _activity_shared_cb(self, activity):
|
||||||
self._share_button.set_sensitive(False)
|
self.share.set_sensitive(False)
|
||||||
|
|
||||||
class EditToolbar(gtk.Toolbar):
|
class EditToolbar(gtk.Toolbar):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -216,8 +208,8 @@ class Activity(Window, gtk.Container):
|
|||||||
def set_toolbox(self, toolbox):
|
def set_toolbox(self, toolbox):
|
||||||
Window.set_toolbox(self, toolbox)
|
Window.set_toolbox(self, toolbox)
|
||||||
act_toolbar = toolbox.get_activity_toolbar()
|
act_toolbar = toolbox.get_activity_toolbar()
|
||||||
act_toolbar.connect('share-clicked', self._handle_share_cb)
|
act_toolbar.share.connect('clicked', self._handle_share_cb)
|
||||||
act_toolbar.connect('close-clicked', self._handle_close_cb)
|
act_toolbar.close.connect('clicked', self._handle_close_cb)
|
||||||
|
|
||||||
def get_bundle_path():
|
def get_bundle_path():
|
||||||
"""Return the bundle path for the current process' bundle
|
"""Return the bundle path for the current process' bundle
|
||||||
|
@ -62,6 +62,10 @@ class Link(DataStoreObject):
|
|||||||
def get_object_type(self):
|
def get_object_type(self):
|
||||||
return 'link'
|
return 'link'
|
||||||
|
|
||||||
|
class WebSession(DataStoreObject):
|
||||||
|
def get_object_type(self):
|
||||||
|
return 'web_session'
|
||||||
|
|
||||||
def _read_from_object_path(object_path):
|
def _read_from_object_path(object_path):
|
||||||
dbus_object = _bus.get_object(DS_DBUS_SERVICE, object_path)
|
dbus_object = _bus.get_object(DS_DBUS_SERVICE, object_path)
|
||||||
metadata = dbus_object.get_properties(dbus.Dictionary({}, signature='sv'))
|
metadata = dbus_object.get_properties(dbus.Dictionary({}, signature='sv'))
|
||||||
@ -80,6 +84,8 @@ def _read_from_object_path(object_path):
|
|||||||
return Picture(metadata, file_path, handle)
|
return Picture(metadata, file_path, handle)
|
||||||
elif object_type == 'link':
|
elif object_type == 'link':
|
||||||
return Link(metadata, file_path, handle)
|
return Link(metadata, file_path, handle)
|
||||||
|
elif object_type == 'web_session':
|
||||||
|
return WebSession(metadata, file_path, handle)
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError('Unknown object type.')
|
raise NotImplementedError('Unknown object type.')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user