Tue, 22 Jul 2008 15:01:42 -0400 <me@nikosapi.org>
Merge patch to close bug #152 (Deleting a channel does not cancel episodes downloading from that channel) * src/gpodder/gui.py: make on_itemRemoveChannel_activate() cancel any active downloads from the channel being deleted * src/gpodder/services.py: fix some weird indentation git-svn-id: svn://svn.berlios.de/gpodder/trunk@786 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
parent
75d5b1aa8b
commit
645da96c8b
|
@ -1,3 +1,11 @@
|
|||
Tue, 22 Jul 2008 15:01:42 -0400 <me@nikosapi.org>
|
||||
Merge patch to close bug #152 (Deleting a channel does not cancel episodes
|
||||
downloading from that channel)
|
||||
|
||||
* src/gpodder/gui.py: make on_itemRemoveChannel_activate() cancel
|
||||
any active downloads from the channel being deleted
|
||||
* src/gpodder/services.py: fix some weird indentation
|
||||
|
||||
Mon, 21 Jul 2008 23:34:47 +0200 <thp@perli.net>
|
||||
Updated French translation
|
||||
|
||||
|
|
|
@ -1916,6 +1916,11 @@ class gPodder(GladeWidget):
|
|||
# only delete partial files if we do not have any downloads in progress
|
||||
delete_partial = not services.download_status_manager.has_items()
|
||||
gl.clean_up_downloads(delete_partial)
|
||||
|
||||
# cancel any active downloads from this channel
|
||||
if not delete_partial:
|
||||
for episode in self.active_channel.get_all_episodes():
|
||||
services.download_status_manager.cancel_by_url(episode.link)
|
||||
|
||||
# get the URL of the podcast we want to select next
|
||||
position = self.channels.index(self.active_channel)
|
||||
|
|
|
@ -398,19 +398,19 @@ class DownloadStatusManager(ObservableService):
|
|||
|
||||
def cancel_all( self):
|
||||
for element in self.status_list:
|
||||
self.status_list[element]['iter'] = None
|
||||
self.status_list[element]['thread'].cancel()
|
||||
self.status_list[element]['iter'] = None
|
||||
self.status_list[element]['thread'].cancel()
|
||||
# clear the tree model after cancelling
|
||||
util.idle_add(self.tree_model.clear)
|
||||
self.downloads_done_bytes = 0
|
||||
|
||||
def cancel_by_url( self, url):
|
||||
for element in self.status_list:
|
||||
thread = self.status_list[element]['thread']
|
||||
if thread is not None and thread.url == url:
|
||||
thread = self.status_list[element]['thread']
|
||||
if thread is not None and thread.url == url:
|
||||
self.remove_download_id( element)
|
||||
return True
|
||||
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue