From 8aa5055f0ce7a48b140b7cfdfa80b6b745ee9934 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 26 Jun 2014 19:32:21 +0000 Subject: better handling of join --- diff --git a/GNUChessActivity.py b/GNUChessActivity.py index a56b957..e0bc23e 100644 --- a/GNUChessActivity.py +++ b/GNUChessActivity.py @@ -1,4 +1,4 @@ -#Copyright (c) 2012 Walter Bender +#Copyright (c) 2012-14 Walter Bender #Copyright (c) 2012 Ignacio Rodriguez #Copyright (c) 2012 Aneesh Dogra @@ -96,7 +96,26 @@ class GNUChessActivity(activity.Activity): parent=self, path=activity.get_bundle_path(), colors=self.colors) + + + 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 = NotifyAlert() + self._joined_alert.props.icon = share_icon + self._joined_alert.props.title = _('Please wait') + self._joined_alert.props.msg = _('Starting connection...') + self._joined_alert.connect('response', self._alert_cancel_cb) + self.add_alert(self._joined_alert) + + # Wait for joined signal + self.connect("joined", self._joined_cb) + self._setup_presence_service() + self.stopwatch_running = False self.time_interval = None @@ -106,6 +125,9 @@ class GNUChessActivity(activity.Activity): self._gnuchess.new_game() self._restoring = False + def _alert_cancel_cb(self, alert, response_id): + self.remove_alert(alert) + def restore_cursor(self): ''' No longer thinking, so restore standard cursor. ''' self.get_window().set_cursor(self.old_cursor) diff --git a/NEWS b/NEWS index e653500..da6b765 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +14 + +ENHANCEMENT: +* New translations +* Better handling of activity joining behavior + 12 ENHANCEMENT: diff --git a/activity/activity.info b/activity/activity.info index de5f62f..c718ed7 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,6 +1,6 @@ [Activity] name = SimpleGNUChess -activity_version = 13 +activity_version = 14 license = GPLv3 bundle_id = org.sugarlabs.GNUChessActivity exec = sugar-activity GNUChessActivity.GNUChessActivity -- cgit v0.9.1