r6965 - bigboard/trunk/bigboard
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r6965 - bigboard/trunk/bigboard
- Date: Tue, 4 Dec 2007 17:47:46 -0600 (CST)
Author: hp
Date: 2007-12-04 17:47:46 -0600 (Tue, 04 Dec 2007)
New Revision: 6965
Modified:
bigboard/trunk/bigboard/people_tracker.py
Log:
use fallbackUserPhotoUrl if we lack an icon, so we never get the empty box
Modified: bigboard/trunk/bigboard/people_tracker.py
===================================================================
--- bigboard/trunk/bigboard/people_tracker.py 2007-12-04 23:47:15 UTC (rev 6964)
+++ bigboard/trunk/bigboard/people_tracker.py 2007-12-04 23:47:46 UTC (rev 6965)
@@ -42,6 +42,8 @@
# self._debug_rank = -100
+ self.icon_url = None
+
if self.is_contact:
self.resource.connect(self.__contact_name_changed, "name")
self.resource.connect(self.__contact_aims_changed, "aims")
@@ -52,7 +54,6 @@
self.resource.connect(self.__contact_user_changed, "user")
self.local_buddy = None
- self.icon_url = None
self.__contact_user_changed(resource)
self.__contact_name_changed(resource)
@@ -190,6 +191,19 @@
self.local_buddy = new_buddy
self.emit("local-buddy-changed")
+ def __set_icon_url(self, new_icon_url):
+ if not new_icon_url:
+ try:
+ new_icon_url = self.resource.model.global_resource.fallbackUserPhotoUrl
+ except AttributeError:
+ pass
+
+ _logger.debug("photo url now %s" % str(new_icon_url))
+
+ if new_icon_url != self.icon_url:
+ self.icon_url = new_icon_url
+ self.emit("icon-url-changed")
+
def __user_photo_url_changed(self, user_resource):
new_icon_url = None
if user_resource:
@@ -197,12 +211,8 @@
new_icon_url = user_resource.photoUrl
except AttributeError:
pass
-
- _logger.debug("user photo url now %s" % str(new_icon_url))
- if new_icon_url != self.icon_url:
- self.icon_url = new_icon_url
- self.emit("icon-url-changed")
+ self.__set_icon_url(new_icon_url)
def __buddy_alias_changed(self, resource):
try:
@@ -216,12 +226,14 @@
self.emit("display-name-changed")
def __buddy_icon_changed(self, resource):
+ new_icon_url = None
try:
- self.icon_url = resource.icon
+ new_icon_url = resource.icon
except AttributeError:
- self.icon_url = None
- self.emit("icon-url-changed")
+ pass
+ self.__set_icon_url(new_icon_url)
+
def __hash__(self):
return hash(self.resource)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]