Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArtActivity.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2013-10-09 20:45:06 (GMT)
committer Walter Bender <walter@sugarlabs.org>2013-10-09 20:45:06 (GMT)
commit94a6463ebfcde20c11df2e2e8f132a72f64a16df (patch)
tree11d7c053112f3618a58be0b46ebb378722029492 /TurtleArtActivity.py
parent8f9904fac6b0da4cc37525582c836936034d3a0e (diff)
add alert when connecting to shared instance
Diffstat (limited to 'TurtleArtActivity.py')
-rw-r--r--TurtleArtActivity.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py
index 078377b..7019a2b 100644
--- a/TurtleArtActivity.py
+++ b/TurtleArtActivity.py
@@ -41,8 +41,10 @@ except ImportError:
HAS_TOOLBARBOX = False
from sugar.graphics.toolbutton import ToolButton
from sugar.graphics.radiotoolbutton import RadioToolButton
-from sugar.graphics.alert import (ConfirmationAlert, NotifyAlert)
+from sugar.graphics.alert import (ConfirmationAlert, NotifyAlert, Alert)
from sugar.graphics import style
+from sugar.graphics.icon import Icon
+from sugar.graphics.xocolor import XoColor
from sugar.datastore import datastore
from sugar import profile
@@ -114,6 +116,21 @@ class TurtleArtActivity(activity.Activity):
self._setup_extra_controls()
_logger.debug('_setup_sharing')
+ if self.shared_activity:
+ # We're joining
+ if not self.get_shared():
+ xocolors = XoColor(profile.get_color().to_string())
+ share_icon = Icon(icon_name='zoom-neighborhood',
+ xo_color=xocolors)
+ self._joined_alert = Alert()
+ self._joined_alert.props.icon = share_icon
+ self._joined_alert.props.title = _('Please wait')
+ self._joined_alert.props.msg = _('Starting connection...')
+ self.add_alert(self._joined_alert)
+
+ # Wait for joined signal
+ self.connect("joined", self._joined_cb)
+
self._setup_sharing()
# Activity count is the number of times this instance has been
@@ -1186,6 +1203,12 @@ class TurtleArtActivity(activity.Activity):
self._collaboration = Collaboration(self.tw, self)
self._collaboration.setup()
+ def _joined_cb(self, widget):
+ if self._joined_alert is not None:
+ self.remove_alert(self._joined_alert)
+ self._joined_alert = None
+ self.set_canvas(self.fixed)
+
def send_xy(self):
''' Resync xy position (and orientation) of my turtle. '''
self._collaboration.send_my_xy()