Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/view
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2008-06-06 18:14:03 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2008-06-06 18:14:03 (GMT)
commit9f8a610c895d483687b492b44ca91a219ae64c47 (patch)
treebc4c44ded41b2c095f459612b166035940a63171 /src/view
parenta60f4216077d3940c74671df6fa1b3dd8be47f5d (diff)
parentffa985d36343d9c67e73518060f2c485c46ca0de (diff)
Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
Diffstat (limited to 'src/view')
-rw-r--r--src/view/frame/devicestray.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/view/frame/devicestray.py b/src/view/frame/devicestray.py
index 1accdad..7e6e797 100644
--- a/src/view/frame/devicestray.py
+++ b/src/view/frame/devicestray.py
@@ -14,11 +14,15 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+import logging
+
from sugar.graphics.tray import HTray
from view.devices import deviceview
from model import shellmodel
+_logger = logging.getLogger('DevicesTray')
+
class DevicesTray(HTray):
def __init__(self):
HTray.__init__(self)
@@ -35,11 +39,15 @@ class DevicesTray(HTray):
self.__device_disappeared_cb)
def _add_device(self, device):
- view = deviceview.create(device)
- # TODO: *Tray classes don't allow yet to set the alignment.
- self.add_item(view)
- view.show()
- self._device_icons[device.get_id()] = view
+ try:
+ view = deviceview.create(device)
+ # TODO: *Tray classes don't allow yet to set the alignment.
+ self.add_item(view)
+ view.show()
+ self._device_icons[device.get_id()] = view
+ except Exception, message:
+ _logger.warn("Not able to add icon for device [%r], because of "
+ "an error (%s). Continuing." % (device, message))
def _remove_device(self, device):
self.remove_item(self._device_icons[device.get_id()])