101 the project |
101 the project |
102 @signal prepareRepopulateItem(string) emitted before an item of the model is |
102 @signal prepareRepopulateItem(string) emitted before an item of the model is |
103 repopulated |
103 repopulated |
104 @signal completeRepopulateItem(string) emitted after an item of the model was |
104 @signal completeRepopulateItem(string) emitted after an item of the model was |
105 repopulated |
105 repopulated |
106 @signal vcsStatusMonitorStatus(QString, QString) emitted to signal the status of the |
106 @signal vcsStatusMonitorStatus(string, string) emitted to signal the status of the |
107 monitoring thread (ok, nok, op, off) and a status message |
107 monitoring thread (ok, nok, op, off) and a status message |
108 @signal reinitVCS() emitted after the VCS has been reinitialized |
108 @signal reinitVCS() emitted after the VCS has been reinitialized |
109 @signal showMenu(string, QMenu) emitted when a menu is about to be shown. The name |
109 @signal showMenu(string, QMenu) emitted when a menu is about to be shown. The name |
110 of the menu and a reference to the menu are given. |
110 of the menu and a reference to the menu are given. |
111 @signal lexerAssociationsChanged() emitted after the lexer associations have been |
111 @signal lexerAssociationsChanged() emitted after the lexer associations have been |
112 changed |
112 changed |
113 """ |
113 """ |
|
114 dirty = pyqtSignal(int) |
|
115 projectLanguageAdded = pyqtSignal(str) |
|
116 projectLanguageAddedByCode = pyqtSignal(str) |
|
117 projectFormAdded = pyqtSignal(str) |
|
118 projectSourceAdded = pyqtSignal(str) |
|
119 projectInterfaceAdded = pyqtSignal(str) |
|
120 projectResourceAdded = pyqtSignal(str) |
|
121 projectOthersAdded = pyqtSignal(str) |
|
122 projectAboutToBeCreated = pyqtSignal() |
|
123 newProjectHooks = pyqtSignal() |
|
124 newProject = pyqtSignal() |
114 sourceFile = pyqtSignal(str) |
125 sourceFile = pyqtSignal(str) |
|
126 projectOpenedHooks = pyqtSignal() |
115 projectOpened = pyqtSignal() |
127 projectOpened = pyqtSignal() |
116 newProject = pyqtSignal() |
128 projectClosedHooks = pyqtSignal() |
117 projectClosed = pyqtSignal() |
129 projectClosed = pyqtSignal() |
|
130 projectFileRenamed = pyqtSignal(str, str) |
|
131 projectPropertiesChanged = pyqtSignal() |
|
132 directoryRemoved = pyqtSignal(str) |
|
133 prepareRepopulateItem = pyqtSignal(str) |
|
134 completeRepopulateItem = pyqtSignal(str) |
|
135 vcsStatusMonitorStatus = pyqtSignal(str, str) |
|
136 reinitVCS = pyqtSignal() |
|
137 showMenu = pyqtSignal(str, QMenu) |
|
138 lexerAssociationsChanged = pyqtSignal() |
118 |
139 |
119 keynames = [ |
140 keynames = [ |
120 "PROGLANGUAGE", "MIXEDLANGUAGE", "PROJECTTYPE", |
141 "PROGLANGUAGE", "MIXEDLANGUAGE", "PROJECTTYPE", |
121 "SPELLLANGUAGE", "SPELLWORDS", "SPELLEXCLUDES", |
142 "SPELLLANGUAGE", "SPELLWORDS", "SPELLEXCLUDES", |
122 "DESCRIPTION", "VERSION", "HASH", |
143 "DESCRIPTION", "VERSION", "HASH", |
1513 lang = dlg.getSelectedLanguage() |
1534 lang = dlg.getSelectedLanguage() |
1514 if self.pdata["PROJECTTYPE"][0] in \ |
1535 if self.pdata["PROJECTTYPE"][0] in \ |
1515 ["Qt4", "Qt4C", "E4Plugin", "PySide", "PySideC"]: |
1536 ["Qt4", "Qt4C", "E4Plugin", "PySide", "PySideC"]: |
1516 langFile = self.pdata["TRANSLATIONPATTERN"][0].replace("%language%", lang) |
1537 langFile = self.pdata["TRANSLATIONPATTERN"][0].replace("%language%", lang) |
1517 self.appendFile(langFile) |
1538 self.appendFile(langFile) |
1518 self.emit(SIGNAL("projectLanguageAddedByCode"), lang) |
1539 self.projectLanguageAddedByCode.emit(lang) |
1519 |
1540 |
1520 def __binaryTranslationFile(self, langFile): |
1541 def __binaryTranslationFile(self, langFile): |
1521 """ |
1542 """ |
1522 Private method to calculate the filename of the binary translations file |
1543 Private method to calculate the filename of the binary translations file |
1523 given the name of the raw translations file. |
1544 given the name of the raw translations file. |
1655 |
1676 |
1656 if filetype in ["SOURCES", "FORMS", "INTERFACES", "RESOURCES"]: |
1677 if filetype in ["SOURCES", "FORMS", "INTERFACES", "RESOURCES"]: |
1657 if filetype == "SOURCES": |
1678 if filetype == "SOURCES": |
1658 if newfn not in self.pdata["SOURCES"]: |
1679 if newfn not in self.pdata["SOURCES"]: |
1659 self.pdata["SOURCES"].append(newfn) |
1680 self.pdata["SOURCES"].append(newfn) |
1660 self.emit(SIGNAL('projectSourceAdded'), newfn) |
1681 self.projectSourceAdded.emit(newfn) |
1661 updateModel and self.__model.addNewItem("SOURCES", newfn) |
1682 updateModel and self.__model.addNewItem("SOURCES", newfn) |
1662 dirty = True |
1683 dirty = True |
1663 else: |
1684 else: |
1664 updateModel and self.repopulateItem(newfn) |
1685 updateModel and self.repopulateItem(newfn) |
1665 elif filetype == "FORMS": |
1686 elif filetype == "FORMS": |
1666 if newfn not in self.pdata["FORMS"]: |
1687 if newfn not in self.pdata["FORMS"]: |
1667 self.pdata["FORMS"].append(newfn) |
1688 self.pdata["FORMS"].append(newfn) |
1668 self.emit(SIGNAL('projectFormAdded'), newfn) |
1689 self.projectFormAdded.emit(newfn) |
1669 updateModel and self.__model.addNewItem("FORMS", newfn) |
1690 updateModel and self.__model.addNewItem("FORMS", newfn) |
1670 dirty = True |
1691 dirty = True |
1671 else: |
1692 else: |
1672 updateModel and self.repopulateItem(newfn) |
1693 updateModel and self.repopulateItem(newfn) |
1673 elif filetype == "INTERFACES": |
1694 elif filetype == "INTERFACES": |
1674 if newfn not in self.pdata["INTERFACES"]: |
1695 if newfn not in self.pdata["INTERFACES"]: |
1675 self.pdata["INTERFACES"].append(newfn) |
1696 self.pdata["INTERFACES"].append(newfn) |
1676 self.emit(SIGNAL('projectInterfaceAdded'), newfn) |
1697 self.projectInterfaceAdded.emit(newfn) |
1677 updateModel and self.__model.addNewItem("INTERFACES", newfn) |
1698 updateModel and self.__model.addNewItem("INTERFACES", newfn) |
1678 dirty = True |
1699 dirty = True |
1679 else: |
1700 else: |
1680 updateModel and self.repopulateItem(newfn) |
1701 updateModel and self.repopulateItem(newfn) |
1681 elif filetype == "RESOURCES": |
1702 elif filetype == "RESOURCES": |
1682 if newfn not in self.pdata["RESOURCES"]: |
1703 if newfn not in self.pdata["RESOURCES"]: |
1683 self.pdata["RESOURCES"].append(newfn) |
1704 self.pdata["RESOURCES"].append(newfn) |
1684 self.emit(SIGNAL('projectResourceAdded'), newfn) |
1705 self.projectResourceAdded.emit(newfn) |
1685 updateModel and self.__model.addNewItem("RESOURCES", newfn) |
1706 updateModel and self.__model.addNewItem("RESOURCES", newfn) |
1686 dirty = True |
1707 dirty = True |
1687 else: |
1708 else: |
1688 updateModel and self.repopulateItem(newfn) |
1709 updateModel and self.repopulateItem(newfn) |
1689 if newdir not in self.subdirs: |
1710 if newdir not in self.subdirs: |
1690 self.subdirs.append(newdir) |
1711 self.subdirs.append(newdir) |
1691 elif filetype == "TRANSLATIONS": |
1712 elif filetype == "TRANSLATIONS": |
1692 if newfn not in self.pdata["TRANSLATIONS"]: |
1713 if newfn not in self.pdata["TRANSLATIONS"]: |
1693 self.pdata["TRANSLATIONS"].append(newfn) |
1714 self.pdata["TRANSLATIONS"].append(newfn) |
1694 updateModel and self.__model.addNewItem("TRANSLATIONS", newfn) |
1715 updateModel and self.__model.addNewItem("TRANSLATIONS", newfn) |
1695 self.emit(SIGNAL('projectLanguageAdded'), newfn) |
1716 self.projectLanguageAdded.emit(newfn) |
1696 dirty = True |
1717 dirty = True |
1697 else: |
1718 else: |
1698 updateModel and self.repopulateItem(newfn) |
1719 updateModel and self.repopulateItem(newfn) |
1699 else: # filetype == "OTHERS" |
1720 else: # filetype == "OTHERS" |
1700 if newfn not in self.pdata["OTHERS"]: |
1721 if newfn not in self.pdata["OTHERS"]: |
2058 self.appendFile(newname, isSourceFile, False) |
2079 self.appendFile(newname, isSourceFile, False) |
2059 self.__model.renameItem(fn, newname) |
2080 self.__model.renameItem(fn, newname) |
2060 else: |
2081 else: |
2061 self.removeFile(oldname) |
2082 self.removeFile(oldname) |
2062 self.appendFile(newname, isSourceFile) |
2083 self.appendFile(newname, isSourceFile) |
2063 self.emit(SIGNAL('projectFileRenamed'), oldname, newname) |
2084 self.projectFileRenamed.emit(oldname, newname) |
2064 |
2085 |
2065 self.renameMainScript(fn, newname) |
2086 self.renameMainScript(fn, newname) |
2066 |
2087 |
2067 def getFiles(self, start): |
2088 def getFiles(self, start): |
2068 """ |
2089 """ |
2285 self.menuDiagramAct.setEnabled(True) |
2306 self.menuDiagramAct.setEnabled(True) |
2286 self.menuApidocAct.setEnabled(True) |
2307 self.menuApidocAct.setEnabled(True) |
2287 self.menuPackagersAct.setEnabled(True) |
2308 self.menuPackagersAct.setEnabled(True) |
2288 self.pluginGrp.setEnabled(self.pdata["PROJECTTYPE"][0] == "E4Plugin") |
2309 self.pluginGrp.setEnabled(self.pdata["PROJECTTYPE"][0] == "E4Plugin") |
2289 |
2310 |
2290 self.emit(SIGNAL("projectAboutToBeCreated")) |
2311 self.projectAboutToBeCreated.emit() |
2291 |
2312 |
2292 hash = str(QCryptographicHash.hash( |
2313 hash = str(QCryptographicHash.hash( |
2293 QByteArray(self.ppath), QCryptographicHash.Sha1).toHex(), |
2314 QByteArray(self.ppath), QCryptographicHash.Sha1).toHex(), |
2294 encoding = "utf-8") |
2315 encoding = "utf-8") |
2295 self.pdata["HASH"] = [hash] |
2316 self.pdata["HASH"] = [hash] |
2474 # create the project in the VCS |
2495 # create the project in the VCS |
2475 self.vcs.vcsSetDataFromDict(vcsDataDict) |
2496 self.vcs.vcsSetDataFromDict(vcsDataDict) |
2476 self.saveProject() |
2497 self.saveProject() |
2477 self.vcs.vcsConvertProject(vcsDataDict, self) |
2498 self.vcs.vcsConvertProject(vcsDataDict, self) |
2478 else: |
2499 else: |
2479 self.emit(SIGNAL('newProjectHooks')) |
2500 self.newProjectHooks.emit() |
2480 self.newProject.emit() |
2501 self.newProject.emit() |
2481 |
2502 |
2482 else: |
2503 else: |
2483 self.emit(SIGNAL('newProjectHooks')) |
2504 self.newProjectHooks.emit() |
2484 self.newProject.emit() |
2505 self.newProject.emit() |
2485 |
2506 |
2486 |
2507 |
2487 def newProjectAddFiles(self, mainscript): |
2508 def newProjectAddFiles(self, mainscript): |
2488 """ |
2509 """ |
2543 self.getRelativePath(self.pdata["TRANSLATIONPATTERN"][0]) |
2564 self.getRelativePath(self.pdata["TRANSLATIONPATTERN"][0]) |
2544 pattern = self.pdata["TRANSLATIONPATTERN"][0].replace("%language%", "*") |
2565 pattern = self.pdata["TRANSLATIONPATTERN"][0].replace("%language%", "*") |
2545 for ts in tslist: |
2566 for ts in tslist: |
2546 if fnmatch.fnmatch(ts, pattern): |
2567 if fnmatch.fnmatch(ts, pattern): |
2547 self.pdata["TRANSLATIONS"].append(ts) |
2568 self.pdata["TRANSLATIONS"].append(ts) |
2548 self.emit(SIGNAL('projectLanguageAdded'), ts) |
2569 self.projectLanguageAdded.emit(ts) |
2549 if len(self.pdata["MAINSCRIPT"]) == 0 or \ |
2570 if len(self.pdata["MAINSCRIPT"]) == 0 or \ |
2550 len(self.pdata["MAINSCRIPT"][0]) == 0: |
2571 len(self.pdata["MAINSCRIPT"][0]) == 0: |
2551 if self.pdata["PROGLANGUAGE"][0] in ["Python", "Python3"]: |
2572 if self.pdata["PROGLANGUAGE"][0] in ["Python", "Python3"]: |
2552 self.pdata["MAINSCRIPT"] = ['{0}.py'.format(mainscriptname)] |
2573 self.pdata["MAINSCRIPT"] = ['{0}.py'.format(mainscriptname)] |
2553 elif self.pdata["PROGLANGUAGE"][0] == "Ruby": |
2574 elif self.pdata["PROGLANGUAGE"][0] == "Ruby": |
2559 os.path.basename(self.pdata["TRANSLATIONPATTERN"][0])) |
2580 os.path.basename(self.pdata["TRANSLATIONPATTERN"][0])) |
2560 pattern = self.__binaryTranslationFile(pattern) |
2581 pattern = self.__binaryTranslationFile(pattern) |
2561 qmlist = Utilities.direntries(tpd, True, pattern) |
2582 qmlist = Utilities.direntries(tpd, True, pattern) |
2562 for qm in qmlist: |
2583 for qm in qmlist: |
2563 self.pdata["TRANSLATIONS"].append(qm) |
2584 self.pdata["TRANSLATIONS"].append(qm) |
2564 self.emit(SIGNAL('projectLanguageAdded'), qm) |
2585 self.projectLanguageAdded.emit(qm) |
2565 self.setDirty(True) |
2586 self.setDirty(True) |
2566 QApplication.restoreOverrideCursor() |
2587 QApplication.restoreOverrideCursor() |
2567 |
2588 |
2568 def __showProperties(self): |
2589 def __showProperties(self): |
2569 """ |
2590 """ |
2627 (vcsSystemOverride is not None and \ |
2648 (vcsSystemOverride is not None and \ |
2628 len(self.pudata["VCSOVERRIDE"]) == 0): |
2649 len(self.pudata["VCSOVERRIDE"]) == 0): |
2629 # stop the VCS monitor thread and shutdown VCS |
2650 # stop the VCS monitor thread and shutdown VCS |
2630 if self.vcs is not None: |
2651 if self.vcs is not None: |
2631 self.vcs.stopStatusMonitor() |
2652 self.vcs.stopStatusMonitor() |
2632 self.disconnect(self.vcs, |
2653 self.vcs.vcsStatusMonitorData.disconnect(self.__model.changeVCSStates) |
2633 SIGNAL("vcsStatusMonitorData(QStringList)"), |
2654 self.vcs.vcsStatusMonitorStatus.disconnect(self.__statusMonitorStatus) |
2634 self.__model.changeVCSStates) |
|
2635 self.disconnect(self.vcs, |
|
2636 SIGNAL("vcsStatusMonitorStatus(QString, QString)"), |
|
2637 self.__statusMonitorStatus) |
|
2638 self.vcs.vcsShutdown() |
2655 self.vcs.vcsShutdown() |
2639 self.vcs = None |
2656 self.vcs = None |
2640 e5App().getObject("PluginManager").deactivateVcsPlugins() |
2657 e5App().getObject("PluginManager").deactivateVcsPlugins() |
2641 # reinit VCS |
2658 # reinit VCS |
2642 self.vcs = self.initVCS() |
2659 self.vcs = self.initVCS() |
2643 # start the VCS monitor thread |
2660 # start the VCS monitor thread |
2644 if self.vcs is not None: |
2661 if self.vcs is not None: |
2645 self.vcs.startStatusMonitor(self) |
2662 self.vcs.startStatusMonitor(self) |
2646 self.connect(self.vcs, |
2663 self.vcs.vcsStatusMonitorData.connect(self.__model.changeVCSStates) |
2647 SIGNAL("vcsStatusMonitorData(QStringList)"), |
2664 self.vcs.vcsStatusMonitorStatus.connect(self.__statusMonitorStatus) |
2648 self.__model.changeVCSStates) |
2665 self.reinitVCS.emit() |
2649 self.connect(self.vcs, |
|
2650 SIGNAL("vcsStatusMonitorStatus(QString, QString)"), |
|
2651 self.__statusMonitorStatus) |
|
2652 self.emit(SIGNAL("reinitVCS")) |
|
2653 |
2666 |
2654 if self.pudata["VCSSTATUSMONITORINTERVAL"]: |
2667 if self.pudata["VCSSTATUSMONITORINTERVAL"]: |
2655 self.setStatusMonitorInterval(\ |
2668 self.setStatusMonitorInterval(\ |
2656 self.pudata["VCSSTATUSMONITORINTERVAL"][0]) |
2669 self.pudata["VCSSTATUSMONITORINTERVAL"][0]) |
2657 else: |
2670 else: |
2832 self.__readDebugProperties(True) |
2845 self.__readDebugProperties(True) |
2833 |
2846 |
2834 # start the VCS monitor thread |
2847 # start the VCS monitor thread |
2835 if self.vcs is not None: |
2848 if self.vcs is not None: |
2836 self.vcs.startStatusMonitor(self) |
2849 self.vcs.startStatusMonitor(self) |
2837 self.connect(self.vcs, |
2850 self.vcs.vcsStatusMonitorData.connect( |
2838 SIGNAL("vcsStatusMonitorData(QStringList)"), |
2851 self.__model.changeVCSStates) |
2839 self.__model.changeVCSStates) |
2852 self.vcs.vcsStatusMonitorStatus.connect( |
2840 self.connect(self.vcs, |
2853 self.__statusMonitorStatus) |
2841 SIGNAL("vcsStatusMonitorStatus(QString, QString)"), |
|
2842 self.__statusMonitorStatus) |
|
2843 else: |
2854 else: |
2844 QApplication.restoreOverrideCursor() |
2855 QApplication.restoreOverrideCursor() |
2845 |
2856 |
2846 def reopenProject(self): |
2857 def reopenProject(self): |
2847 """ |
2858 """ |
3001 return False |
3012 return False |
3002 |
3013 |
3003 # stop the VCS monitor thread |
3014 # stop the VCS monitor thread |
3004 if self.vcs is not None: |
3015 if self.vcs is not None: |
3005 self.vcs.stopStatusMonitor() |
3016 self.vcs.stopStatusMonitor() |
3006 self.disconnect(self.vcs, |
3017 self.vcs.vcsStatusMonitorData.disconnect(self.__model.changeVCSStates) |
3007 SIGNAL("vcsStatusMonitorData(QStringList)"), |
3018 self.vcs.vcsStatusMonitorStatus.disconnect(self.__statusMonitorStatus) |
3008 self.__model.changeVCSStates) |
|
3009 self.disconnect(self.vcs, |
|
3010 SIGNAL("vcsStatusMonitorStatus(QString, QString)"), |
|
3011 self.__statusMonitorStatus) |
|
3012 |
3019 |
3013 # now save the tasks |
3020 # now save the tasks |
3014 if not noSave: |
3021 if not noSave: |
3015 self.__writeTasks() |
3022 self.__writeTasks() |
3016 self.ui.taskViewer.clearProjectTasks() |
3023 self.ui.taskViewer.clearProjectTasks() |
3734 self.vcsMenu = QMenu(self.trUtf8('&Version Control'), menu) |
3741 self.vcsMenu = QMenu(self.trUtf8('&Version Control'), menu) |
3735 self.vcsMenu.setTearOffEnabled(True) |
3742 self.vcsMenu.setTearOffEnabled(True) |
3736 self.vcsProjectHelper.initMenu(self.vcsMenu) |
3743 self.vcsProjectHelper.initMenu(self.vcsMenu) |
3737 self.checksMenu = QMenu(self.trUtf8('Chec&k'), menu) |
3744 self.checksMenu = QMenu(self.trUtf8('Chec&k'), menu) |
3738 self.checksMenu.setTearOffEnabled(True) |
3745 self.checksMenu.setTearOffEnabled(True) |
3739 self.showMenu = QMenu(self.trUtf8('Sho&w'), menu) |
3746 self.menuShow = QMenu(self.trUtf8('Sho&w'), menu) |
3740 self.graphicsMenu = QMenu(self.trUtf8('&Diagrams'), menu) |
3747 self.graphicsMenu = QMenu(self.trUtf8('&Diagrams'), menu) |
3741 self.sessionMenu = QMenu(self.trUtf8('Session'), menu) |
3748 self.sessionMenu = QMenu(self.trUtf8('Session'), menu) |
3742 self.apidocMenu = QMenu(self.trUtf8('Source &Documentation'), menu) |
3749 self.apidocMenu = QMenu(self.trUtf8('Source &Documentation'), menu) |
3743 self.apidocMenu.setTearOffEnabled(True) |
3750 self.apidocMenu.setTearOffEnabled(True) |
3744 self.debuggerMenu = QMenu(self.trUtf8('Debugger'), menu) |
3751 self.debuggerMenu = QMenu(self.trUtf8('Debugger'), menu) |
3748 self.__menus = { |
3755 self.__menus = { |
3749 "Main" : menu, |
3756 "Main" : menu, |
3750 "Recent" : self.recentMenu, |
3757 "Recent" : self.recentMenu, |
3751 "VCS" : self.vcsMenu, |
3758 "VCS" : self.vcsMenu, |
3752 "Checks" : self.checksMenu, |
3759 "Checks" : self.checksMenu, |
3753 "Show" : self.showMenu, |
3760 "Show" : self.menuShow, |
3754 "Graphics" : self.graphicsMenu, |
3761 "Graphics" : self.graphicsMenu, |
3755 "Session" : self.sessionMenu, |
3762 "Session" : self.sessionMenu, |
3756 "Apidoc" : self.apidocMenu, |
3763 "Apidoc" : self.apidocMenu, |
3757 "Debugger" : self.debuggerMenu, |
3764 "Debugger" : self.debuggerMenu, |
3758 "Packagers" : self.packagersMenu, |
3765 "Packagers" : self.packagersMenu, |
3759 } |
3766 } |
3760 |
3767 |
3761 # connect the aboutToShow signals |
3768 # connect the aboutToShow signals |
3762 self.recentMenu.aboutToShow.connect(self.__showContextMenuRecent) |
3769 self.recentMenu.aboutToShow.connect(self.__showContextMenuRecent) |
3763 self.connect(self.recentMenu, SIGNAL('triggered(QAction *)'), |
3770 self.recentMenu.triggered.connect(self.__openRecent) |
3764 self.__openRecent) |
|
3765 self.vcsMenu.aboutToShow.connect(self.__showContextMenuVCS) |
3771 self.vcsMenu.aboutToShow.connect(self.__showContextMenuVCS) |
3766 self.checksMenu.aboutToShow.connect(self.__showContextMenuChecks) |
3772 self.checksMenu.aboutToShow.connect(self.__showContextMenuChecks) |
3767 self.showMenu.aboutToShow.connect(self.__showContextMenuShow) |
3773 self.menuShow.aboutToShow.connect(self.__showContextMenuShow) |
3768 self.graphicsMenu.aboutToShow.connect(self.__showContextMenuGraphics) |
3774 self.graphicsMenu.aboutToShow.connect(self.__showContextMenuGraphics) |
3769 self.apidocMenu.aboutToShow.connect(self.__showContextMenuApiDoc) |
3775 self.apidocMenu.aboutToShow.connect(self.__showContextMenuApiDoc) |
3770 self.packagersMenu.aboutToShow.connect(self.__showContextMenuPackagers) |
3776 self.packagersMenu.aboutToShow.connect(self.__showContextMenuPackagers) |
3771 menu.aboutToShow.connect(self.__showMenu) |
3777 menu.aboutToShow.connect(self.__showMenu) |
3772 |
3778 |
3773 # build the show menu |
3779 # build the show menu |
3774 self.showMenu.setTearOffEnabled(True) |
3780 self.menuShow.setTearOffEnabled(True) |
3775 self.showMenu.addAction(self.codeMetricsAct) |
3781 self.menuShow.addAction(self.codeMetricsAct) |
3776 self.showMenu.addAction(self.codeCoverageAct) |
3782 self.menuShow.addAction(self.codeCoverageAct) |
3777 self.showMenu.addAction(self.codeProfileAct) |
3783 self.menuShow.addAction(self.codeProfileAct) |
3778 |
3784 |
3779 # build the diagrams menu |
3785 # build the diagrams menu |
3780 self.graphicsMenu.setTearOffEnabled(True) |
3786 self.graphicsMenu.setTearOffEnabled(True) |
3781 self.graphicsMenu.addAction(self.applicationDiagramAct) |
3787 self.graphicsMenu.addAction(self.applicationDiagramAct) |
3782 |
3788 |
4041 Public slot to be called, if something was added to the OTHERS project data area. |
4047 Public slot to be called, if something was added to the OTHERS project data area. |
4042 |
4048 |
4043 @param fn filename or directory name added (string) |
4049 @param fn filename or directory name added (string) |
4044 @param updateModel flag indicating an update of the model is requested (boolean) |
4050 @param updateModel flag indicating an update of the model is requested (boolean) |
4045 """ |
4051 """ |
4046 self.emit(SIGNAL('projectOthersAdded'), fn) |
4052 self.projectOthersAdded.emit(fn) |
4047 updateModel and self.__model.addNewItem("OTHERS", fn) |
4053 updateModel and self.__model.addNewItem("OTHERS", fn) |
4048 |
4054 |
4049 def getActions(self): |
4055 def getActions(self): |
4050 """ |
4056 """ |
4051 Public method to get a list of all actions. |
4057 Public method to get a list of all actions. |
4094 """ |
4100 """ |
4095 if not self.isOpen(): |
4101 if not self.isOpen(): |
4096 return |
4102 return |
4097 |
4103 |
4098 name = self.getRelativePath(fullname) |
4104 name = self.getRelativePath(fullname) |
4099 self.emit(SIGNAL("prepareRepopulateItem"), name) |
4105 self.prepareRepopulateItem.emit(name) |
4100 self.__model.repopulateItem(name) |
4106 self.__model.repopulateItem(name) |
4101 self.emit(SIGNAL("completeRepopulateItem"), name) |
4107 self.completeRepopulateItem.emit(name) |
4102 |
4108 |
4103 ############################################################## |
4109 ############################################################## |
4104 ## Below is the VCS interface |
4110 ## Below is the VCS interface |
4105 ############################################################## |
4111 ############################################################## |
4106 |
4112 |
4192 """ |
4198 """ |
4193 Private slot called before the vcs menu is shown. |
4199 Private slot called before the vcs menu is shown. |
4194 """ |
4200 """ |
4195 self.vcsProjectHelper.showMenu() |
4201 self.vcsProjectHelper.showMenu() |
4196 if self.vcsBasicHelper: |
4202 if self.vcsBasicHelper: |
4197 self.emit(SIGNAL("showMenu"), "VCS", self.vcsMenu) |
4203 self.showMenu.emit("VCS", self.vcsMenu) |
4198 |
4204 |
4199 ######################################################################### |
4205 ######################################################################### |
4200 ## Below is the interface to the checker tools |
4206 ## Below is the interface to the checker tools |
4201 ######################################################################### |
4207 ######################################################################### |
4202 |
4208 |
4203 def __showContextMenuChecks(self): |
4209 def __showContextMenuChecks(self): |
4204 """ |
4210 """ |
4205 Private slot called before the checks menu is shown. |
4211 Private slot called before the checks menu is shown. |
4206 """ |
4212 """ |
4207 self.emit(SIGNAL("showMenu"), "Checks", self.checksMenu) |
4213 self.showMenu.emit("Checks", self.checksMenu) |
4208 |
4214 |
4209 ######################################################################### |
4215 ######################################################################### |
4210 ## Below is the interface to the packagers tools |
4216 ## Below is the interface to the packagers tools |
4211 ######################################################################### |
4217 ######################################################################### |
4212 |
4218 |
4213 def __showContextMenuPackagers(self): |
4219 def __showContextMenuPackagers(self): |
4214 """ |
4220 """ |
4215 Private slot called before the packagers menu is shown. |
4221 Private slot called before the packagers menu is shown. |
4216 """ |
4222 """ |
4217 self.emit(SIGNAL("showMenu"), "Packagers", self.packagersMenu) |
4223 self.showMenu.emit("Packagers", self.packagersMenu) |
4218 |
4224 |
4219 ######################################################################### |
4225 ######################################################################### |
4220 ## Below is the interface to the apidoc tools |
4226 ## Below is the interface to the apidoc tools |
4221 ######################################################################### |
4227 ######################################################################### |
4222 |
4228 |
4223 def __showContextMenuApiDoc(self): |
4229 def __showContextMenuApiDoc(self): |
4224 """ |
4230 """ |
4225 Private slot called before the apidoc menu is shown. |
4231 Private slot called before the apidoc menu is shown. |
4226 """ |
4232 """ |
4227 self.emit(SIGNAL("showMenu"), "Apidoc", self.apidocMenu) |
4233 self.showMenu.emit("Apidoc", self.apidocMenu) |
4228 |
4234 |
4229 ######################################################################### |
4235 ######################################################################### |
4230 ## Below is the interface to the show tools |
4236 ## Below is the interface to the show tools |
4231 ######################################################################### |
4237 ######################################################################### |
4232 |
4238 |
4348 os.path.isfile("{0}.coverage".format(tbasename)))) |
4354 os.path.isfile("{0}.coverage".format(tbasename)))) |
4349 else: |
4355 else: |
4350 self.codeProfileAct.setEnabled(False) |
4356 self.codeProfileAct.setEnabled(False) |
4351 self.codeCoverageAct.setEnabled(False) |
4357 self.codeCoverageAct.setEnabled(False) |
4352 |
4358 |
4353 self.emit(SIGNAL("showMenu"), "Show", self.showMenu) |
4359 self.showMenu.emit("Show", self.menuShow) |
4354 |
4360 |
4355 ######################################################################### |
4361 ######################################################################### |
4356 ## Below is the interface to the diagrams |
4362 ## Below is the interface to the diagrams |
4357 ######################################################################### |
4363 ######################################################################### |
4358 |
4364 |
4359 def __showContextMenuGraphics(self): |
4365 def __showContextMenuGraphics(self): |
4360 """ |
4366 """ |
4361 Private slot called before the graphics menu is shown. |
4367 Private slot called before the graphics menu is shown. |
4362 """ |
4368 """ |
4363 self.emit(SIGNAL("showMenu"), "Graphics", self.graphicsMenu) |
4369 self.showMenu.emit("Graphics", self.graphicsMenu) |
4364 |
4370 |
4365 def handleApplicationDiagram(self): |
4371 def handleApplicationDiagram(self): |
4366 """ |
4372 """ |
4367 Private method to handle the application diagram context menu action. |
4373 Private method to handle the application diagram context menu action. |
4368 """ |
4374 """ |
4389 It simply reemits the received status. |
4395 It simply reemits the received status. |
4390 |
4396 |
4391 @param status status of the monitoring thread (string, ok, nok or off) |
4397 @param status status of the monitoring thread (string, ok, nok or off) |
4392 @param statusMsg explanotory text for the signaled status (string) |
4398 @param statusMsg explanotory text for the signaled status (string) |
4393 """ |
4399 """ |
4394 self.emit(SIGNAL("vcsStatusMonitorStatus(QString, QString)"), status, statusMsg) |
4400 self.vcsStatusMonitorStatus.emit(status, statusMsg) |
4395 |
4401 |
4396 def setStatusMonitorInterval(self, interval): |
4402 def setStatusMonitorInterval(self, interval): |
4397 """ |
4403 """ |
4398 Public method to se the interval of the VCS status monitor thread. |
4404 Public method to se the interval of the VCS status monitor thread. |
4399 |
4405 |