manual force-recheck

This commit is contained in:
Marcos Pinto 2007-11-05 22:34:05 +00:00
parent e202a79dc3
commit 319bc25cd5
4 changed files with 58 additions and 73 deletions

View File

@ -3,6 +3,7 @@ Deluge 0.5.7 (xx November 2007)
list
* Add preference for the location of torrent files
* Add autoload folder
* Manual force-recheck
Deluge 0.5.6.2 (31 October 2007)
* Set default piece size to 256-KiB in TorrentCreator plugin and add 2048KiB

2
TODO
View File

@ -1,4 +1,4 @@
for 0.5.7
* manual recheck
* possibly add queue support to manual recheck
* remap filenames
* decide what to do about the progress bar patch

View File

@ -4,6 +4,30 @@
<glade-interface>
<widget class="GtkMenu" id="torrent_menu">
<property name="visible">True</property>
<child>
<widget class="GtkImageMenuItem" id="menuitem3">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip" translatable="yes">Recheck torrent data</property>
<property name="label" translatable="yes">_Force Recheck</property>
<property name="use_underline">True</property>
<signal name="activate" handler="torrent_recheck"/>
<child internal-child="image">
<widget class="GtkImage" id="menu-item-image16">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="stock">gtk-execute</property>
<property name="icon_size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separatormenuitem2">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_resume">
<property name="visible">True</property>
@ -110,77 +134,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">_Queue</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="menu1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkImageMenuItem" id="menu_queue_top">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">_Top</property>
<property name="use_underline">True</property>
<signal name="activate" handler="queue_top"/>
<child internal-child="image">
<widget class="GtkImage" id="menu-item-image10">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="stock">gtk-goto-top</property>
<property name="icon_size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_queue_up">
<property name="visible">True</property>
<property name="label" translatable="yes">_Up</property>
<property name="use_underline">True</property>
<signal name="activate" handler="queue_up"/>
<child internal-child="image">
<widget class="GtkImage" id="menu-item-image6">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="stock">gtk-go-up</property>
<property name="icon_size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_queue_down">
<property name="visible">True</property>
<property name="label" translatable="yes">_Down</property>
<property name="use_underline">True</property>
<signal name="activate" handler="queue_down"/>
<child internal-child="image">
<widget class="GtkImage" id="menu-item-image7">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="stock">gtk-go-down</property>
<property name="icon_size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_queue_bottom">
<property name="visible">True</property>
<property name="label" translatable="yes">_Bottom</property>
<property name="use_underline">True</property>
<signal name="activate" handler="queue_bottom"/>
<child internal-child="image">
<widget class="GtkImage" id="menu-item-image8">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="stock">gtk-goto-bottom</property>
<property name="icon_size">1</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<child internal-child="image">
<widget class="GtkImage" id="menu-item-image11">
<property name="visible">True</property>

View File

@ -154,6 +154,7 @@ class DelugeGTK:
result = 0
def win_handler(self, ctrl_type):
if ctrl_type == CTRL_CLOSE_EVENT:
self.window.hide()
self.shutdown()
result = 1
return result
@ -545,6 +546,7 @@ window, please enter your password"))
"remove_torrent": self.remove_torrent_clicked,
"edit_trackers": self.list_of_trackers,
"tor_start": self.tor_start,
"torrent_recheck": self.torrent_recheck,
"tor_pause": self.tor_pause,
"update_tracker": self.update_tracker,
"clear_finished": self.clear_finished,
@ -738,6 +740,36 @@ window, please enter your password"))
except KeyError:
pass
def torrent_recheck(self, widget):
unique_ids = self.get_selected_torrent_rows()
for uid in unique_ids:
torrent_state = self.manager.get_torrent_state(uid)
order = torrent_state['queue_pos']
path = self.manager.unique_IDs[uid].filename
save_dir = self.manager.unique_IDs[uid].save_dir
save_info = [path, save_dir, order]
import os, xdg
try:
os.remove(self.manager.unique_IDs[uid].filename + ".fastresume")
except:
pass
if common.windows_check():
self.filepath = os.path.join(os.path.expanduser("~"), 'deluge', 'saveinfo.txt')
else:
self.filepath = os.path.join(xdg.BaseDirectory.save_config_path('deluge'), 'saveinfo.txt')
filename = open(self.filepath, 'w')
import cPickle
cPickle.dump(save_info, filename)
filename.close()
self.manager.remove_torrent(uid, False, False)
self.torrent_model_remove(uid)
self.update()
filename = open(self.filepath, 'r')
save_info = cPickle.load(filename)
self.interactive_add_torrent_path(save_info[0], save_info[1])
filename.close()
os.remove(self.filepath)
def tor_start(self, widget):
unique_ids = self.get_selected_torrent_rows()
try:
@ -1594,7 +1626,6 @@ want to remove all seeding torrents?")):
self.save_column_widths()
self.save_window_settings()
self.save_tabs_order()
gtk.main_quit()
enabled_plugins = ':'.join(self.plugins.get_enabled_plugins())
self.config.set('enabled_plugins', enabled_plugins)
self.config.save()