diff options
author | Walter Bender <walter@sugarlabs.org> | 2014-06-26 19:32:21 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2014-06-26 19:32:21 (GMT) |
commit | 8aa5055f0ce7a48b140b7cfdfa80b6b745ee9934 (patch) | |
tree | 3eede256e4bc92345fd546521cf3d5135ba0d383 | |
parent | a185ed3a9672ced19329ff03d82c924316458ddc (diff) |
better handling of join
-rw-r--r-- | GNUChessActivity.py | 24 | ||||
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | activity/activity.info | 2 |
3 files changed, 30 insertions, 2 deletions
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 <lionaneesh@gmail.com> @@ -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) @@ -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 |