Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-12-20 18:25:34 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-12-20 18:25:34 (GMT)
commit2a48021a782a1ea3677883aaf1cafdd259246691 (patch)
tree80a45a97d658a66253117671ee95d4fa15b4f97c /shell
parent64a91b8590db8ae2d4a04e6ec0a208a9e5b75cd2 (diff)
parent807044c84bc42194b280a3d61d2733921455866b (diff)
Merge branch 'master' of ssh+git://dev.laptop.org/git/sugar
Diffstat (limited to 'shell')
-rw-r--r--shell/model/Friends.py26
-rw-r--r--shell/view/Shell.py13
-rw-r--r--shell/view/frame/activitiestray.py2
-rw-r--r--shell/view/home/MeshBox.py2
-rwxr-xr-xshell/view/home/activitiesdonut.py2
5 files changed, 40 insertions, 5 deletions
diff --git a/shell/model/Friends.py b/shell/model/Friends.py
index 2b7d6bf..6fc3e97 100644
--- a/shell/model/Friends.py
+++ b/shell/model/Friends.py
@@ -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)
diff --git a/shell/view/Shell.py b/shell/view/Shell.py
index b9d259f..72aa3b1 100644
--- a/shell/view/Shell.py
+++ b/shell/view/Shell.py
@@ -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.
diff --git a/shell/view/frame/activitiestray.py b/shell/view/frame/activitiestray.py
index 6f8e89e..3dbf955 100644
--- a/shell/view/frame/activitiestray.py
+++ b/shell/view/frame/activitiestray.py
@@ -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
diff --git a/shell/view/home/MeshBox.py b/shell/view/home/MeshBox.py
index ee8599c..a13aeba 100644
--- a/shell/view/home/MeshBox.py
+++ b/shell/view/home/MeshBox.py
@@ -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"
diff --git a/shell/view/home/activitiesdonut.py b/shell/view/home/activitiesdonut.py
index ebdf8be..8e09006 100755
--- a/shell/view/home/activitiesdonut.py
+++ b/shell/view/home/activitiesdonut.py
@@ -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,