Merge branch 'master' of ssh+git://dev.laptop.org/git/sugar
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
import dbus
|
||||
import os
|
||||
from ConfigParser import ConfigParser
|
||||
|
||||
@@ -86,3 +87,28 @@ class Friends(gobject.GObject):
|
||||
fileobject = open(self._path, 'w')
|
||||
cp.write(fileobject)
|
||||
fileobject.close()
|
||||
|
||||
self._sync_friends()
|
||||
|
||||
def _sync_friends(self):
|
||||
# XXX: temporary hack
|
||||
# remove this when the shell service has a D-Bus API for buddies
|
||||
|
||||
def friends_synced():
|
||||
pass
|
||||
|
||||
def friends_synced_error(e):
|
||||
logging.error("Error asking presence service to sync friends: %s"
|
||||
% e)
|
||||
|
||||
keys = []
|
||||
for friend in self:
|
||||
keys.append(friend.get_key())
|
||||
|
||||
bus = dbus.SessionBus()
|
||||
ps = bus.get_object('org.laptop.Sugar.Presence',
|
||||
'/org/laptop/Sugar/Presence')
|
||||
psi = dbus.Interface(ps, 'org.laptop.Sugar.Presence')
|
||||
psi.SyncFriends(keys,
|
||||
reply_handler=friends_synced,
|
||||
error_handler=friends_synced_error)
|
||||
|
||||
+11
-2
@@ -20,6 +20,7 @@ import logging
|
||||
import tempfile
|
||||
import os
|
||||
import time
|
||||
import shutil
|
||||
|
||||
import gobject
|
||||
import gtk
|
||||
@@ -80,8 +81,16 @@ class Shell(gobject.GObject):
|
||||
|
||||
def _start_journal_idle(self):
|
||||
# Mount the datastore in internal flash
|
||||
datastore.mount(env.get_profile_path('datastore'), [],
|
||||
timeout=120 * DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND)
|
||||
ds_path = env.get_profile_path('datastore')
|
||||
try:
|
||||
datastore.mount(ds_path, [], timeout=120 * \
|
||||
DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND)
|
||||
except:
|
||||
# Don't explode if there's corruption; move the data out of the way
|
||||
# and attempt to create a store from scratch.
|
||||
shutil.move(ds_path, os.path.abspath(ds_path) + str(time.time()))
|
||||
datastore.mount(ds_path, [], timeout=120 * \
|
||||
DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND)
|
||||
|
||||
# Checking for the bundle existence will also ensure
|
||||
# that the shell service is started up.
|
||||
|
||||
@@ -129,7 +129,7 @@ class ActivitiesTray(hippo.CanvasBox):
|
||||
|
||||
def _activity_removed_cb(self, activity_registry, activity_info):
|
||||
for item in self._tray.get_children():
|
||||
if item.get_bundle_id() == activity_info.service_name:
|
||||
if item.get_bundle_id() == activity_info.bundle_id:
|
||||
self._tray.remove_item(item)
|
||||
return
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ class AccessPointView(PulsingIcon):
|
||||
# Update badge
|
||||
caps = model.props.capabilities
|
||||
if model.get_nm_network().is_favorite():
|
||||
self.props.badge_name = "emblem-star"
|
||||
self.props.badge_name = "emblem-favorite"
|
||||
elif (caps & NM_802_11_CAP_PROTO_WEP) or (caps & NM_802_11_CAP_PROTO_WPA) or (caps & NM_802_11_CAP_PROTO_WPA2):
|
||||
self.props.badge_name = "emblem-locked"
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ def html_to_rgb(html_color):
|
||||
return (r, g, b)
|
||||
|
||||
class ActivityIcon(CanvasIcon):
|
||||
_INTERVAL = 100
|
||||
_INTERVAL = 200
|
||||
|
||||
__gsignals__ = {
|
||||
'resume': (gobject.SIGNAL_RUN_FIRST,
|
||||
|
||||
Reference in New Issue
Block a user