From 4ba32dc4bf46759107ebbdc13d88b9cbaee3646f Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 22 Jan 2008 11:43:58 +0000 Subject: [PATCH] Select a torrent in the list if none are selected on torrent add. --- deluge/ui/gtkui/addtorrentdialog.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index 3c10f1584..cdef46521 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -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()