src/eric7/Project/ProjectBrowser.py

branch
eric7
changeset 9517
d73c3a1e432b
parent 9512
6e29913ba7b6
child 9524
6a730f4d0080
equal deleted inserted replaced
9516:0f023e61a9b5 9517:d73c3a1e432b
76 @signal trpreview(filenames, ignore) emitted to preview Qt-Linguist (*.qm) 76 @signal trpreview(filenames, ignore) emitted to preview Qt-Linguist (*.qm)
77 files indicating whether non-existent files shall be ignored 77 files indicating whether non-existent files shall be ignored
78 (list of str, bool) 78 (list of str, bool)
79 @signal uipreview(str) emitted to preview a forms file 79 @signal uipreview(str) emitted to preview a forms file
80 @signal umlFile(filename) emitted to open an eric UML file (str) 80 @signal umlFile(filename) emitted to open an eric UML file (str)
81 @signal processChangedProjectFiles() emitted to indicate, that changed project files
82 should be processed
81 """ 83 """
82 84
83 appendStderr = pyqtSignal(str) 85 appendStderr = pyqtSignal(str)
84 appendStdout = pyqtSignal(str) 86 appendStdout = pyqtSignal(str)
85 binaryFile = pyqtSignal(str) 87 binaryFile = pyqtSignal(str)
93 svgFile = pyqtSignal(str) 95 svgFile = pyqtSignal(str)
94 testFile = pyqtSignal(str) 96 testFile = pyqtSignal(str)
95 trpreview = pyqtSignal((list,), (list, bool)) 97 trpreview = pyqtSignal((list,), (list, bool))
96 uipreview = pyqtSignal(str) 98 uipreview = pyqtSignal(str)
97 umlFile = pyqtSignal(str) 99 umlFile = pyqtSignal(str)
100 processChangedProjectFiles = pyqtSignal()
98 101
99 def __init__(self, project, parent=None): 102 def __init__(self, project, parent=None):
100 """ 103 """
101 Constructor 104 Constructor
102 105
307 310
308 def handleEditorChanged(self, fn): 311 def handleEditorChanged(self, fn):
309 """ 312 """
310 Public slot to handle the editorChanged signal. 313 Public slot to handle the editorChanged signal.
311 314
312 @param fn filename of the changed file (string) 315 @param fn filename of the changed file
316 @type str
313 """ 317 """
314 if Preferences.getProject("FollowEditor"): 318 if Preferences.getProject("FollowEditor"):
315 if self.project.isProjectSource(fn): 319 for fileCategory in (
316 self.__browsers["sources"].selectFile(fn) 320 cat
317 elif self.project.isProjectForm(fn): 321 for cat in self.project.getFileCategories()
318 self.__browsers["forms"].selectFile(fn) 322 if cat not in ("TRANSLATIONS", "OTHERS")
319 elif self.project.isProjectResource(fn): 323 ):
320 self.__browsers["resources"].selectFile(fn) 324 if self.project.isProjectCategory(fn, fileCategory):
321 elif self.project.isProjectInterface(fn): 325 self.__browsers[fileCategory.lower()].selectFile(fn)
322 self.__browsers["interfaces"].selectFile(fn) 326 break
323 elif self.project.isProjectProtocol(fn):
324 self.__browsers["protocols"].selectFile(fn)
325 327
326 def handleEditorLineChanged(self, fn, lineno): 328 def handleEditorLineChanged(self, fn, lineno):
327 """ 329 """
328 Public slot to handle the editorLineChanged signal. 330 Public slot to handle the editorLineChanged signal.
329 331
331 @param lineno one based line number of the item (integer) 333 @param lineno one based line number of the item (integer)
332 """ 334 """
333 if ( 335 if (
334 Preferences.getProject("FollowEditor") 336 Preferences.getProject("FollowEditor")
335 and Preferences.getProject("FollowCursorLine") 337 and Preferences.getProject("FollowCursorLine")
336 and self.project.isProjectSource(fn) 338 and self.project.isProjectCategory(fn, "SOURCES")
337 ): 339 ):
338 self.__browsers["sources"].selectFileLine(fn, lineno) 340 self.__browsers["sources"].selectFileLine(fn, lineno)
339 341
340 def getProjectBrowsers(self): 342 def getProjectBrowsers(self):
341 """ 343 """

eric ide

mercurial