Select a torrent in the list if none are selected on torrent add.
This commit is contained in:
parent
4036ff4310
commit
4ba32dc4bf
|
@ -170,11 +170,16 @@ class AddTorrentDialog:
|
||||||
})
|
})
|
||||||
|
|
||||||
name = "%s (%s)" % (info.name(), os.path.split(filename)[-1])
|
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])
|
[str(info.info_hash()), name, filename])
|
||||||
self.files[str(info.info_hash())] = files
|
self.files[str(info.info_hash())] = files
|
||||||
self.infos[str(info.info_hash())] = info
|
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):
|
def _on_torrent_changed(self, treeselection):
|
||||||
(model, row) = treeselection.get_selected()
|
(model, row) = treeselection.get_selected()
|
||||||
self.files_liststore.clear()
|
self.files_liststore.clear()
|
||||||
|
|
Loading…
Reference in New Issue