add torrent in paused state option
This commit is contained in:
parent
f7a1db3be7
commit
edfd988cf9
|
@ -3,7 +3,7 @@ Deluge 0.5.7 (xx November 2007)
|
||||||
* Blocklist plugin will now display errors, instead of just crashing on a bad
|
* Blocklist plugin will now display errors, instead of just crashing on a bad
|
||||||
list or wrong type
|
list or wrong type
|
||||||
* Local discovery of peers
|
* Local discovery of peers
|
||||||
* Add advanced progress bar option - adapted from Arnab Bose
|
* Add torrent in paused state option
|
||||||
* Fix ratio bugs (hopefully for the last time)
|
* Fix ratio bugs (hopefully for the last time)
|
||||||
* Scheduler plugin revamp by Ben Klein
|
* Scheduler plugin revamp by Ben Klein
|
||||||
* Fix ETA from going backwards
|
* Fix ETA from going backwards
|
||||||
|
|
1
TODO
1
TODO
|
@ -1,4 +1,3 @@
|
||||||
for 0.5.7
|
for 0.5.7
|
||||||
* remap filenames
|
* remap filenames
|
||||||
* preference for starting torrents in paused state
|
|
||||||
* copy over active torrents when user changes location of torrent files
|
* copy over active torrents when user changes location of torrent files
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
12
src/core.py
12
src/core.py
|
@ -157,11 +157,11 @@ class cached_data:
|
||||||
# Persistent information for a single torrent
|
# Persistent information for a single torrent
|
||||||
|
|
||||||
class torrent_info:
|
class torrent_info:
|
||||||
def __init__(self, filename, save_dir, compact):
|
def __init__(self, filename, save_dir, compact, user_paused=False):
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
self.save_dir = save_dir
|
self.save_dir = save_dir
|
||||||
self.compact = compact
|
self.compact = compact
|
||||||
self.user_paused = False
|
self.user_paused = user_paused
|
||||||
self.uploaded_memory = 0
|
self.uploaded_memory = 0
|
||||||
self.initial_uploaded_memory = 0
|
self.initial_uploaded_memory = 0
|
||||||
self.upload_rate_limit = 0
|
self.upload_rate_limit = 0
|
||||||
|
@ -352,8 +352,8 @@ class Manager:
|
||||||
|
|
||||||
# Torrent addition and removal functions
|
# Torrent addition and removal functions
|
||||||
|
|
||||||
def add_torrent(self, filename, save_dir, compact):
|
def add_torrent(self, filename, save_dir, compact, user_paused=False):
|
||||||
self.add_torrent_ns(filename, save_dir, compact)
|
self.add_torrent_ns(filename, save_dir, compact, user_paused)
|
||||||
return self.sync() # Syncing will create a new torrent in the core, and return it's ID
|
return self.sync() # Syncing will create a new torrent in the core, and return it's ID
|
||||||
|
|
||||||
# When duplicate torrent error, use to find duplicate when merging tracker lists
|
# When duplicate torrent error, use to find duplicate when merging tracker lists
|
||||||
|
@ -791,7 +791,7 @@ of HD space! Oops!\nWe had to pause at least one torrent"))
|
||||||
|
|
||||||
# Non-syncing functions. Used when we loop over such events, and sync manually at the end
|
# Non-syncing functions. Used when we loop over such events, and sync manually at the end
|
||||||
|
|
||||||
def add_torrent_ns(self, filename, save_dir, compact):
|
def add_torrent_ns(self, filename, save_dir, compact, user_paused):
|
||||||
# Cache torrent file
|
# Cache torrent file
|
||||||
(temp, filename_short) = os.path.split(filename)
|
(temp, filename_short) = os.path.split(filename)
|
||||||
|
|
||||||
|
@ -809,7 +809,7 @@ of HD space! Oops!\nWe had to pause at least one torrent"))
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# Create torrent object
|
# Create torrent object
|
||||||
new_torrent = torrent_info(full_new_name, save_dir, compact)
|
new_torrent = torrent_info(full_new_name, save_dir, compact, user_paused)
|
||||||
self.state.torrents[new_torrent] = None
|
self.state.torrents[new_torrent] = None
|
||||||
|
|
||||||
def remove_torrent_ns(self, unique_ID, data_also):
|
def remove_torrent_ns(self, unique_ID, data_also):
|
||||||
|
|
|
@ -150,6 +150,7 @@ class PreferencesDlg:
|
||||||
self.glade.get_widget("chk_autoseed").set_active(self.preferences.get("auto_end_seeding"))
|
self.glade.get_widget("chk_autoseed").set_active(self.preferences.get("auto_end_seeding"))
|
||||||
self.glade.get_widget("chk_clear_max_ratio_torrents").set_sensitive(self.preferences.get("auto_end_seeding"))
|
self.glade.get_widget("chk_clear_max_ratio_torrents").set_sensitive(self.preferences.get("auto_end_seeding"))
|
||||||
self.glade.get_widget("chk_clear_max_ratio_torrents").set_active(self.preferences.get("clear_max_ratio_torrents"))
|
self.glade.get_widget("chk_clear_max_ratio_torrents").set_active(self.preferences.get("clear_max_ratio_torrents"))
|
||||||
|
self.glade.get_widget("chk_paused").set_active(self.preferences.get("start_paused"))
|
||||||
self.glade.get_widget("ratio_spinner").set_value(self.preferences.get("auto_seed_ratio"))
|
self.glade.get_widget("ratio_spinner").set_value(self.preferences.get("auto_seed_ratio"))
|
||||||
self.glade.get_widget("chk_dht").set_active(self.preferences.get("enable_dht"))
|
self.glade.get_widget("chk_dht").set_active(self.preferences.get("enable_dht"))
|
||||||
self.glade.get_widget("spin_gui").set_value(self.preferences.get("gui_update_interval"))
|
self.glade.get_widget("spin_gui").set_value(self.preferences.get("gui_update_interval"))
|
||||||
|
@ -269,6 +270,7 @@ class PreferencesDlg:
|
||||||
self.preferences.set("gui_update_interval", self.glade.get_widget("spin_gui").get_value())
|
self.preferences.set("gui_update_interval", self.glade.get_widget("spin_gui").get_value())
|
||||||
self.preferences.set("clear_max_ratio_torrents", self.glade.get_widget("chk_clear_max_ratio_torrents").get_active())
|
self.preferences.set("clear_max_ratio_torrents", self.glade.get_widget("chk_clear_max_ratio_torrents").get_active())
|
||||||
self.preferences.set("queue_above_completed", self.glade.get_widget("chk_queue_above_completed").get_active())
|
self.preferences.set("queue_above_completed", self.glade.get_widget("chk_queue_above_completed").get_active())
|
||||||
|
self.preferences.set("start_paused", self.glade.get_widget("chk_paused").get_active())
|
||||||
|
|
||||||
interface.apply_prefs()
|
interface.apply_prefs()
|
||||||
interface.config.save()
|
interface.config.save()
|
||||||
|
|
|
@ -760,7 +760,8 @@ window, please enter your password"))
|
||||||
self.manager.remove_torrent(uid, False, False)
|
self.manager.remove_torrent(uid, False, False)
|
||||||
self.torrent_model_remove(uid)
|
self.torrent_model_remove(uid)
|
||||||
self.update()
|
self.update()
|
||||||
unique_ID = self.manager.add_torrent(save_info[0], save_info[1], self.config.get("use_compact_storage"))
|
unique_ID = self.manager.add_torrent(save_info[0], save_info[1], \
|
||||||
|
self.config.get("use_compact_storage"))
|
||||||
self.torrent_model_append(unique_ID)
|
self.torrent_model_append(unique_ID)
|
||||||
self.update()
|
self.update()
|
||||||
self.manager.prioritize_files(unique_ID, priorities, update_files_removed=False)
|
self.manager.prioritize_files(unique_ID, priorities, update_files_removed=False)
|
||||||
|
@ -1301,7 +1302,8 @@ window, please enter your password"))
|
||||||
files_dialog = dialogs.FilesDlg(dumped_torrent)
|
files_dialog = dialogs.FilesDlg(dumped_torrent)
|
||||||
if files_dialog.show(self.window) == 1:
|
if files_dialog.show(self.window) == 1:
|
||||||
unique_id = self.manager.add_torrent(torrent, path,
|
unique_id = self.manager.add_torrent(torrent, path,
|
||||||
self.config.get('use_compact_storage'))
|
self.config.get('use_compact_storage'), \
|
||||||
|
self.config.get('start_paused'))
|
||||||
self.manager.prioritize_files(unique_id,
|
self.manager.prioritize_files(unique_id,
|
||||||
files_dialog.get_priorities())
|
files_dialog.get_priorities())
|
||||||
if files_dialog.is_private_flag_checked():
|
if files_dialog.is_private_flag_checked():
|
||||||
|
@ -1310,7 +1312,8 @@ window, please enter your password"))
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
unique_id = self.manager.add_torrent(torrent, path,
|
unique_id = self.manager.add_torrent(torrent, path,
|
||||||
self.config.get('use_compact_storage'))
|
self.config.get('use_compact_storage'), \
|
||||||
|
self.config.get('start_paused'))
|
||||||
except core.InvalidEncodingError, e:
|
except core.InvalidEncodingError, e:
|
||||||
print "InvalidEncodingError", e
|
print "InvalidEncodingError", e
|
||||||
dialogs.show_popup_warning(self.window, _("An error occured while \
|
dialogs.show_popup_warning(self.window, _("An error occured while \
|
||||||
|
|
|
@ -146,7 +146,8 @@ if common.windows_check():
|
||||||
"status_width" : 150,
|
"status_width" : 150,
|
||||||
"filename_f_width" : 220,
|
"filename_f_width" : 220,
|
||||||
"size_f_width" : 90,
|
"size_f_width" : 90,
|
||||||
"priority_f_width" : 140
|
"priority_f_width" : 140,
|
||||||
|
"start_paused": False
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
DEFAULT_PREFS = {
|
DEFAULT_PREFS = {
|
||||||
|
@ -255,7 +256,8 @@ else:
|
||||||
"status_width" : 150,
|
"status_width" : 150,
|
||||||
"filename_f_width" : 220,
|
"filename_f_width" : 220,
|
||||||
"size_f_width" : 90,
|
"size_f_width" : 90,
|
||||||
"priority_f_width" : 140
|
"priority_f_width" : 140,
|
||||||
|
"start_paused": False
|
||||||
}
|
}
|
||||||
|
|
||||||
class Preferences:
|
class Preferences:
|
||||||
|
|
Loading…
Reference in New Issue