309 if Preferences.getProject("FollowEditor"): |
309 if Preferences.getProject("FollowEditor"): |
310 if self.project.isProjectSource(fn): |
310 if self.project.isProjectSource(fn): |
311 self.psBrowser.selectFile(fn) |
311 self.psBrowser.selectFile(fn) |
312 elif self.project.isProjectForm(fn): |
312 elif self.project.isProjectForm(fn): |
313 self.pfBrowser.selectFile(fn) |
313 self.pfBrowser.selectFile(fn) |
|
314 elif self.project.isProjectResource(fn): |
|
315 self.prBrowser.selectFile(fn) |
314 elif self.project.isProjectInterface(fn): |
316 elif self.project.isProjectInterface(fn): |
315 self.piBrowser.selectFile(fn) |
317 self.piBrowser.selectFile(fn) |
316 elif self.project.isProjectProtocol(fn): |
318 elif self.project.isProjectProtocol(fn): |
317 self.ppBrowser.selectFile(fn) |
319 self.ppBrowser.selectFile(fn) |
318 elif self.project.isProjectProtocol(fn): |
|
319 self.ppBrowser.selectFile(fn) |
|
320 |
320 |
321 def handleEditorLineChanged(self, fn, lineno): |
321 def handleEditorLineChanged(self, fn, lineno): |
322 """ |
322 """ |
323 Public slot to handle the editorLineChanged signal. |
323 Public slot to handle the editorLineChanged signal. |
324 |
324 |
325 @param fn filename of the changed file (string) |
325 @param fn filename of the changed file (string) |
326 @param lineno one based line number of the item (integer) |
326 @param lineno one based line number of the item (integer) |
327 """ |
327 """ |
328 if ( |
328 if ( |
329 Preferences.getProject("FollowEditor") and |
329 Preferences.getProject("FollowEditor") and |
330 Preferences.getProject("FollowCursorLine") |
330 Preferences.getProject("FollowCursorLine") and |
|
331 self.project.isProjectSource(fn) |
331 ): |
332 ): |
332 if self.project.isProjectSource(fn): |
333 self.psBrowser.selectFileLine(fn, lineno) |
333 self.psBrowser.selectFileLine(fn, lineno) |
|
334 |
334 |
335 def getProjectBrowsers(self): |
335 def getProjectBrowsers(self): |
336 """ |
336 """ |
337 Public method to get references to the individual project browsers. |
337 Public method to get references to the individual project browsers. |
338 |
338 |
349 @param name name of the requested project browser (string). |
349 @param name name of the requested project browser (string). |
350 Valid names are "sources, forms, resources, translations, |
350 Valid names are "sources, forms, resources, translations, |
351 interfaces, protocols, others". |
351 interfaces, protocols, others". |
352 @return reference to the requested browser or None |
352 @return reference to the requested browser or None |
353 """ |
353 """ |
354 if name == "sources": |
354 return { |
355 return self.psBrowser |
355 "sources": self.psBrowser, |
356 elif name == "forms": |
356 "forms": self.pfBrowser, |
357 return self.pfBrowser |
357 "resources": self.prBrowser, |
358 elif name == "resources": |
358 "translations": self.ptBrowser, |
359 return self.prBrowser |
359 "interfaces": self.piBrowser, |
360 elif name == "translations": |
360 "protocols": self.ppBrowser, |
361 return self.ptBrowser |
361 "others": self.poBrowser, |
362 elif name == "interfaces": |
362 }.get(name, None) |
363 return self.piBrowser |
|
364 elif name == "protocols": |
|
365 return self.ppBrowser |
|
366 elif name == "others": |
|
367 return self.poBrowser |
|
368 else: |
|
369 return None |
|
370 |
363 |
371 def getProjectBrowserNames(self): |
364 def getProjectBrowserNames(self): |
372 """ |
365 """ |
373 Public method to get the names of the various project browsers. |
366 Public method to get the names of the various project browsers. |
374 |
367 |