revert queue

This commit is contained in:
Marcos Pinto 2007-11-10 19:57:51 +00:00
parent 56e8db547c
commit 812eeb024e
4 changed files with 566 additions and 603 deletions

File diff suppressed because it is too large Load Diff

View File

@ -505,7 +505,6 @@ class Manager:
# but having self.is_user_paused(unique_ID) == False is
# also considered active.
active_torrent_cnt = 0
seed_torrent_cnt = 0
# Pause and resume torrents
for torrent in self.state.queue:
@ -517,23 +516,17 @@ class Manager:
if not torrent_state['is_paused'] or \
(torrent_state['is_paused'] and not \
self.is_user_paused(unique_ID)) and not torrent_state['is_seed']:
self.is_user_paused(unique_ID)):
active_torrent_cnt += 1
if not torrent_state['is_paused'] and torrent_state['is_seed'] and not self.is_user_paused(unique_ID):
seed_torrent_cnt += 1
if (torrent_state['is_paused'] and not \
self.is_user_paused(unique_ID)) and (seed_torrent_cnt <= self.get_pref('max_seeding_torrents')) or (self.get_pref('max_seeding_torrents') == -1):
self.resume(unique_ID)
if not torrent_state['is_paused'] and (seed_torrent_cnt > self.get_pref('max_seeding_torrents')) and (self.get_pref('max_seeding_torrents') != -1):
self.pause(unique_ID)
if (active_torrent_cnt <= self.get_pref('max_active_torrents') or \
self.get_pref('max_active_torrents') == -1) and \
torrent_state['is_paused'] and not \
self.is_user_paused(unique_ID) and not torrent_state['is_seed']:
self.is_user_paused(unique_ID):
# This torrent is a seed so skip all the free space checking
if torrent_state['is_seed']:
self.resume(unique_ID)
continue
# Before we resume, we should check if the torrent is using Full Allocation
# and if there is enough space on to finish this file.
@ -554,11 +547,10 @@ of HD space! Oops!\nWe had to pause at least one torrent"))
print "Not enough free space to resume this torrent!"
else: #We're using compact allocation so lets just resume
self.resume(unique_ID)
elif not torrent_state['is_paused'] and \
((active_torrent_cnt > self.get_pref('max_active_torrents') and \
self.get_pref('max_active_torrents') != -1) or \
self.is_user_paused(unique_ID)) and not torrent_state['is_seed']:
self.is_user_paused(unique_ID)):
self.pause(unique_ID)
# Handle autoseeding - downqueue as needed
@ -582,7 +574,6 @@ of HD space! Oops!\nWe had to pause at least one torrent"))
if ratio >= self.get_pref('auto_seed_ratio'):
self.removed_unique_ids[unique_ID] = 1
self.remove_torrent(unique_ID, False, True)
# Event handling
def connect_event(self, event_type, callback):

View File

@ -144,7 +144,6 @@ class PreferencesDlg:
self.glade.get_widget("spin_web_proxy_port").set_value(self.preferences.get("web_proxy_port"))
self.glade.get_widget("spin_max_half_open").set_value(float(self.preferences.get("max_half_open")))
self.glade.get_widget("spin_torrents").set_value(float(self.preferences.get("max_active_torrents")))
self.glade.get_widget("spin_seed").set_value(float(self.preferences.get("max_seeding_torrents")))
self.glade.get_widget("chk_seedbottom").set_active(self.preferences.get("queue_seeds_to_bottom"))
self.glade.get_widget("chk_queue_above_completed").set_sensitive(self.preferences.get("queue_seeds_to_bottom"))
self.glade.get_widget("chk_queue_above_completed").set_active(self.preferences.get("queue_above_completed"))
@ -266,7 +265,6 @@ class PreferencesDlg:
self.preferences.set("max_connections_per_torrent", int(self.glade.get_widget("spin_max_connections_per_torrent").get_value()))
self.preferences.set("max_half_open", int(self.glade.get_widget("spin_max_half_open").get_value()))
self.preferences.set("max_active_torrents", int(self.glade.get_widget("spin_torrents").get_value()))
self.preferences.set("max_seeding_torrents", int(self.glade.get_widget("spin_seed").get_value()))
self.preferences.set("queue_seeds_to_bottom", self.glade.get_widget("chk_seedbottom").get_active())
self.preferences.set("enable_dht", self.glade.get_widget("chk_dht").get_active())
self.preferences.set("gui_update_interval", self.glade.get_widget("spin_gui").get_value())

View File

@ -70,7 +70,6 @@ if common.windows_check():
"lock_tray" : False,
"max_half_open" : 8,
"max_active_torrents" : 8,
"max_seeding_torrents" : 8,
"max_connections_global" : 200,
"max_connections_per_torrent" : -1,
"max_download_speed" : -1,
@ -181,7 +180,6 @@ else:
"lock_tray" : False,
"max_half_open" : 8,
"max_active_torrents" : 8,
"max_seeding_torrents" : 8,
"max_connections_global" : 200,
"max_connections_per_torrent" : -1,
"max_download_speed" : -1,