#1278: "Move storage" in deluge-gtk doesn't work
-----------------------+----------------------------------------------------
  Reporter:  simonbcn  |       Owner:           
      Type:  bug       |      Status:  pending  
  Priority:  critical  |   Milestone:  1.3.2    
 Component:  gtkui     |     Version:  1.3.0_dev
Resolution:            |    Keywords:           
-----------------------+----------------------------------------------------
Changes (by s0undt3ch):

  * milestone:  Future => 1.3.2


Comment:

 Replying to [comment:9 Cas]:
 > I think this is a pygtk problem, maybe this one:
 https://bugzilla.gnome.org/show_bug.cgi?id=546802
 >
 > The piece of code referenced has not been altered in 3 years and has no
 obvious errors in it.
 >
 > For reference I run Ubuntu 10.10 and my version of python-gobject is
 2.21.5

 Issue is still present in current maverick. What's needed is keep it
 referenced, here's a proposed patch:
 {{{
 #!diff
 diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py
 index ce80e54..73fc5a1 100644
 --- a/deluge/ui/gtkui/menubar.py
 +++ b/deluge/ui/gtkui/menubar.py
 @@ -341,18 +341,26 @@ def show_move_storage_dialog(self, status):
          glade = gtk.glade.XML(
                  pkg_resources.resource_filename("deluge.ui.gtkui",
 "glade/move_storage_dialog.glade"))
 -        dialog = glade.get_widget("move_storage_dialog")
 -        dialog.set_transient_for(self.window.window)
 -        entry = glade.get_widget("entry_destination")
 -        entry.set_text(status["save_path"])
 +        self.move_storage_dialog =
 glade.get_widget("move_storage_dialog")
 +        self.move_storage_dialog.set_transient_for(self.window.window)
 +        self.move_storage_dialog_entry =
 glade.get_widget("entry_destination")
 +        self.move_storage_dialog_entry.set_text(status["save_path"])
          def _on_response_event(widget, response_id):
 +            def core_responded(*args):
 +                # Delete references
 +                del self.move_storage_dialog_entry
 +                del self.move_storage_dialog
              if response_id == gtk.RESPONSE_OK:
                  log.debug("Moving torrents to %s", entry.get_text())
 -                path = entry.get_text()
 -
 client.core.move_storage(component.get("TorrentView").get_selected_torrents(),
 path)
 -            dialog.hide()
 -        dialog.connect("response", _on_response_event)
 -        dialog.show()
 +                path = self.move_storage_dialog_entry.get_text()
 +                client.core.move_storage(
 +                    component.get("TorrentView").get_selected_torrents(),
 +                    path
 +                ).addCallback(core_responded)
 +            self.move_storage_dialog.hide()
 +        self.move_storage_dialog.connect("response", _on_response_event)
 +        self.move_storage_dialog.show()
 +

      def on_menuitem_queue_top_activate(self, value):
          log.debug("on_menuitem_queue_top_activate")
 }}}

 Good enough for commit?

-- 
Ticket URL: <http://dev.deluge-torrent.org/ticket/1278#comment:10>
Deluge <http://deluge-torrent.org/>
Deluge project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-dev?hl=en.

Reply via email to