Guest User

Untitled

a guest
Jul 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.33 KB | None | 0 0
  1. Index: deluge/core/torrentmanager.py
  2. ===================================================================
  3. --- deluge/core/torrentmanager.py (revision 5922)
  4. +++ deluge/core/torrentmanager.py (working copy)
  5. @@ -542,6 +542,21 @@
  6. # Save the session state
  7. self.save_state()
  8.  
  9. + # Remove the torrent file from the user specified directory
  10. + filename = self.torrents[torrent_id].filename
  11. + if self.config["copy_torrent_file"] and \
  12. + self.config["del_copy_torrent_file"] and \
  13. + filename:
  14. + try:
  15. + users_torrent_file = os.path.join(
  16. + self.config["torrentfiles_location"],
  17. + filename)
  18. + log.debug("Delete user's torrent file: %s",
  19. + users_torrent_file)
  20. + os.remove(users_torrent_file)
  21. + except Exception, e:
  22. + log.debug("Unable to remove user's torrent file: %s", e)
  23. +
  24. # Emit the signal to the clients
  25. component.get("EventManager").emit(TorrentRemovedEvent(torrent_id))
  26.  
  27. Index: deluge/core/preferencesmanager.py
  28. ===================================================================
  29. --- deluge/core/preferencesmanager.py (revision 5922)
  30. +++ deluge/core/preferencesmanager.py (working copy)
  31. @@ -58,6 +58,7 @@
  32. "listen_ports": [6881, 6891],
  33. "listen_interface": "",
  34. "copy_torrent_file": False,
  35. + "del_copy_torrent_file": False,
  36. "torrentfiles_location": deluge.common.get_default_download_dir(),
  37. "plugins_location": os.path.join(deluge.configmanager.get_config_dir(), "plugins"),
  38. "prioritize_first_last_pieces": False,
  39. Index: deluge/ui/gtkui/preferences.py
  40. ===================================================================
  41. --- deluge/ui/gtkui/preferences.py (revision 5922)
  42. +++ deluge/ui/gtkui/preferences.py (working copy)
  43. @@ -215,6 +215,8 @@
  44. ("filename", self.core_config["move_completed_path"]),
  45. "chk_copy_torrent_file": \
  46. ("active", self.core_config["copy_torrent_file"]),
  47. + "chk_del_copy_torrent_file": \
  48. + ("active", self.core_config["del_copy_torrent_file"]),
  49. "torrent_files_button": \
  50. ("filename", self.core_config["torrentfiles_location"]),
  51. "chk_autoadd": \
  52. @@ -367,6 +369,7 @@
  53. "chk_move_completed",
  54. "move_completed_path_button",
  55. "chk_copy_torrent_file",
  56. + "chk_del_copy_torrent_file",
  57. "torrent_files_button",
  58. "chk_autoadd",
  59. "folder_autoadd",
  60. @@ -537,6 +540,8 @@
  61. self.glade.get_widget("chk_focus_dialog").get_active()
  62. new_core_config["copy_torrent_file"] = \
  63. self.glade.get_widget("chk_copy_torrent_file").get_active()
  64. + new_core_config["del_copy_torrent_file"] = \
  65. + self.glade.get_widget("chk_del_copy_torrent_file").get_active()
  66. new_core_config["move_completed"] = \
  67. self.glade.get_widget("chk_move_completed").get_active()
  68. if client.is_localhost():
  69. @@ -822,7 +827,8 @@
  70. "radio_open_folder_custom": {"combo_file_manager": False,
  71. "txt_open_folder_location": True},
  72. "chk_move_completed" : {"move_completed_path_button" : True},
  73. - "chk_copy_torrent_file" : {"torrent_files_button" : True},
  74. + "chk_copy_torrent_file" : {"torrent_files_button" : True,
  75. + "chk_del_copy_torrent_file" : True},
  76. "chk_autoadd" : {"folder_autoadd" : True},
  77. "chk_seed_ratio" : {"spin_share_ratio": True,
  78. "chk_remove_ratio" : True}
  79. Index: deluge/ui/gtkui/glade/preferences_dialog.glade
  80. ===================================================================
  81. --- deluge/ui/gtkui/glade/preferences_dialog.glade (revision 5922)
  82. +++ deluge/ui/gtkui/glade/preferences_dialog.glade (working copy)
  83. @@ -104,7 +104,7 @@
  84. <child>
  85. <widget class="GtkTable" id="table9">
  86. <property name="visible">True</property>
  87. - <property name="n_rows">4</property>
  88. + <property name="n_rows">5</property>
  89. <property name="n_columns">2</property>
  90. <child>
  91. <widget class="GtkAlignment" id="alignment11">
  92. @@ -140,45 +140,6 @@
  93. <packing>
  94. <property name="left_attach">1</property>
  95. <property name="right_attach">2</property>
  96. - <property name="top_attach">3</property>
  97. - <property name="bottom_attach">4</property>
  98. - </packing>
  99. - </child>
  100. - <child>
  101. - <widget class="GtkAlignment" id="alignment8">
  102. - <property name="visible">True</property>
  103. - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
  104. - <child>
  105. - <widget class="GtkHBox" id="hbox10">
  106. - <property name="visible">True</property>
  107. - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
  108. - <property name="spacing">5</property>
  109. - <child>
  110. - <widget class="GtkFileChooserButton" id="torrent_files_button">
  111. - <property name="visible">True</property>
  112. - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
  113. - <property name="action">select-folder</property>
  114. - <property name="title" translatable="yes">Select A Folder</property>
  115. - </widget>
  116. - <packing>
  117. - <property name="position">0</property>
  118. - </packing>
  119. - </child>
  120. - <child>
  121. - <widget class="GtkEntry" id="entry_torrents_path">
  122. - <property name="can_focus">True</property>
  123. - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
  124. - </widget>
  125. - <packing>
  126. - <property name="position">1</property>
  127. - </packing>
  128. - </child>
  129. - </widget>
  130. - </child>
  131. - </widget>
  132. - <packing>
  133. - <property name="left_attach">1</property>
  134. - <property name="right_attach">2</property>
  135. <property name="top_attach">2</property>
  136. <property name="bottom_attach">3</property>
  137. </packing>
  138. @@ -230,21 +191,6 @@
  139. <signal name="toggled" handler="on_toggle"/>
  140. </widget>
  141. <packing>
  142. - <property name="top_attach">3</property>
  143. - <property name="bottom_attach">4</property>
  144. - <property name="x_options">GTK_FILL</property>
  145. - </packing>
  146. - </child>
  147. - <child>
  148. - <widget class="GtkCheckButton" id="chk_copy_torrent_file">
  149. - <property name="label" translatable="yes">Copy of .torrent files to:</property>
  150. - <property name="visible">True</property>
  151. - <property name="can_focus">True</property>
  152. - <property name="receives_default">False</property>
  153. - <property name="draw_indicator">True</property>
  154. - <signal name="toggled" handler="on_toggle"/>
  155. - </widget>
  156. - <packing>
  157. <property name="top_attach">2</property>
  158. <property name="bottom_attach">3</property>
  159. <property name="x_options">GTK_FILL</property>
  160. @@ -307,6 +253,76 @@
  161. <property name="x_options">GTK_FILL</property>
  162. </packing>
  163. </child>
  164. + <child>
  165. + <widget class="GtkCheckButton" id="chk_copy_torrent_file">
  166. + <property name="label" translatable="yes">Copy of .torrent files to:</property>
  167. + <property name="visible">True</property>
  168. + <property name="can_focus">True</property>
  169. + <property name="receives_default">False</property>
  170. + <property name="draw_indicator">True</property>
  171. + <signal name="toggled" handler="on_toggle"/>
  172. + </widget>
  173. + <packing>
  174. + <property name="top_attach">3</property>
  175. + <property name="bottom_attach">4</property>
  176. + <property name="x_options">GTK_FILL</property>
  177. + </packing>
  178. + </child>
  179. + <child>
  180. + <widget class="GtkAlignment" id="alignment8">
  181. + <property name="visible">True</property>
  182. + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
  183. + <child>
  184. + <widget class="GtkHBox" id="hbox10">
  185. + <property name="visible">True</property>
  186. + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
  187. + <property name="spacing">5</property>
  188. + <child>
  189. + <widget class="GtkFileChooserButton" id="torrent_files_button">
  190. + <property name="visible">True</property>
  191. + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
  192. + <property name="action">select-folder</property>
  193. + <property name="title" translatable="yes">Select A Folder</property>
  194. + </widget>
  195. + <packing>
  196. + <property name="position">0</property>
  197. + </packing>
  198. + </child>
  199. + <child>
  200. + <widget class="GtkEntry" id="entry_torrents_path">
  201. + <property name="can_focus">True</property>
  202. + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
  203. + <property name="invisible_char">&#x25CF;</property>
  204. + </widget>
  205. + <packing>
  206. + <property name="position">1</property>
  207. + </packing>
  208. + </child>
  209. + </widget>
  210. + </child>
  211. + </widget>
  212. + <packing>
  213. + <property name="left_attach">1</property>
  214. + <property name="right_attach">2</property>
  215. + <property name="top_attach">3</property>
  216. + <property name="bottom_attach">4</property>
  217. + </packing>
  218. + </child>
  219. + <child>
  220. + <widget class="GtkCheckButton" id="chk_del_copy_torrent_file">
  221. + <property name="label" translatable="yes">Delete torrent file on remove</property>
  222. + <property name="visible">True</property>
  223. + <property name="can_focus">True</property>
  224. + <property name="receives_default">False</property>
  225. + <property name="draw_indicator">True</property>
  226. + </widget>
  227. + <packing>
  228. + <property name="right_attach">2</property>
  229. + <property name="top_attach">4</property>
  230. + <property name="bottom_attach">5</property>
  231. + <property name="x_padding">15</property>
  232. + </packing>
  233. + </child>
  234. </widget>
  235. </child>
  236. </widget>
Add Comment
Please, Sign In to add comment