521 def initFileTypes(self): |
521 def initFileTypes(self): |
522 """ |
522 """ |
523 Public method to initialize the filetype associations with default |
523 Public method to initialize the filetype associations with default |
524 values. |
524 values. |
525 """ |
525 """ |
526 self.pdata["FILETYPES"] = {} |
526 self.pdata["FILETYPES"] = { |
|
527 "*.txt": "OTHERS", |
|
528 "*.md": "OTHERS", |
|
529 "*.rst": "OTHERS", |
|
530 "README": "OTHERS", |
|
531 "README.*": "OTHERS", |
|
532 "*.e4p": "OTHERS", |
|
533 } |
|
534 |
|
535 # Sources |
527 if self.pdata["MIXEDLANGUAGE"]: |
536 if self.pdata["MIXEDLANGUAGE"]: |
528 sourceKey = "Mixed" |
537 sourceKey = "Mixed" |
529 else: |
538 else: |
530 sourceKey = self.pdata["PROGLANGUAGE"] |
539 sourceKey = self.pdata["PROGLANGUAGE"] |
531 for ext in self.__sourceExtensions(sourceKey): |
540 for ext in self.__sourceExtensions(sourceKey): |
532 self.pdata["FILETYPES"]["*{0}".format(ext)] = "SOURCES" |
541 self.pdata["FILETYPES"]["*{0}".format(ext)] = "SOURCES" |
|
542 |
|
543 # IDL interfaces |
533 self.pdata["FILETYPES"]["*.idl"] = "INTERFACES" |
544 self.pdata["FILETYPES"]["*.idl"] = "INTERFACES" |
|
545 |
|
546 # Forms |
534 if self.pdata["PROJECTTYPE"] in ["Qt4", "PyQt5", |
547 if self.pdata["PROJECTTYPE"] in ["Qt4", "PyQt5", |
535 "E6Plugin", "PySide"]: |
548 "E6Plugin", "PySide"]: |
536 self.pdata["FILETYPES"]["*.ui"] = "FORMS" |
549 self.pdata["FILETYPES"]["*.ui"] = "FORMS" |
|
550 |
|
551 # Resources |
537 if self.pdata["PROJECTTYPE"] in ["Qt4", "Qt4C", |
552 if self.pdata["PROJECTTYPE"] in ["Qt4", "Qt4C", |
538 "E6Plugin", |
553 "E6Plugin", |
539 "PyQt5", "PyQt5C", |
554 "PyQt5", "PyQt5C", |
540 "PySide", "PySideC"]: |
555 "PySide", "PySideC"]: |
541 self.pdata["FILETYPES"]["*.qrc"] = "RESOURCES" |
556 self.pdata["FILETYPES"]["*.qrc"] = "RESOURCES" |
|
557 |
|
558 # Translations |
542 if self.pdata["PROJECTTYPE"] in ["Qt4", "Qt4C", |
559 if self.pdata["PROJECTTYPE"] in ["Qt4", "Qt4C", |
543 "E6Plugin", |
560 "E6Plugin", |
544 "PyQt5", "PyQt5C", |
561 "PyQt5", "PyQt5C", |
545 "PySide", "PySideC"]: |
562 "PySide", "PySideC"]: |
546 self.pdata["FILETYPES"]["*.ts"] = "TRANSLATIONS" |
563 self.pdata["FILETYPES"]["*.ts"] = "TRANSLATIONS" |
547 self.pdata["FILETYPES"]["*.qm"] = "TRANSLATIONS" |
564 self.pdata["FILETYPES"]["*.qm"] = "TRANSLATIONS" |
|
565 |
|
566 # Project type specific ones |
548 try: |
567 try: |
549 if self.__fileTypeCallbacks[ |
568 if self.__fileTypeCallbacks[ |
550 self.pdata["PROJECTTYPE"]] is not None: |
569 self.pdata["PROJECTTYPE"]] is not None: |
551 ftypes = \ |
570 ftypes = \ |
552 self.__fileTypeCallbacks[self.pdata["PROJECTTYPE"]]() |
571 self.__fileTypeCallbacks[self.pdata["PROJECTTYPE"]]() |
553 self.pdata["FILETYPES"].update(ftypes) |
572 self.pdata["FILETYPES"].update(ftypes) |
554 except KeyError: |
573 except KeyError: |
555 pass |
574 pass |
|
575 |
556 self.setDirty(True) |
576 self.setDirty(True) |
557 |
577 |
558 def updateFileTypes(self): |
578 def updateFileTypes(self): |
559 """ |
579 """ |
560 Public method to update the filetype associations with new default |
580 Public method to update the filetype associations with new default |