Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: deluge/core/torrentmanager.py
- ===================================================================
- --- deluge/core/torrentmanager.py (revision 5922)
- +++ deluge/core/torrentmanager.py (working copy)
- @@ -542,6 +542,21 @@
- # Save the session state
- self.save_state()
- + # Remove the torrent file from the user specified directory
- + filename = self.torrents[torrent_id].filename
- + if self.config["copy_torrent_file"] and \
- + self.config["del_copy_torrent_file"] and \
- + filename:
- + try:
- + users_torrent_file = os.path.join(
- + self.config["torrentfiles_location"],
- + filename)
- + log.debug("Delete user's torrent file: %s",
- + users_torrent_file)
- + os.remove(users_torrent_file)
- + except Exception, e:
- + log.debug("Unable to remove user's torrent file: %s", e)
- +
- # Emit the signal to the clients
- component.get("EventManager").emit(TorrentRemovedEvent(torrent_id))
- Index: deluge/core/preferencesmanager.py
- ===================================================================
- --- deluge/core/preferencesmanager.py (revision 5922)
- +++ deluge/core/preferencesmanager.py (working copy)
- @@ -58,6 +58,7 @@
- "listen_ports": [6881, 6891],
- "listen_interface": "",
- "copy_torrent_file": False,
- + "del_copy_torrent_file": False,
- "torrentfiles_location": deluge.common.get_default_download_dir(),
- "plugins_location": os.path.join(deluge.configmanager.get_config_dir(), "plugins"),
- "prioritize_first_last_pieces": False,
- Index: deluge/ui/gtkui/preferences.py
- ===================================================================
- --- deluge/ui/gtkui/preferences.py (revision 5922)
- +++ deluge/ui/gtkui/preferences.py (working copy)
- @@ -215,6 +215,8 @@
- ("filename", self.core_config["move_completed_path"]),
- "chk_copy_torrent_file": \
- ("active", self.core_config["copy_torrent_file"]),
- + "chk_del_copy_torrent_file": \
- + ("active", self.core_config["del_copy_torrent_file"]),
- "torrent_files_button": \
- ("filename", self.core_config["torrentfiles_location"]),
- "chk_autoadd": \
- @@ -367,6 +369,7 @@
- "chk_move_completed",
- "move_completed_path_button",
- "chk_copy_torrent_file",
- + "chk_del_copy_torrent_file",
- "torrent_files_button",
- "chk_autoadd",
- "folder_autoadd",
- @@ -537,6 +540,8 @@
- self.glade.get_widget("chk_focus_dialog").get_active()
- new_core_config["copy_torrent_file"] = \
- self.glade.get_widget("chk_copy_torrent_file").get_active()
- + new_core_config["del_copy_torrent_file"] = \
- + self.glade.get_widget("chk_del_copy_torrent_file").get_active()
- new_core_config["move_completed"] = \
- self.glade.get_widget("chk_move_completed").get_active()
- if client.is_localhost():
- @@ -822,7 +827,8 @@
- "radio_open_folder_custom": {"combo_file_manager": False,
- "txt_open_folder_location": True},
- "chk_move_completed" : {"move_completed_path_button" : True},
- - "chk_copy_torrent_file" : {"torrent_files_button" : True},
- + "chk_copy_torrent_file" : {"torrent_files_button" : True,
- + "chk_del_copy_torrent_file" : True},
- "chk_autoadd" : {"folder_autoadd" : True},
- "chk_seed_ratio" : {"spin_share_ratio": True,
- "chk_remove_ratio" : True}
- Index: deluge/ui/gtkui/glade/preferences_dialog.glade
- ===================================================================
- --- deluge/ui/gtkui/glade/preferences_dialog.glade (revision 5922)
- +++ deluge/ui/gtkui/glade/preferences_dialog.glade (working copy)
- @@ -104,7 +104,7 @@
- <child>
- <widget class="GtkTable" id="table9">
- <property name="visible">True</property>
- - <property name="n_rows">4</property>
- + <property name="n_rows">5</property>
- <property name="n_columns">2</property>
- <child>
- <widget class="GtkAlignment" id="alignment11">
- @@ -140,45 +140,6 @@
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- - <property name="top_attach">3</property>
- - <property name="bottom_attach">4</property>
- - </packing>
- - </child>
- - <child>
- - <widget class="GtkAlignment" id="alignment8">
- - <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="GtkHBox" id="hbox10">
- - <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="spacing">5</property>
- - <child>
- - <widget class="GtkFileChooserButton" id="torrent_files_button">
- - <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="action">select-folder</property>
- - <property name="title" translatable="yes">Select A Folder</property>
- - </widget>
- - <packing>
- - <property name="position">0</property>
- - </packing>
- - </child>
- - <child>
- - <widget class="GtkEntry" id="entry_torrents_path">
- - <property name="can_focus">True</property>
- - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- - </widget>
- - <packing>
- - <property name="position">1</property>
- - </packing>
- - </child>
- - </widget>
- - </child>
- - </widget>
- - <packing>
- - <property name="left_attach">1</property>
- - <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- @@ -230,21 +191,6 @@
- <signal name="toggled" handler="on_toggle"/>
- </widget>
- <packing>
- - <property name="top_attach">3</property>
- - <property name="bottom_attach">4</property>
- - <property name="x_options">GTK_FILL</property>
- - </packing>
- - </child>
- - <child>
- - <widget class="GtkCheckButton" id="chk_copy_torrent_file">
- - <property name="label" translatable="yes">Copy of .torrent files to:</property>
- - <property name="visible">True</property>
- - <property name="can_focus">True</property>
- - <property name="receives_default">False</property>
- - <property name="draw_indicator">True</property>
- - <signal name="toggled" handler="on_toggle"/>
- - </widget>
- - <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- @@ -307,6 +253,76 @@
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- + <child>
- + <widget class="GtkCheckButton" id="chk_copy_torrent_file">
- + <property name="label" translatable="yes">Copy of .torrent files to:</property>
- + <property name="visible">True</property>
- + <property name="can_focus">True</property>
- + <property name="receives_default">False</property>
- + <property name="draw_indicator">True</property>
- + <signal name="toggled" handler="on_toggle"/>
- + </widget>
- + <packing>
- + <property name="top_attach">3</property>
- + <property name="bottom_attach">4</property>
- + <property name="x_options">GTK_FILL</property>
- + </packing>
- + </child>
- + <child>
- + <widget class="GtkAlignment" id="alignment8">
- + <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="GtkHBox" id="hbox10">
- + <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="spacing">5</property>
- + <child>
- + <widget class="GtkFileChooserButton" id="torrent_files_button">
- + <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="action">select-folder</property>
- + <property name="title" translatable="yes">Select A Folder</property>
- + </widget>
- + <packing>
- + <property name="position">0</property>
- + </packing>
- + </child>
- + <child>
- + <widget class="GtkEntry" id="entry_torrents_path">
- + <property name="can_focus">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="invisible_char">●</property>
- + </widget>
- + <packing>
- + <property name="position">1</property>
- + </packing>
- + </child>
- + </widget>
- + </child>
- + </widget>
- + <packing>
- + <property name="left_attach">1</property>
- + <property name="right_attach">2</property>
- + <property name="top_attach">3</property>
- + <property name="bottom_attach">4</property>
- + </packing>
- + </child>
- + <child>
- + <widget class="GtkCheckButton" id="chk_del_copy_torrent_file">
- + <property name="label" translatable="yes">Delete torrent file on remove</property>
- + <property name="visible">True</property>
- + <property name="can_focus">True</property>
- + <property name="receives_default">False</property>
- + <property name="draw_indicator">True</property>
- + </widget>
- + <packing>
- + <property name="right_attach">2</property>
- + <property name="top_attach">4</property>
- + <property name="bottom_attach">5</property>
- + <property name="x_padding">15</property>
- + </packing>
- + </child>
- </widget>
- </child>
- </widget>
Add Comment
Please, Sign In to add comment