Project/ProjectBaseBrowser.py

changeset 2769
8cbebde7a984
parent 2540
f346433ea963
child 2791
a9577f248f04
child 2965
d133c7edd88a
equal deleted inserted replaced
2768:eab35f6e709f 2769:8cbebde7a984
329 if sindex.isValid(): 329 if sindex.isValid():
330 index = self.model().mapFromSource(sindex) 330 index = self.model().mapFromSource(sindex)
331 if index.isValid(): 331 if index.isValid():
332 self._selectSingleItem(index) 332 self._selectSingleItem(index)
333 self.scrollTo(index, QAbstractItemView.PositionAtTop) 333 self.scrollTo(index, QAbstractItemView.PositionAtTop)
334
335 def selectFileLine(self, fn, lineno):
336 """
337 Public method to highlight a node given its filename.
338
339 @param fn filename of file to be highlighted (string)
340 @param lineno one based line number of the item (integer)
341 """
342 newfn = os.path.abspath(fn)
343 newfn = self.project.getRelativePath(newfn)
344 sindex = self._model.itemIndexByNameAndLine(newfn, lineno)
345 if sindex.isValid():
346 index = self.model().mapFromSource(sindex)
347 if index.isValid():
348 self._selectSingleItem(index)
349 self.scrollTo(index)
334 350
335 def _expandAllDirs(self): 351 def _expandAllDirs(self):
336 """ 352 """
337 Protected slot to handle the 'Expand all directories' menu action. 353 Protected slot to handle the 'Expand all directories' menu action.
338 """ 354 """

eric ide

mercurial