Project/ProjectSourcesBrowser.py

changeset 476
121633976eca
parent 461
34528aaedf1c
child 500
c3abc7895a01
equal deleted inserted replaced
475:94b3fdd34c60 476:121633976eca
40 @signal closeSourceWindow(string) emitted after a file has been removed/deleted 40 @signal closeSourceWindow(string) emitted after a file has been removed/deleted
41 from the project 41 from the project
42 @signal showMenu(string, QMenu) emitted when a menu is about to be shown. The name 42 @signal showMenu(string, QMenu) emitted when a menu is about to be shown. The name
43 of the menu and a reference to the menu are given. 43 of the menu and a reference to the menu are given.
44 """ 44 """
45 sourceFile = pyqtSignal((str, ), (str, int), (str, int, str))
46
45 def __init__(self, project, parent = None): 47 def __init__(self, project, parent = None):
46 """ 48 """
47 Constructor 49 Constructor
48 50
49 @param project reference to the project object 51 @param project reference to the project object
519 BrowserClassAttributeItem]) 521 BrowserClassAttributeItem])
520 522
521 for itm in itmList: 523 for itm in itmList:
522 if isinstance(itm, BrowserFileItem): 524 if isinstance(itm, BrowserFileItem):
523 if itm.isPythonFile(): 525 if itm.isPythonFile():
524 self.emit(SIGNAL('sourceFile'), itm.fileName(), 1, "Python") 526 self.sourceFile[str, int, str].emit(itm.fileName(), 1, "Python")
527 elif itm.isPython3File():
528 self.sourceFile[str, int, str].emit(itm.fileName(), 1, "Python3")
525 elif itm.isRubyFile(): 529 elif itm.isRubyFile():
526 self.emit(SIGNAL('sourceFile'), itm.fileName(), 1, "Ruby") 530 self.sourceFile[str, int, str].emit(itm.fileName(), 1, "Ruby")
527 elif itm.isDFile(): 531 elif itm.isDFile():
528 self.emit(SIGNAL('sourceFile'), itm.fileName(), 1, "D") 532 self.sourceFile[str, int, str].emit(itm.fileName(), 1, "D")
529 else: 533 else:
530 self.emit(SIGNAL('sourceFile'), itm.fileName()) 534 self.sourceFile[str].emit(itm.fileName())
531 elif isinstance(itm, BrowserClassItem): 535 elif isinstance(itm, BrowserClassItem):
532 self.emit(SIGNAL('sourceFile'), itm.fileName(), 536 self.sourceFile[str, int].emit(itm.fileName(), itm.classObject().lineno)
533 itm.classObject().lineno)
534 elif isinstance(itm,BrowserMethodItem): 537 elif isinstance(itm,BrowserMethodItem):
535 self.emit(SIGNAL('sourceFile'), itm.fileName(), 538 self.sourceFile[str, int].emit(
536 itm.functionObject().lineno) 539 itm.fileName(), itm.functionObject().lineno)
537 elif isinstance(itm, BrowserClassAttributeItem): 540 elif isinstance(itm, BrowserClassAttributeItem):
538 self.emit(SIGNAL('sourceFile'), itm.fileName(), 541 self.sourceFile[str, int].emit(
539 itm.attributeObject().lineno) 542 itm.fileName(), itm.attributeObject().lineno)
540 543
541 def __addNewPackage(self): 544 def __addNewPackage(self):
542 """ 545 """
543 Private method to add a new package to the project. 546 Private method to add a new package to the project.
544 """ 547 """
592 QMessageBox.StandardButtons(\ 595 QMessageBox.StandardButtons(\
593 QMessageBox.Ok)) 596 QMessageBox.Ok))
594 return 597 return
595 self.project.appendFile(packageFile) 598 self.project.appendFile(packageFile)
596 if packageFile: 599 if packageFile:
597 self.emit(SIGNAL('sourceFile'), packageFile) 600 self.sourceFile[str].emit(packageFile)
598 601
599 def __addSourceFiles(self): 602 def __addSourceFiles(self):
600 """ 603 """
601 Private method to add a source file to the project. 604 Private method to add a source file to the project.
602 """ 605 """

eric ide

mercurial