diff options
author | Simon Schampijer <simon@schampijer.de> | 2011-09-19 18:41:22 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2011-09-20 06:09:47 (GMT) |
commit | 29ebe9ad1d8af765c25d046a29d2466af9f5fb7b (patch) | |
tree | 33c2f99f5517b9f8bde01bd6cc57154bbb59d0c9 | |
parent | f08a494c61ae8946a7e97ee959058a7979faeb81 (diff) |
FileTransfer: handle cancellation cleanly, OLPC #11065
When a file transfer has been canceled (the sender quits
before the receiver transferred it) we show a cancellation
message and the option to dismiss the transfer status
palette.
The behavior for a cancellation by the sender is a bit
different in telepathy as noted in [1]. You do only
get the cancellation message and the option to dismiss
the transfer status palette once you accepted the
transfer. The same behavior is true in Empathy.
The cancellation message is the same as in Empathy.
The resume functionality has never been offered by
telepathy.
[1] https://bugs.freedesktop.org/show_bug.cgi?id=20621
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
-rw-r--r-- | src/jarabe/frame/activitiestray.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/jarabe/frame/activitiestray.py b/src/jarabe/frame/activitiestray.py index 1c1205a..a1d13c9 100644 --- a/src/jarabe/frame/activitiestray.py +++ b/src/jarabe/frame/activitiestray.py @@ -630,12 +630,16 @@ class IncomingTransferPalette(BaseTransferPalette): for item in self.menu.get_children(): self.menu.remove(item) - menu_item = MenuItem(_('Resume'), icon_name='dialog-cancel') - menu_item.connect('activate', self.__resume_activate_cb) - self.menu.append(menu_item) - menu_item.show() - - self.update_progress() + if self.file_transfer.reason_last_change == \ + filetransfer.FT_REASON_REMOTE_STOPPED: + menu_item = MenuItem(_('Dismiss'), icon_name='dialog-cancel') + menu_item.connect('activate', self.__dismiss_activate_cb) + self.menu.append(menu_item) + menu_item.show() + text = _('The other participant canceled the file transfer') + label = gtk.Label(text) + self.set_content(label) + label.show() def __accept_activate_cb(self, menu_item): #TODO: figure out the best place to get rid of that temp file @@ -662,9 +666,6 @@ class IncomingTransferPalette(BaseTransferPalette): def __cancel_activate_cb(self, menu_item): self.file_transfer.cancel() - def __resume_activate_cb(self, menu_item): - self.file_transfer.resume() - def __dismiss_activate_cb(self, menu_item): self.emit('dismiss-clicked') |