Module: deluge Branch: master Commit: e198ea14e4349436db1a7c754bbb2dcab7f76a53
Author: Calum Lind <[email protected]> Date: Fri Feb 11 01:07:47 2011 +0000 Fix Create Torrent Dialog Box - Some buttons raise Type Error if no row selected --- deluge/ui/gtkui/createtorrentdialog.py | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/deluge/ui/gtkui/createtorrentdialog.py b/deluge/ui/gtkui/createtorrentdialog.py index 147fd64..786347e 100644 --- a/deluge/ui/gtkui/createtorrentdialog.py +++ b/deluge/ui/gtkui/createtorrentdialog.py @@ -379,6 +379,8 @@ class CreateTorrentDialog: def _on_button_up_clicked(self, widget): log.debug("_on_button_up_clicked") row = self.glade.get_widget("tracker_treeview").get_selection().get_selected()[1] + if row is None: + return if self.trackers_liststore[row][0] == 0: return else: @@ -387,6 +389,8 @@ class CreateTorrentDialog: def _on_button_down_clicked(self, widget): log.debug("_on_button_down_clicked") row = self.glade.get_widget("tracker_treeview").get_selection().get_selected()[1] + if row is None: + return self.trackers_liststore[row][0] += 1 def _on_button_add_clicked(self, widget): @@ -430,4 +434,6 @@ class CreateTorrentDialog: def _on_button_remove_clicked(self, widget): log.debug("_on_button_remove_clicked") row = self.glade.get_widget("tracker_treeview").get_selection().get_selected()[1] + if row is None: + return self.trackers_liststore.remove(row) -- 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.
