21 import copy |
21 import copy |
22 import zipfile |
22 import zipfile |
23 |
23 |
24 from PyQt5.QtCore import pyqtSlot, QFile, QFileInfo, pyqtSignal, \ |
24 from PyQt5.QtCore import pyqtSlot, QFile, QFileInfo, pyqtSignal, \ |
25 QCryptographicHash, QIODevice, QByteArray, QObject, Qt |
25 QCryptographicHash, QIODevice, QByteArray, QObject, Qt |
26 from PyQt5.QtGui import QCursor |
26 from PyQt5.QtGui import QCursor, QKeySequence |
27 from PyQt5.QtWidgets import QLineEdit, QToolBar, QDialog, QInputDialog, \ |
27 from PyQt5.QtWidgets import QLineEdit, QToolBar, QDialog, QInputDialog, \ |
28 QApplication, QMenu, QAction |
28 QApplication, QMenu, QAction |
29 from PyQt5.Qsci import QsciScintilla |
29 from PyQt5.Qsci import QsciScintilla |
30 |
30 |
31 from E5Gui.E5Application import e5App |
31 from E5Gui.E5Application import e5App |
69 @signal newProjectHooks() emitted after a new project was generated but |
69 @signal newProjectHooks() emitted after a new project was generated but |
70 before the newProject() signal is sent |
70 before the newProject() signal is sent |
71 @signal newProject() emitted after a new project was generated |
71 @signal newProject() emitted after a new project was generated |
72 @signal sourceFile(str) emitted after a project file was read to |
72 @signal sourceFile(str) emitted after a project file was read to |
73 open the main script |
73 open the main script |
|
74 @signal designerFile(str) emitted to open a found designer file |
|
75 @signal linguistFile(str) emitted to open a found translation file |
74 @signal projectOpenedHooks() emitted after a project file was read but |
76 @signal projectOpenedHooks() emitted after a project file was read but |
75 before the projectOpened() signal is sent |
77 before the projectOpened() signal is sent |
76 @signal projectOpened() emitted after a project file was read |
78 @signal projectOpened() emitted after a project file was read |
77 @signal projectClosedHooks() emitted after a project file was closed but |
79 @signal projectClosedHooks() emitted after a project file was closed but |
78 before the projectClosed() signal is sent |
80 before the projectClosed() signal is sent |
113 projectOthersRemoved = pyqtSignal(str) |
115 projectOthersRemoved = pyqtSignal(str) |
114 projectAboutToBeCreated = pyqtSignal() |
116 projectAboutToBeCreated = pyqtSignal() |
115 newProjectHooks = pyqtSignal() |
117 newProjectHooks = pyqtSignal() |
116 newProject = pyqtSignal() |
118 newProject = pyqtSignal() |
117 sourceFile = pyqtSignal(str) |
119 sourceFile = pyqtSignal(str) |
|
120 designerFile = pyqtSignal(str) |
|
121 linguistFile = pyqtSignal(str) |
118 projectOpenedHooks = pyqtSignal() |
122 projectOpenedHooks = pyqtSignal() |
119 projectOpened = pyqtSignal() |
123 projectOpened = pyqtSignal() |
120 projectClosedHooks = pyqtSignal() |
124 projectClosedHooks = pyqtSignal() |
121 projectClosed = pyqtSignal() |
125 projectClosed = pyqtSignal() |
122 projectFileRenamed = pyqtSignal(str, str) |
126 projectFileRenamed = pyqtSignal(str, str) |
212 self.codemetrics = None |
216 self.codemetrics = None |
213 self.codecoverage = None |
217 self.codecoverage = None |
214 self.profiledata = None |
218 self.profiledata = None |
215 self.applicationDiagram = None |
219 self.applicationDiagram = None |
216 self.loadedDiagram = None |
220 self.loadedDiagram = None |
|
221 self.__findProjectFileDialog = None |
217 |
222 |
218 def __sourceExtensions(self, language): |
223 def __sourceExtensions(self, language): |
219 """ |
224 """ |
220 Private method to get the source extensions of a programming language. |
225 Private method to get the source extensions of a programming language. |
221 |
226 |
3546 """ the project directory and registered subdirectories.</p>""" |
3551 """ the project directory and registered subdirectories.</p>""" |
3547 )) |
3552 )) |
3548 act.triggered.connect(self.__searchNewFiles) |
3553 act.triggered.connect(self.__searchNewFiles) |
3549 self.actions.append(act) |
3554 self.actions.append(act) |
3550 |
3555 |
|
3556 act = E5Action( |
|
3557 self.tr('Search Project File'), |
|
3558 self.tr('Search Project File...'), |
|
3559 QKeySequence(self.tr("Alt+Ctrl+P", "Project|Search Project File")), |
|
3560 0, |
|
3561 self.actGrp2, 'project_search_project_file') |
|
3562 act.setStatusTip(self.tr( |
|
3563 'Search for a file in the project list of files.')) |
|
3564 act.setWhatsThis(self.tr( |
|
3565 """<b>Search Project File</b>""" |
|
3566 """<p>This searches for a file in the project list of files.</p>""" |
|
3567 )) |
|
3568 act.triggered.connect(self.__searchProjectFile) |
|
3569 self.actions.append(act) |
|
3570 |
3551 self.propsAct = E5Action( |
3571 self.propsAct = E5Action( |
3552 self.tr('Project properties'), |
3572 self.tr('Project properties'), |
3553 UI.PixmapCache.getIcon("projectProps.png"), |
3573 UI.PixmapCache.getIcon("projectProps.png"), |
3554 self.tr('&Properties...'), 0, 0, self, |
3574 self.tr('&Properties...'), 0, 0, self, |
3555 'project_properties') |
3575 'project_properties') |
4076 def __searchNewFiles(self): |
4096 def __searchNewFiles(self): |
4077 """ |
4097 """ |
4078 Private slot used to handle the search new files action. |
4098 Private slot used to handle the search new files action. |
4079 """ |
4099 """ |
4080 self.__doSearchNewFiles(False, True) |
4100 self.__doSearchNewFiles(False, True) |
|
4101 |
|
4102 def __searchProjectFile(self): |
|
4103 """ |
|
4104 Private slot to show the Find Project File dialog. |
|
4105 """ |
|
4106 if self.__findProjectFileDialog is None: |
|
4107 from .QuickFindFileDialog import QuickFindFileDialog |
|
4108 self.__findProjectFileDialog = QuickFindFileDialog(self) |
|
4109 self.__findProjectFileDialog.sourceFile.connect( |
|
4110 self.sourceFile) |
|
4111 self.__findProjectFileDialog.designerFile.connect( |
|
4112 self.designerFile) |
|
4113 self.__findProjectFileDialog.linguistFile.connect( |
|
4114 self.linguistFile) |
|
4115 self.__findProjectFileDialog.show() |
|
4116 self.__findProjectFileDialog.raise_() |
|
4117 self.__findProjectFileDialog.activateWindow() |
4081 |
4118 |
4082 def __doSearchNewFiles(self, AI=True, onUserDemand=False): |
4119 def __doSearchNewFiles(self, AI=True, onUserDemand=False): |
4083 """ |
4120 """ |
4084 Private method to search for new files in the project directory. |
4121 Private method to search for new files in the project directory. |
4085 |
4122 |