mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
fix pausing of checking torrents
This commit is contained in:
parent
cb64ecb282
commit
ee4d054582
4 changed files with 24 additions and 22 deletions
|
@ -2892,3 +2892,4 @@ information is sent.</property>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
</glade-interface>
|
</glade-interface>
|
||||||
|
|
||||||
|
|
34
src/core.py
34
src/core.py
|
@ -407,21 +407,18 @@ class Manager:
|
||||||
# A separate function, because people may want to call it from time to time
|
# A separate function, because people may want to call it from time to time
|
||||||
def save_fastresume_data(self, uid=None):
|
def save_fastresume_data(self, uid=None):
|
||||||
if uid == None:
|
if uid == None:
|
||||||
for unique_ID in self.unique_IDs:
|
try:
|
||||||
try:
|
for unique_ID in self.unique_IDs:
|
||||||
os.remove(self.unique_IDs[unique_ID].filename + ".fastresume")
|
os.remove(self.unique_IDs[unique_ID].filename + ".fastresume")
|
||||||
except:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
deluge_core.save_fastresume(unique_ID, self.unique_IDs[unique_ID].filename)
|
deluge_core.save_fastresume(unique_ID, self.unique_IDs[unique_ID].filename)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
os.remove(self.unique_IDs[uid].filename + ".fastresume")
|
os.remove(self.unique_IDs[uid].filename + ".fastresume")
|
||||||
|
deluge_core.save_fastresume(uid, self.unique_IDs[uid].filename)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
deluge_core.save_fastresume(uid, self.unique_IDs[uid].filename)
|
|
||||||
|
|
||||||
# State retrieval functions
|
# State retrieval functions
|
||||||
|
|
||||||
|
@ -742,10 +739,13 @@ Space:") + " " + nice_free)
|
||||||
self.config.set("max_active_torrents", \
|
self.config.set("max_active_torrents", \
|
||||||
self.config.get("max_active_torrents_tmp"))
|
self.config.get("max_active_torrents_tmp"))
|
||||||
self.apply_prefs()
|
self.apply_prefs()
|
||||||
self.unique_IDs[unique_ID].user_paused = new_value
|
try:
|
||||||
if enforce_queue:
|
self.unique_IDs[unique_ID].user_paused = new_value
|
||||||
self.apply_queue()
|
if enforce_queue:
|
||||||
self.pickle_state()
|
self.apply_queue()
|
||||||
|
self.pickle_state()
|
||||||
|
except:
|
||||||
|
print "pause failed\n"
|
||||||
|
|
||||||
def set_ratio(self, unique_ID, num):
|
def set_ratio(self, unique_ID, num):
|
||||||
deluge_core.set_ratio(unique_ID, float(num))
|
deluge_core.set_ratio(unique_ID, float(num))
|
||||||
|
@ -766,12 +766,12 @@ Space:") + " " + nice_free)
|
||||||
deluge_core.scrape_tracker(unique_ID)
|
deluge_core.scrape_tracker(unique_ID)
|
||||||
|
|
||||||
def pause(self, unique_ID):
|
def pause(self, unique_ID):
|
||||||
state = self.get_torrent_state(unique_ID)
|
try:
|
||||||
if not state["is_paused"]:
|
state = self.get_torrent_state(unique_ID)
|
||||||
try:
|
if not state["is_paused"]:
|
||||||
deluge_core.pause(unique_ID)
|
deluge_core.pause(unique_ID)
|
||||||
except:
|
except:
|
||||||
print "pause failed\n"
|
print "pause failed\n"
|
||||||
|
|
||||||
def resume(self, unique_ID):
|
def resume(self, unique_ID):
|
||||||
state = self.get_torrent_state(unique_ID)
|
state = self.get_torrent_state(unique_ID)
|
||||||
|
|
|
@ -830,17 +830,15 @@ window, please enter your password"))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tor_pause(self, widget):
|
def tor_pause(self, widget):
|
||||||
unique_ids = self.get_selected_torrent_rows()
|
|
||||||
try:
|
try:
|
||||||
|
unique_ids = self.get_selected_torrent_rows()
|
||||||
for uid in unique_ids:
|
for uid in unique_ids:
|
||||||
self.manager.set_user_pause(uid, True, True)
|
self.manager.set_user_pause(uid, True, True)
|
||||||
torrent_state = self.manager.get_torrent_state(uid)
|
torrent_state = self.manager.get_torrent_state(uid)
|
||||||
if torrent_state["is_paused"] == 0:
|
if torrent_state["is_paused"] == 0:
|
||||||
self.manager.save_fastresume_data(uid)
|
self.manager.save_fastresume_data(uid)
|
||||||
|
|
||||||
self.update()
|
self.update()
|
||||||
|
except:
|
||||||
except KeyError:
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def show_about_dialog(self, arg=None):
|
def show_about_dialog(self, arg=None):
|
||||||
|
@ -1039,7 +1037,8 @@ window, please enter your password"))
|
||||||
# Load plugins after we showed main window (if not started in tray)
|
# Load plugins after we showed main window (if not started in tray)
|
||||||
self.load_plugins()
|
self.load_plugins()
|
||||||
self.load_tabs_order()
|
self.load_tabs_order()
|
||||||
self.new_release_check()
|
if self.config.get("new_releases"):
|
||||||
|
self.new_release_check()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gobject.threads_init()
|
gobject.threads_init()
|
||||||
|
|
|
@ -130,6 +130,7 @@ if common.windows_check():
|
||||||
"use_lsd" : False,
|
"use_lsd" : False,
|
||||||
"use_utpex" : True,
|
"use_utpex" : True,
|
||||||
"window_height" : 480,
|
"window_height" : 480,
|
||||||
|
"new_releases" : True,
|
||||||
"window_maximized" : False,
|
"window_maximized" : False,
|
||||||
"window_pane_position" : -1,
|
"window_pane_position" : -1,
|
||||||
"window_width" : 640,
|
"window_width" : 640,
|
||||||
|
@ -161,6 +162,7 @@ else:
|
||||||
"open_folder_location": "",
|
"open_folder_location": "",
|
||||||
"send_info" : True,
|
"send_info" : True,
|
||||||
"auto_end_seeding" : False,
|
"auto_end_seeding" : False,
|
||||||
|
"new_releases" : True,
|
||||||
"auto_seed_ratio" : 0,
|
"auto_seed_ratio" : 0,
|
||||||
"close_to_tray" : False,
|
"close_to_tray" : False,
|
||||||
"enable_files_dialog" : False,
|
"enable_files_dialog" : False,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue