Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/extra/collaborationplugin.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-02-13 01:14:40 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-02-13 01:14:40 (GMT)
commit7148d5ae0635fcf936e5f6b565c37da048900352 (patch)
treee824428def7c20df7d7de0b8810aadc9168a5cb2 /extra/collaborationplugin.py
parentb0ef86c1a09e8cb4cffe4138fabf122319b063f0 (diff)
Set turtle to share colors
Diffstat (limited to 'extra/collaborationplugin.py')
-rw-r--r--extra/collaborationplugin.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/extra/collaborationplugin.py b/extra/collaborationplugin.py
index 6378cd4..28ff700 100644
--- a/extra/collaborationplugin.py
+++ b/extra/collaborationplugin.py
@@ -39,6 +39,7 @@ from collaboration import telepathyclient
from collaboration.tubeconn import TubeConnection
import traceback
from TurtleArt.tacollaboration import Collaboration
+from TurtleArt.taconstants import DEFAULT_TURTLE_COLORS
CONNECTION_INTERFACE_ACTIVITY_PROPERTIES = \
'org.laptop.Telepathy.ActivityProperties'
@@ -144,8 +145,6 @@ class CollaborationPlugin(Plugin):
if self._neighborhood is not None:
return
- print "_connect_to_neighborhood has been called"
-
params = {}
params["nickname"] = self._collaboration_config_values.get("nick")
params["account_id"] = self._collaboration_config_values.get(
@@ -160,10 +159,20 @@ class CollaborationPlugin(Plugin):
self._nick = self._collaboration_config_values.get("nick")
self._colors = self._collaboration_config_values.get("colors")
+ # Reskin turtle with collaboration colors
+ default_turtle = self._activity.tw.turtles.get_turtle(
+ self._activity.tw.default_turtle_name)
+ try:
+ default_turtle.colors = self._colors.split(',')
+ except:
+ default_turtle.colors = DEFAULT_TURTLE_COLORS
+ default_turtle.custom_shapes = True # Force regeneration of shapes
+ default_turtle.reset_shapes()
+ default_turtle.show()
+
self._activities = {}
self._buddies = {}
- print "connecting to the neighborhood"
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
self._client_handler = telepathyclient.get_instance()
@@ -299,7 +308,7 @@ class CollaborationPlugin(Plugin):
properties['id'] = self._get_activity_id()
properties['type'] = self._get_bundle_id()
properties['name'] = self._get_title()
- properties['color'] = self._get_colors()
+ properties['color'] = self.get_colors()
properties['private'] = False
connection_manager = get_connection_manager()