Merge remote-tracking branch 'github/1.3-gtk-movecompleted' into 1.3-stable

Conflicts:
	ChangeLog
This commit is contained in:
Chase Sterling 2012-11-02 18:09:11 -04:00
commit bd500c30de
3 changed files with 116 additions and 9 deletions

View File

@ -3,8 +3,7 @@
* Catch & log KeyError when removing a torrent from the queued torrents set
=== GtkUI ===
* Remove jitter in torrent list order, make order stable between sorts
* Improve update speed and responsiveness (especially with large number of torrents)
* Add move completed option to add torrent dialog
=== Deluge 1.3.5 (09 April 2012) ===
==== Core ====

View File

@ -78,7 +78,8 @@ class AddTorrentDialog(component.Component):
"on_button_cancel_clicked": self._on_button_cancel_clicked,
"on_button_add_clicked": self._on_button_add_clicked,
"on_button_apply_clicked": self._on_button_apply_clicked,
"on_button_revert_clicked": self._on_button_revert_clicked
"on_button_revert_clicked": self._on_button_revert_clicked,
"on_chk_move_completed_toggled": self._on_chk_move_completed_toggled
})
self.torrent_liststore = gtk.ListStore(str, str, str)
@ -142,7 +143,9 @@ class AddTorrentDialog(component.Component):
"max_download_speed_per_torrent",
"prioritize_first_last_pieces",
"download_location",
"add_paused"
"add_paused",
"move_completed",
"move_completed_path"
]
self.core_config = {}
@ -158,9 +161,15 @@ class AddTorrentDialog(component.Component):
if client.is_localhost():
self.glade.get_widget("button_location").show()
self.glade.get_widget("entry_download_path").hide()
self.glade.get_widget("button_move_completed_location").show()
self.glade.get_widget("entry_move_completed_path").hide()
else:
self.glade.get_widget("button_location").hide()
self.glade.get_widget("entry_download_path").show()
self.glade.get_widget("button_move_completed_location").hide()
self.glade.get_widget("entry_move_completed_path").show()
self._on_chk_move_completed_toggled(self.glade.get_widget("chk_move_completed"))
self.dialog.set_transient_for(component.get("MainWindow").window)
self.dialog.present()
@ -366,9 +375,13 @@ class AddTorrentDialog(component.Component):
if client.is_localhost():
self.glade.get_widget("button_location").set_current_folder(
options["download_location"])
self.glade.get_widget("button_move_completed_location").set_current_folder(
options["move_completed_path"])
else:
self.glade.get_widget("entry_download_path").set_text(
options["download_location"])
self.glade.get_widget("entry_move_completed_path").set_text(
options["move_completed_path"])
self.glade.get_widget("radio_full").set_active(
not options["compact_allocation"])
@ -386,6 +399,8 @@ class AddTorrentDialog(component.Component):
options["add_paused"])
self.glade.get_widget("chk_prioritize").set_active(
options["prioritize_first_last_pieces"])
self.glade.get_widget("chk_move_completed").set_active(
options["move_completed"])
def save_torrent_options(self, row=None):
# Keeps the torrent options dictionary up-to-date with what the user has
@ -406,9 +421,13 @@ class AddTorrentDialog(component.Component):
if client.is_localhost():
options["download_location"] = \
self.glade.get_widget("button_location").get_filename()
options["move_completed_path"] = \
self.glade.get_widget("button_move_completed_location").get_filename()
else:
options["download_location"] = \
self.glade.get_widget("entry_download_path").get_text()
options["move_completed_path"] = \
self.glade.get_widget("entry_move_completed_path").get_text()
options["compact_allocation"] = \
self.glade.get_widget("radio_compact").get_active()
@ -431,6 +450,8 @@ class AddTorrentDialog(component.Component):
self.glade.get_widget("chk_paused").get_active()
options["prioritize_first_last_pieces"] = \
self.glade.get_widget("chk_prioritize").get_active()
options["move_completed"] = \
self.glade.get_widget("chk_move_completed").get_active()
self.options[torrent_id] = options
@ -456,9 +477,15 @@ class AddTorrentDialog(component.Component):
if client.is_localhost():
self.glade.get_widget("button_location").set_current_folder(
self.core_config["download_location"])
self.glade.get_widget("button_move_completed_location").set_current_folder(
self.core_config["move_completed_path"]
)
else:
self.glade.get_widget("entry_download_path").set_text(
self.core_config["download_location"])
self.glade.get_widget("entry_move_completed_path").set_text(
self.core_config["move_completed_path"]
)
self.glade.get_widget("radio_compact").set_active(
self.core_config["compact_allocation"])
@ -476,6 +503,8 @@ class AddTorrentDialog(component.Component):
self.core_config["add_paused"])
self.glade.get_widget("chk_prioritize").set_active(
self.core_config["prioritize_first_last_pieces"])
self.glade.get_widget("chk_move_completed").set_active(
self.core_config["move_completed"])
def get_file_priorities(self, torrent_id):
# A list of priorities
@ -793,6 +822,11 @@ class AddTorrentDialog(component.Component):
del self.options[model.get_value(row, 0)]
self.set_default_options()
def _on_chk_move_completed_toggled(self, widget):
value = widget.get_active()
self.glade.get_widget("button_move_completed_location").set_sensitive(value)
self.glade.get_widget("entry_move_completed_path").set_sensitive(value)
def _on_delete_event(self, widget, event):
self.hide()
return True

View File

@ -375,8 +375,8 @@
<child>
<widget class="GtkEntry" id="entry_download_path">
<property name="can_focus">True</property>
<property name="truncate_multiline">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="truncate_multiline">True</property>
</widget>
<packing>
<property name="position">1</property>
@ -404,6 +404,80 @@
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame1">
<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_xalign">0</property>
<property name="shadow_type">none</property>
<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>
<property name="top_padding">5</property>
<property name="left_padding">5</property>
<property name="right_padding">5</property>
<child>
<widget class="GtkHBox" id="hbox1">
<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="GtkCheckButton" id="chk_move_completed">
<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_chk_move_completed_toggled"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkFileChooserButton" id="button_move_completed_location">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="show_hidden">True</property>
<property name="action">select-folder</property>
<property name="title" translatable="yes">Select A Folder</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="entry_move_completed_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">&#x25CF;</property>
<property name="truncate_multiline">True</property>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label1">
<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">&lt;b&gt;Move Completed Location&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox6">
<property name="visible">True</property>
@ -715,7 +789,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
@ -833,7 +907,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</widget>
@ -1022,9 +1096,9 @@
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="is_focus">True</property>
<property name="truncate_multiline">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="activates_default">True</property>
<property name="truncate_multiline">True</property>
</widget>
<packing>
<property name="position">1</property>
@ -1181,9 +1255,9 @@
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="is_focus">True</property>
<property name="truncate_multiline">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="activates_default">True</property>
<property name="truncate_multiline">True</property>
</widget>
<packing>
<property name="position">1</property>