#3063: Make the 'Keep' button in the activity toolbar create a copy of the activity in the journal. Add a copy() method for activities to use.

This commit is contained in:
Tomeu Vizoso 2007-08-31 15:43:38 +02:00
parent 3dc8505ec5
commit ad1818f985
2 changed files with 11 additions and 2 deletions

2
NEWS
View File

@ -1,3 +1,5 @@
* #3063: Make the 'Keep' button in the activity toolbar create a copy of the
activity in the journal. Add a copy() method for activities to use. (tomeu)
* #3045: Fix issues with the clipboard icons and palettes. (tomeu) * #3045: Fix issues with the clipboard icons and palettes. (tomeu)
* Get invites back to work in the UI. (marco) * Get invites back to work in the UI. (marco)
* Get the title on activity palette in the mesh to work. (marco) * Get the title on activity palette in the mesh to work. (marco)

View File

@ -123,7 +123,7 @@ class ActivityToolbar(gtk.Toolbar):
self._activity.share(private=True) self._activity.share(private=True)
def _keep_clicked_cb(self, button): def _keep_clicked_cb(self, button):
self._activity.save() self._activity.copy()
def _stop_clicked_cb(self, button): def _stop_clicked_cb(self, button):
self._activity.close() self._activity.close()
@ -305,7 +305,7 @@ class Activity(Window, gtk.Container):
elif scope == SHARE_NEIGHBORHOOD: elif scope == SHARE_NEIGHBORHOOD:
self.share(private=False) self.share(private=False)
else: else:
logging.debug("Unknown share scope %d" % scope) logging.debug("Unknown share scope %r" % scope)
except KeyError: except KeyError:
pass pass
elif create_jobject: elif create_jobject:
@ -455,6 +455,8 @@ class Activity(Window, gtk.Container):
def save(self): def save(self):
"""Request that the activity is saved to the Journal.""" """Request that the activity is saved to the Journal."""
logging.debug('Activity.save: %r' % self._jobject.object_id)
if self._updating_jobject: if self._updating_jobject:
return return
@ -483,6 +485,11 @@ class Activity(Window, gtk.Container):
reply_handler=self._internal_save_cb, reply_handler=self._internal_save_cb,
error_handler=self._internal_save_error_cb) error_handler=self._internal_save_error_cb)
def copy(self):
logging.debug('Activity.copy: %r' % self._jobject.object_id)
self.save()
self._jobject.object_id = None
def _internal_joined_cb(self, activity, success, err): def _internal_joined_cb(self, activity, success, err):
"""Callback when join has finished""" """Callback when join has finished"""
self._shared_activity.disconnect(self._join_id) self._shared_activity.disconnect(self._join_id)