Select a torrent in the list if none are selected on torrent add.

This commit is contained in:
Andrew Resch 2008-01-22 11:43:58 +00:00
parent 4036ff4310
commit 4ba32dc4bf
1 changed files with 6 additions and 1 deletions

View File

@ -170,11 +170,16 @@ class AddTorrentDialog:
})
name = "%s (%s)" % (info.name(), os.path.split(filename)[-1])
self.torrent_liststore.append(
new_row = self.torrent_liststore.append(
[str(info.info_hash()), name, filename])
self.files[str(info.info_hash())] = files
self.infos[str(info.info_hash())] = info
(model, row) = self.listview_torrents.get_selection().get_selected()
if row == None:
self.listview_torrents.get_selection().select_iter(new_row)
def _on_torrent_changed(self, treeselection):
(model, row) = treeselection.get_selected()
self.files_liststore.clear()