Fix Create Torrent Dialog Box - Some buttons raise Type Error if no row selected
This commit is contained in:
parent
03689a805b
commit
6f844a86d2
|
@ -377,6 +377,8 @@ class CreateTorrentDialog:
|
||||||
def _on_button_up_clicked(self, widget):
|
def _on_button_up_clicked(self, widget):
|
||||||
log.debug("_on_button_up_clicked")
|
log.debug("_on_button_up_clicked")
|
||||||
row = self.glade.get_widget("tracker_treeview").get_selection().get_selected()[1]
|
row = self.glade.get_widget("tracker_treeview").get_selection().get_selected()[1]
|
||||||
|
if row is None:
|
||||||
|
return
|
||||||
if self.trackers_liststore[row][0] == 0:
|
if self.trackers_liststore[row][0] == 0:
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
@ -385,6 +387,8 @@ class CreateTorrentDialog:
|
||||||
def _on_button_down_clicked(self, widget):
|
def _on_button_down_clicked(self, widget):
|
||||||
log.debug("_on_button_down_clicked")
|
log.debug("_on_button_down_clicked")
|
||||||
row = self.glade.get_widget("tracker_treeview").get_selection().get_selected()[1]
|
row = self.glade.get_widget("tracker_treeview").get_selection().get_selected()[1]
|
||||||
|
if row is None:
|
||||||
|
return
|
||||||
self.trackers_liststore[row][0] += 1
|
self.trackers_liststore[row][0] += 1
|
||||||
|
|
||||||
def _on_button_add_clicked(self, widget):
|
def _on_button_add_clicked(self, widget):
|
||||||
|
@ -428,4 +432,6 @@ class CreateTorrentDialog:
|
||||||
def _on_button_remove_clicked(self, widget):
|
def _on_button_remove_clicked(self, widget):
|
||||||
log.debug("_on_button_remove_clicked")
|
log.debug("_on_button_remove_clicked")
|
||||||
row = self.glade.get_widget("tracker_treeview").get_selection().get_selected()[1]
|
row = self.glade.get_widget("tracker_treeview").get_selection().get_selected()[1]
|
||||||
|
if row is None:
|
||||||
|
return
|
||||||
self.trackers_liststore.remove(row)
|
self.trackers_liststore.remove(row)
|
||||||
|
|
Loading…
Reference in New Issue