Author: andar

Revision: 5146

Log:
        Fix uncaught exception when the remove torrent button is pressed when 
no torrents are selected

Diff:
Modified: trunk/deluge/ui/gtkui/menubar.py
===================================================================
--- trunk/deluge/ui/gtkui/menubar.py    2009-04-23 20:30:09 UTC (rev 5145)
+++ trunk/deluge/ui/gtkui/menubar.py    2009-04-23 22:55:52 UTC (rev 5146)
@@ -293,8 +293,10 @@
 
     def on_menuitem_remove_activate(self, data=None):
         log.debug("on_menuitem_remove_activate")
-        from removetorrentdialog import RemoveTorrentDialog
-        
RemoveTorrentDialog(component.get("TorrentView").get_selected_torrents()).run()
+        torrent_ids = component.get("TorrentView").get_selected_torrents()
+        if torrent_ids:
+            from removetorrentdialog import RemoveTorrentDialog
+            RemoveTorrentDialog().run()
 
     def on_menuitem_recheck_activate(self, data=None):
         log.debug("on_menuitem_recheck_activate")



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" 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-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to