mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-28 04:04:47 +00:00
parent
b9c49f27fa
commit
e6cd4d17ee
@ -336,21 +336,33 @@ class MenuBar(component.Component):
|
|||||||
|
|
||||||
def show_move_storage_dialog(self, status):
|
def show_move_storage_dialog(self, status):
|
||||||
log.debug("show_move_storage_dialog")
|
log.debug("show_move_storage_dialog")
|
||||||
glade = gtk.glade.XML(
|
glade = gtk.glade.XML(pkg_resources.resource_filename(
|
||||||
pkg_resources.resource_filename("deluge.ui.gtkui",
|
"deluge.ui.gtkui", "glade/move_storage_dialog.glade"
|
||||||
"glade/move_storage_dialog.glade"))
|
))
|
||||||
dialog = glade.get_widget("move_storage_dialog")
|
# Keep it referenced:
|
||||||
dialog.set_transient_for(self.window.window)
|
# https://bugzilla.gnome.org/show_bug.cgi?id=546802
|
||||||
entry = glade.get_widget("entry_destination")
|
self.move_storage_dialog = glade.get_widget("move_storage_dialog")
|
||||||
entry.set_text(status["save_path"])
|
self.move_storage_dialog.set_transient_for(self.window.window)
|
||||||
def _on_response_event(widget, response_id):
|
self.move_storage_dialog_entry = glade.get_widget("entry_destination")
|
||||||
|
self.move_storage_dialog_entry.set_text(status["save_path"])
|
||||||
|
def on_dialog_response_event(widget, response_id):
|
||||||
|
|
||||||
|
def on_core_result(result):
|
||||||
|
# Delete references
|
||||||
|
del self.move_storage_dialog
|
||||||
|
del self.move_storage_dialog_entry
|
||||||
|
|
||||||
if response_id == gtk.RESPONSE_OK:
|
if response_id == gtk.RESPONSE_OK:
|
||||||
log.debug("Moving torrents to %s", entry.get_text())
|
log.debug("Moving torrents to %s",
|
||||||
path = entry.get_text()
|
self.move_storage_dialog.get_text())
|
||||||
client.core.move_storage(component.get("TorrentView").get_selected_torrents(), path)
|
path = self.move_storage_dialog_entry.get_text()
|
||||||
dialog.hide()
|
client.core.move_storage(
|
||||||
dialog.connect("response", _on_response_event)
|
component.get("TorrentView").get_selected_torrents(), path
|
||||||
dialog.show()
|
).addCallback(on_core_result)
|
||||||
|
self.move_storage_dialog.hide()
|
||||||
|
|
||||||
|
self.move_storage_dialog.connect("response", on_dialog_response_event)
|
||||||
|
self.move_storage_dialog.show()
|
||||||
|
|
||||||
def on_menuitem_queue_top_activate(self, value):
|
def on_menuitem_queue_top_activate(self, value):
|
||||||
log.debug("on_menuitem_queue_top_activate")
|
log.debug("on_menuitem_queue_top_activate")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user