Project/Project.py

changeset 3345
071afe8be2a1
parent 3302
e92f0dd51979
child 3371
d0bef2791682
equal deleted inserted replaced
3343:f7a6d271bb40 3345:071afe8be2a1
13 import glob 13 import glob
14 import fnmatch 14 import fnmatch
15 import copy 15 import copy
16 import zipfile 16 import zipfile
17 17
18 from PyQt4.QtCore import QFile, QFileInfo, pyqtSignal, QCryptographicHash, \ 18 from PyQt4.QtCore import pyqtSlot, QFile, QFileInfo, pyqtSignal, \
19 QIODevice, QByteArray, QObject, Qt 19 QCryptographicHash, QIODevice, QByteArray, QObject, Qt
20 from PyQt4.QtGui import QCursor, QLineEdit, QToolBar, QDialog, QInputDialog, \ 20 from PyQt4.QtGui import QCursor, QLineEdit, QToolBar, QDialog, QInputDialog, \
21 QApplication, QMenu, QAction 21 QApplication, QMenu, QAction
22 from PyQt4.Qsci import QsciScintilla 22 from PyQt4.Qsci import QsciScintilla
23 23
24 from E5Gui.E5Application import e5App 24 from E5Gui.E5Application import e5App
849 self.sessActGrp.findChild( 849 self.sessActGrp.findChild(
850 QAction, "project_load_session").setEnabled(enable) 850 QAction, "project_load_session").setEnabled(enable)
851 self.sessActGrp.findChild( 851 self.sessActGrp.findChild(
852 QAction, "project_delete_session").setEnabled(enable) 852 QAction, "project_delete_session").setEnabled(enable)
853 853
854 @pyqtSlot()
854 def __readSession(self, quiet=False, indicator=""): 855 def __readSession(self, quiet=False, indicator=""):
855 """ 856 """
856 Private method to read in the project session file (.e4s). 857 Private method to read in the project session file (.e4s).
857 858
858 @param quiet flag indicating quiet operations. 859 @param quiet flag indicating quiet operations.
884 self.tr("Read project session"), 885 self.tr("Read project session"),
885 self.tr( 886 self.tr(
886 "<p>The project session file <b>{0}</b> could not be" 887 "<p>The project session file <b>{0}</b> could not be"
887 " read.</p>").format(fn)) 888 " read.</p>").format(fn))
888 889
890 @pyqtSlot()
889 def __writeSession(self, quiet=False, indicator=""): 891 def __writeSession(self, quiet=False, indicator=""):
890 """ 892 """
891 Private method to write the session data to an XML file (.e4s). 893 Private method to write the session data to an XML file (.e4s).
892 894
893 @param quiet flag indicating quiet operations. 895 @param quiet flag indicating quiet operations.
1017 self.dbgActGrp.findChild( 1019 self.dbgActGrp.findChild(
1018 QAction, "project_debugger_properties_load").setEnabled(enable) 1020 QAction, "project_debugger_properties_load").setEnabled(enable)
1019 self.dbgActGrp.findChild( 1021 self.dbgActGrp.findChild(
1020 QAction, "project_debugger_properties_delete").setEnabled(enable) 1022 QAction, "project_debugger_properties_delete").setEnabled(enable)
1021 1023
1024 @pyqtSlot()
1022 def __readDebugProperties(self, quiet=False): 1025 def __readDebugProperties(self, quiet=False):
1023 """ 1026 """
1024 Private method to read in the project debugger properties file (.e4d). 1027 Private method to read in the project debugger properties file (.e4d).
1025 1028
1026 @param quiet flag indicating quiet operations. 1029 @param quiet flag indicating quiet operations.
1050 self.tr("Read debugger properties"), 1053 self.tr("Read debugger properties"),
1051 self.tr( 1054 self.tr(
1052 "<p>The project debugger properties file <b>{0}</b>" 1055 "<p>The project debugger properties file <b>{0}</b>"
1053 " could not be read.</p>").format(fn)) 1056 " could not be read.</p>").format(fn))
1054 1057
1058 @pyqtSlot()
1055 def __writeDebugProperties(self, quiet=False): 1059 def __writeDebugProperties(self, quiet=False):
1056 """ 1060 """
1057 Private method to write the project debugger properties file (.e4d). 1061 Private method to write the project debugger properties file (.e4d).
1058 1062
1059 @param quiet flag indicating quiet operations. 1063 @param quiet flag indicating quiet operations.
1416 self.otherssubdirs.append(newdir) 1420 self.otherssubdirs.append(newdir)
1417 1421
1418 if dirty: 1422 if dirty:
1419 self.setDirty(True) 1423 self.setDirty(True)
1420 1424
1425 @pyqtSlot()
1421 def addFiles(self, filter=None, startdir=None): 1426 def addFiles(self, filter=None, startdir=None):
1422 """ 1427 """
1423 Public slot used to add files to the project. 1428 Public slot used to add files to the project.
1424 1429
1425 @param filter filter to be used by the add file dialog 1430 @param filter filter to be used by the add file dialog
1564 ns = os.path.join(source, name) 1569 ns = os.path.join(source, name)
1565 if os.path.isdir(ns): 1570 if os.path.isdir(ns):
1566 nt = os.path.join(target, name) 1571 nt = os.path.join(target, name)
1567 self.__addRecursiveDirectory(filetype, ns, nt) 1572 self.__addRecursiveDirectory(filetype, ns, nt)
1568 1573
1574 @pyqtSlot()
1569 def addDirectory(self, filter=None, startdir=None): 1575 def addDirectory(self, filter=None, startdir=None):
1570 """ 1576 """
1571 Public method used to add all files of a directory to the project. 1577 Public method used to add all files of a directory to the project.
1572 1578
1573 @param filter filter to be used by the add directory dialog 1579 @param filter filter to be used by the add directory dialog
2477 pass 2483 pass
2478 2484
2479 # return empty string to signal to use the global setting 2485 # return empty string to signal to use the global setting
2480 return "" 2486 return ""
2481 2487
2488 @pyqtSlot()
2489 @pyqtSlot(str)
2482 def openProject(self, fn=None, restoreSession=True, reopen=False): 2490 def openProject(self, fn=None, restoreSession=True, reopen=False):
2483 """ 2491 """
2484 Public slot to open a project. 2492 Public slot to open a project.
2485 2493
2486 @param fn optional filename of the project file to be read 2494 @param fn optional filename of the project file to be read
2742 self.codecoverage and self.codecoverage.close() 2750 self.codecoverage and self.codecoverage.close()
2743 self.profiledata and self.profiledata.close() 2751 self.profiledata and self.profiledata.close()
2744 self.applicationDiagram and self.applicationDiagram.close() 2752 self.applicationDiagram and self.applicationDiagram.close()
2745 self.loadedDiagram and self.loadedDiagram.close() 2753 self.loadedDiagram and self.loadedDiagram.close()
2746 2754
2755 @pyqtSlot()
2747 def closeProject(self, reopen=False, noSave=False): 2756 def closeProject(self, reopen=False, noSave=False):
2748 """ 2757 """
2749 Public slot to close the current project. 2758 Public slot to close the current project.
2750 2759
2751 @keyparam reopen flag indicating a reopening of the project (boolean) 2760 @keyparam reopen flag indicating a reopening of the project (boolean)
3271 act.setWhatsThis(self.tr( 3280 act.setWhatsThis(self.tr(
3272 """<b>New...</b>""" 3281 """<b>New...</b>"""
3273 """<p>This opens a dialog for entering the info for a""" 3282 """<p>This opens a dialog for entering the info for a"""
3274 """ new project.</p>""" 3283 """ new project.</p>"""
3275 )) 3284 ))
3276 act.triggered[()].connect(self.createNewProject) 3285 act.triggered.connect(self.createNewProject)
3277 self.actions.append(act) 3286 self.actions.append(act)
3278 3287
3279 act = E5Action( 3288 act = E5Action(
3280 self.tr('Open project'), 3289 self.tr('Open project'),
3281 UI.PixmapCache.getIcon("projectOpen.png"), 3290 UI.PixmapCache.getIcon("projectOpen.png"),
3284 act.setStatusTip(self.tr('Open an existing project')) 3293 act.setStatusTip(self.tr('Open an existing project'))
3285 act.setWhatsThis(self.tr( 3294 act.setWhatsThis(self.tr(
3286 """<b>Open...</b>""" 3295 """<b>Open...</b>"""
3287 """<p>This opens an existing project.</p>""" 3296 """<p>This opens an existing project.</p>"""
3288 )) 3297 ))
3289 act.triggered[()].connect(self.openProject) 3298 act.triggered.connect(self.openProject)
3290 self.actions.append(act) 3299 self.actions.append(act)
3291 3300
3292 self.closeAct = E5Action( 3301 self.closeAct = E5Action(
3293 self.tr('Close project'), 3302 self.tr('Close project'),
3294 UI.PixmapCache.getIcon("projectClose.png"), 3303 UI.PixmapCache.getIcon("projectClose.png"),
3296 self.closeAct.setStatusTip(self.tr('Close the current project')) 3305 self.closeAct.setStatusTip(self.tr('Close the current project'))
3297 self.closeAct.setWhatsThis(self.tr( 3306 self.closeAct.setWhatsThis(self.tr(
3298 """<b>Close</b>""" 3307 """<b>Close</b>"""
3299 """<p>This closes the current project.</p>""" 3308 """<p>This closes the current project.</p>"""
3300 )) 3309 ))
3301 self.closeAct.triggered[()].connect(self.closeProject) 3310 self.closeAct.triggered.connect(self.closeProject)
3302 self.actions.append(self.closeAct) 3311 self.actions.append(self.closeAct)
3303 3312
3304 self.saveAct = E5Action( 3313 self.saveAct = E5Action(
3305 self.tr('Save project'), 3314 self.tr('Save project'),
3306 UI.PixmapCache.getIcon("projectSave.png"), 3315 UI.PixmapCache.getIcon("projectSave.png"),
3308 self.saveAct.setStatusTip(self.tr('Save the current project')) 3317 self.saveAct.setStatusTip(self.tr('Save the current project'))
3309 self.saveAct.setWhatsThis(self.tr( 3318 self.saveAct.setWhatsThis(self.tr(
3310 """<b>Save</b>""" 3319 """<b>Save</b>"""
3311 """<p>This saves the current project.</p>""" 3320 """<p>This saves the current project.</p>"""
3312 )) 3321 ))
3313 self.saveAct.triggered[()].connect(self.saveProject) 3322 self.saveAct.triggered.connect(self.saveProject)
3314 self.actions.append(self.saveAct) 3323 self.actions.append(self.saveAct)
3315 3324
3316 self.saveasAct = E5Action( 3325 self.saveasAct = E5Action(
3317 self.tr('Save project as'), 3326 self.tr('Save project as'),
3318 UI.PixmapCache.getIcon("projectSaveAs.png"), 3327 UI.PixmapCache.getIcon("projectSaveAs.png"),
3321 'Save the current project to a new file')) 3330 'Save the current project to a new file'))
3322 self.saveasAct.setWhatsThis(self.tr( 3331 self.saveasAct.setWhatsThis(self.tr(
3323 """<b>Save as</b>""" 3332 """<b>Save as</b>"""
3324 """<p>This saves the current project to a new file.</p>""" 3333 """<p>This saves the current project to a new file.</p>"""
3325 )) 3334 ))
3326 self.saveasAct.triggered[()].connect(self.saveProjectAs) 3335 self.saveasAct.triggered.connect(self.saveProjectAs)
3327 self.actions.append(self.saveasAct) 3336 self.actions.append(self.saveasAct)
3328 3337
3329 self.actGrp2 = createActionGroup(self) 3338 self.actGrp2 = createActionGroup(self)
3330 3339
3331 self.addFilesAct = E5Action( 3340 self.addFilesAct = E5Action(
3339 """<b>Add files...</b>""" 3348 """<b>Add files...</b>"""
3340 """<p>This opens a dialog for adding files""" 3349 """<p>This opens a dialog for adding files"""
3341 """ to the current project. The place to add is""" 3350 """ to the current project. The place to add is"""
3342 """ determined by the file extension.</p>""" 3351 """ determined by the file extension.</p>"""
3343 )) 3352 ))
3344 self.addFilesAct.triggered[()].connect(self.addFiles) 3353 self.addFilesAct.triggered.connect(self.addFiles)
3345 self.actions.append(self.addFilesAct) 3354 self.actions.append(self.addFilesAct)
3346 3355
3347 self.addDirectoryAct = E5Action( 3356 self.addDirectoryAct = E5Action(
3348 self.tr('Add directory to project'), 3357 self.tr('Add directory to project'),
3349 UI.PixmapCache.getIcon("dirOpen.png"), 3358 UI.PixmapCache.getIcon("dirOpen.png"),
3354 self.addDirectoryAct.setWhatsThis(self.tr( 3363 self.addDirectoryAct.setWhatsThis(self.tr(
3355 """<b>Add directory...</b>""" 3364 """<b>Add directory...</b>"""
3356 """<p>This opens a dialog for adding a directory""" 3365 """<p>This opens a dialog for adding a directory"""
3357 """ to the current project.</p>""" 3366 """ to the current project.</p>"""
3358 )) 3367 ))
3359 self.addDirectoryAct.triggered[()].connect(self.addDirectory) 3368 self.addDirectoryAct.triggered.connect(self.addDirectory)
3360 self.actions.append(self.addDirectoryAct) 3369 self.actions.append(self.addDirectoryAct)
3361 3370
3362 self.addLanguageAct = E5Action( 3371 self.addLanguageAct = E5Action(
3363 self.tr('Add translation to project'), 3372 self.tr('Add translation to project'),
3364 UI.PixmapCache.getIcon("linguist4.png"), 3373 UI.PixmapCache.getIcon("linguist4.png"),
3369 self.addLanguageAct.setWhatsThis(self.tr( 3378 self.addLanguageAct.setWhatsThis(self.tr(
3370 """<b>Add translation...</b>""" 3379 """<b>Add translation...</b>"""
3371 """<p>This opens a dialog for add a translation""" 3380 """<p>This opens a dialog for add a translation"""
3372 """ to the current project.</p>""" 3381 """ to the current project.</p>"""
3373 )) 3382 ))
3374 self.addLanguageAct.triggered[()].connect(self.addLanguage) 3383 self.addLanguageAct.triggered.connect(self.addLanguage)
3375 self.actions.append(self.addLanguageAct) 3384 self.actions.append(self.addLanguageAct)
3376 3385
3377 act = E5Action( 3386 act = E5Action(
3378 self.tr('Search new files'), 3387 self.tr('Search new files'),
3379 self.tr('Searc&h new files...'), 0, 0, 3388 self.tr('Searc&h new files...'), 0, 0,
3383 act.setWhatsThis(self.tr( 3392 act.setWhatsThis(self.tr(
3384 """<b>Search new files...</b>""" 3393 """<b>Search new files...</b>"""
3385 """<p>This searches for new files (sources, *.ui, *.idl) in""" 3394 """<p>This searches for new files (sources, *.ui, *.idl) in"""
3386 """ the project directory and registered subdirectories.</p>""" 3395 """ the project directory and registered subdirectories.</p>"""
3387 )) 3396 ))
3388 act.triggered[()].connect(self.__searchNewFiles) 3397 act.triggered.connect(self.__searchNewFiles)
3389 self.actions.append(act) 3398 self.actions.append(act)
3390 3399
3391 self.propsAct = E5Action( 3400 self.propsAct = E5Action(
3392 self.tr('Project properties'), 3401 self.tr('Project properties'),
3393 UI.PixmapCache.getIcon("projectProps.png"), 3402 UI.PixmapCache.getIcon("projectProps.png"),
3396 self.propsAct.setStatusTip(self.tr('Show the project properties')) 3405 self.propsAct.setStatusTip(self.tr('Show the project properties'))
3397 self.propsAct.setWhatsThis(self.tr( 3406 self.propsAct.setWhatsThis(self.tr(
3398 """<b>Properties...</b>""" 3407 """<b>Properties...</b>"""
3399 """<p>This shows a dialog to edit the project properties.</p>""" 3408 """<p>This shows a dialog to edit the project properties.</p>"""
3400 )) 3409 ))
3401 self.propsAct.triggered[()].connect(self.__showProperties) 3410 self.propsAct.triggered.connect(self.__showProperties)
3402 self.actions.append(self.propsAct) 3411 self.actions.append(self.propsAct)
3403 3412
3404 self.userPropsAct = E5Action( 3413 self.userPropsAct = E5Action(
3405 self.tr('User project properties'), 3414 self.tr('User project properties'),
3406 UI.PixmapCache.getIcon("projectUserProps.png"), 3415 UI.PixmapCache.getIcon("projectUserProps.png"),
3411 self.userPropsAct.setWhatsThis(self.tr( 3420 self.userPropsAct.setWhatsThis(self.tr(
3412 """<b>User Properties...</b>""" 3421 """<b>User Properties...</b>"""
3413 """<p>This shows a dialog to edit the user specific project""" 3422 """<p>This shows a dialog to edit the user specific project"""
3414 """ properties.</p>""" 3423 """ properties.</p>"""
3415 )) 3424 ))
3416 self.userPropsAct.triggered[()].connect(self.__showUserProperties) 3425 self.userPropsAct.triggered.connect(self.__showUserProperties)
3417 self.actions.append(self.userPropsAct) 3426 self.actions.append(self.userPropsAct)
3418 3427
3419 self.filetypesAct = E5Action( 3428 self.filetypesAct = E5Action(
3420 self.tr('Filetype Associations'), 3429 self.tr('Filetype Associations'),
3421 self.tr('Filetype Associations...'), 0, 0, 3430 self.tr('Filetype Associations...'), 0, 0,
3428 """ the project. These associations determine the type""" 3437 """ the project. These associations determine the type"""
3429 """ (source, form, interface or others) with a filename""" 3438 """ (source, form, interface or others) with a filename"""
3430 """ pattern. They are used when adding a file to the project""" 3439 """ pattern. They are used when adding a file to the project"""
3431 """ and when performing a search for new files.</p>""" 3440 """ and when performing a search for new files.</p>"""
3432 )) 3441 ))
3433 self.filetypesAct.triggered[()].connect( 3442 self.filetypesAct.triggered.connect(
3434 self.__showFiletypeAssociations) 3443 self.__showFiletypeAssociations)
3435 self.actions.append(self.filetypesAct) 3444 self.actions.append(self.filetypesAct)
3436 3445
3437 self.lexersAct = E5Action( 3446 self.lexersAct = E5Action(
3438 self.tr('Lexer Associations'), 3447 self.tr('Lexer Associations'),
3445 """<p>This shows a dialog to edit the lexer associations of""" 3454 """<p>This shows a dialog to edit the lexer associations of"""
3446 """ the project. These associations override the global lexer""" 3455 """ the project. These associations override the global lexer"""
3447 """ associations. Lexers are used to highlight the editor""" 3456 """ associations. Lexers are used to highlight the editor"""
3448 """ text.</p>""" 3457 """ text.</p>"""
3449 )) 3458 ))
3450 self.lexersAct.triggered[()].connect(self.__showLexerAssociations) 3459 self.lexersAct.triggered.connect(self.__showLexerAssociations)
3451 self.actions.append(self.lexersAct) 3460 self.actions.append(self.lexersAct)
3452 3461
3453 self.dbgActGrp = createActionGroup(self) 3462 self.dbgActGrp = createActionGroup(self)
3454 3463
3455 act = E5Action( 3464 act = E5Action(
3460 act.setWhatsThis(self.tr( 3469 act.setWhatsThis(self.tr(
3461 """<b>Debugger Properties...</b>""" 3470 """<b>Debugger Properties...</b>"""
3462 """<p>This shows a dialog to edit project specific debugger""" 3471 """<p>This shows a dialog to edit project specific debugger"""
3463 """ settings.</p>""" 3472 """ settings.</p>"""
3464 )) 3473 ))
3465 act.triggered[()].connect(self.__showDebugProperties) 3474 act.triggered.connect(self.__showDebugProperties)
3466 self.actions.append(act) 3475 self.actions.append(act)
3467 3476
3468 act = E5Action( 3477 act = E5Action(
3469 self.tr('Load'), 3478 self.tr('Load'),
3470 self.tr('&Load'), 0, 0, 3479 self.tr('&Load'), 0, 0,
3472 act.setStatusTip(self.tr('Load the debugger properties')) 3481 act.setStatusTip(self.tr('Load the debugger properties'))
3473 act.setWhatsThis(self.tr( 3482 act.setWhatsThis(self.tr(
3474 """<b>Load Debugger Properties</b>""" 3483 """<b>Load Debugger Properties</b>"""
3475 """<p>This loads the project specific debugger settings.</p>""" 3484 """<p>This loads the project specific debugger settings.</p>"""
3476 )) 3485 ))
3477 act.triggered[()].connect(self.__readDebugProperties) 3486 act.triggered.connect(self.__readDebugProperties)
3478 self.actions.append(act) 3487 self.actions.append(act)
3479 3488
3480 act = E5Action( 3489 act = E5Action(
3481 self.tr('Save'), 3490 self.tr('Save'),
3482 self.tr('&Save'), 0, 0, 3491 self.tr('&Save'), 0, 0,
3484 act.setStatusTip(self.tr('Save the debugger properties')) 3493 act.setStatusTip(self.tr('Save the debugger properties'))
3485 act.setWhatsThis(self.tr( 3494 act.setWhatsThis(self.tr(
3486 """<b>Save Debugger Properties</b>""" 3495 """<b>Save Debugger Properties</b>"""
3487 """<p>This saves the project specific debugger settings.</p>""" 3496 """<p>This saves the project specific debugger settings.</p>"""
3488 )) 3497 ))
3489 act.triggered[()].connect(self.__writeDebugProperties) 3498 act.triggered.connect(self.__writeDebugProperties)
3490 self.actions.append(act) 3499 self.actions.append(act)
3491 3500
3492 act = E5Action( 3501 act = E5Action(
3493 self.tr('Delete'), 3502 self.tr('Delete'),
3494 self.tr('&Delete'), 0, 0, 3503 self.tr('&Delete'), 0, 0,
3497 act.setWhatsThis(self.tr( 3506 act.setWhatsThis(self.tr(
3498 """<b>Delete Debugger Properties</b>""" 3507 """<b>Delete Debugger Properties</b>"""
3499 """<p>This deletes the file containing the project specific""" 3508 """<p>This deletes the file containing the project specific"""
3500 """ debugger settings.</p>""" 3509 """ debugger settings.</p>"""
3501 )) 3510 ))
3502 act.triggered[()].connect(self.__deleteDebugProperties) 3511 act.triggered.connect(self.__deleteDebugProperties)
3503 self.actions.append(act) 3512 self.actions.append(act)
3504 3513
3505 act = E5Action( 3514 act = E5Action(
3506 self.tr('Reset'), 3515 self.tr('Reset'),
3507 self.tr('&Reset'), 0, 0, 3516 self.tr('&Reset'), 0, 0,
3509 act.setStatusTip(self.tr('Reset the debugger properties')) 3518 act.setStatusTip(self.tr('Reset the debugger properties'))
3510 act.setWhatsThis(self.tr( 3519 act.setWhatsThis(self.tr(
3511 """<b>Reset Debugger Properties</b>""" 3520 """<b>Reset Debugger Properties</b>"""
3512 """<p>This resets the project specific debugger settings.</p>""" 3521 """<p>This resets the project specific debugger settings.</p>"""
3513 )) 3522 ))
3514 act.triggered[()].connect(self.__initDebugProperties) 3523 act.triggered.connect(self.__initDebugProperties)
3515 self.actions.append(act) 3524 self.actions.append(act)
3516 3525
3517 self.sessActGrp = createActionGroup(self) 3526 self.sessActGrp = createActionGroup(self)
3518 3527
3519 act = E5Action( 3528 act = E5Action(
3529 """- all breakpoint<br>""" 3538 """- all breakpoint<br>"""
3530 """- the commandline arguments<br>""" 3539 """- the commandline arguments<br>"""
3531 """- the working directory<br>""" 3540 """- the working directory<br>"""
3532 """- the exception reporting flag</p>""" 3541 """- the exception reporting flag</p>"""
3533 )) 3542 ))
3534 act.triggered[()].connect(self.__readSession) 3543 act.triggered.connect(self.__readSession)
3535 self.actions.append(act) 3544 self.actions.append(act)
3536 3545
3537 act = E5Action( 3546 act = E5Action(
3538 self.tr('Save session'), 3547 self.tr('Save session'),
3539 self.tr('Save session'), 0, 0, 3548 self.tr('Save session'), 0, 0,
3547 """- all breakpoint<br>""" 3556 """- all breakpoint<br>"""
3548 """- the commandline arguments<br>""" 3557 """- the commandline arguments<br>"""
3549 """- the working directory<br>""" 3558 """- the working directory<br>"""
3550 """- the exception reporting flag</p>""" 3559 """- the exception reporting flag</p>"""
3551 )) 3560 ))
3552 act.triggered[()].connect(self.__writeSession) 3561 act.triggered.connect(self.__writeSession)
3553 self.actions.append(act) 3562 self.actions.append(act)
3554 3563
3555 act = E5Action( 3564 act = E5Action(
3556 self.tr('Delete session'), 3565 self.tr('Delete session'),
3557 self.tr('Delete session'), 0, 0, 3566 self.tr('Delete session'), 0, 0,
3559 act.setStatusTip(self.tr('Delete the projects session file.')) 3568 act.setStatusTip(self.tr('Delete the projects session file.'))
3560 act.setWhatsThis(self.tr( 3569 act.setWhatsThis(self.tr(
3561 """<b>Delete session</b>""" 3570 """<b>Delete session</b>"""
3562 """<p>This deletes the projects session file</p>""" 3571 """<p>This deletes the projects session file</p>"""
3563 )) 3572 ))
3564 act.triggered[()].connect(self.__deleteSession) 3573 act.triggered.connect(self.__deleteSession)
3565 self.actions.append(act) 3574 self.actions.append(act)
3566 3575
3567 self.chkGrp = createActionGroup(self) 3576 self.chkGrp = createActionGroup(self)
3568 3577
3569 self.codeMetricsAct = E5Action( 3578 self.codeMetricsAct = E5Action(
3575 self.codeMetricsAct.setWhatsThis(self.tr( 3584 self.codeMetricsAct.setWhatsThis(self.tr(
3576 """<b>Code Metrics...</b>""" 3585 """<b>Code Metrics...</b>"""
3577 """<p>This shows some code metrics for all Python files in""" 3586 """<p>This shows some code metrics for all Python files in"""
3578 """ the project.</p>""" 3587 """ the project.</p>"""
3579 )) 3588 ))
3580 self.codeMetricsAct.triggered[()].connect(self.__showCodeMetrics) 3589 self.codeMetricsAct.triggered.connect(self.__showCodeMetrics)
3581 self.actions.append(self.codeMetricsAct) 3590 self.actions.append(self.codeMetricsAct)
3582 3591
3583 self.codeCoverageAct = E5Action( 3592 self.codeCoverageAct = E5Action(
3584 self.tr('Python Code Coverage'), 3593 self.tr('Python Code Coverage'),
3585 self.tr('Code Co&verage...'), 0, 0, 3594 self.tr('Code Co&verage...'), 0, 0,
3589 self.codeCoverageAct.setWhatsThis(self.tr( 3598 self.codeCoverageAct.setWhatsThis(self.tr(
3590 """<b>Code Coverage...</b>""" 3599 """<b>Code Coverage...</b>"""
3591 """<p>This shows the code coverage information for all Python""" 3600 """<p>This shows the code coverage information for all Python"""
3592 """ files in the project.</p>""" 3601 """ files in the project.</p>"""
3593 )) 3602 ))
3594 self.codeCoverageAct.triggered[()].connect(self.__showCodeCoverage) 3603 self.codeCoverageAct.triggered.connect(self.__showCodeCoverage)
3595 self.actions.append(self.codeCoverageAct) 3604 self.actions.append(self.codeCoverageAct)
3596 3605
3597 self.codeProfileAct = E5Action( 3606 self.codeProfileAct = E5Action(
3598 self.tr('Profile Data'), 3607 self.tr('Profile Data'),
3599 self.tr('&Profile Data...'), 0, 0, 3608 self.tr('&Profile Data...'), 0, 0,
3602 self.tr('Show profiling data for the project.')) 3611 self.tr('Show profiling data for the project.'))
3603 self.codeProfileAct.setWhatsThis(self.tr( 3612 self.codeProfileAct.setWhatsThis(self.tr(
3604 """<b>Profile Data...</b>""" 3613 """<b>Profile Data...</b>"""
3605 """<p>This shows the profiling data for the project.</p>""" 3614 """<p>This shows the profiling data for the project.</p>"""
3606 )) 3615 ))
3607 self.codeProfileAct.triggered[()].connect(self.__showProfileData) 3616 self.codeProfileAct.triggered.connect(self.__showProfileData)
3608 self.actions.append(self.codeProfileAct) 3617 self.actions.append(self.codeProfileAct)
3609 3618
3610 self.graphicsGrp = createActionGroup(self) 3619 self.graphicsGrp = createActionGroup(self)
3611 3620
3612 self.applicationDiagramAct = E5Action( 3621 self.applicationDiagramAct = E5Action(
3617 self.tr('Show a diagram of the project.')) 3626 self.tr('Show a diagram of the project.'))
3618 self.applicationDiagramAct.setWhatsThis(self.tr( 3627 self.applicationDiagramAct.setWhatsThis(self.tr(
3619 """<b>Application Diagram...</b>""" 3628 """<b>Application Diagram...</b>"""
3620 """<p>This shows a diagram of the project.</p>""" 3629 """<p>This shows a diagram of the project.</p>"""
3621 )) 3630 ))
3622 self.applicationDiagramAct.triggered[()].connect( 3631 self.applicationDiagramAct.triggered.connect(
3623 self.handleApplicationDiagram) 3632 self.handleApplicationDiagram)
3624 self.actions.append(self.applicationDiagramAct) 3633 self.actions.append(self.applicationDiagramAct)
3625 3634
3626 self.loadDiagramAct = E5Action( 3635 self.loadDiagramAct = E5Action(
3627 self.tr('Load Diagram'), 3636 self.tr('Load Diagram'),
3631 self.tr('Load a diagram from file.')) 3640 self.tr('Load a diagram from file.'))
3632 self.loadDiagramAct.setWhatsThis(self.tr( 3641 self.loadDiagramAct.setWhatsThis(self.tr(
3633 """<b>Load Diagram...</b>""" 3642 """<b>Load Diagram...</b>"""
3634 """<p>This loads a diagram from file.</p>""" 3643 """<p>This loads a diagram from file.</p>"""
3635 )) 3644 ))
3636 self.loadDiagramAct.triggered[()].connect(self.__loadDiagram) 3645 self.loadDiagramAct.triggered.connect(self.__loadDiagram)
3637 self.actions.append(self.loadDiagramAct) 3646 self.actions.append(self.loadDiagramAct)
3638 3647
3639 self.pluginGrp = createActionGroup(self) 3648 self.pluginGrp = createActionGroup(self)
3640 3649
3641 self.pluginPkgListAct = E5Action( 3650 self.pluginPkgListAct = E5Action(
3649 """<b>Create Package List</b>""" 3658 """<b>Create Package List</b>"""
3650 """<p>This creates an initial list of files to include in an""" 3659 """<p>This creates an initial list of files to include in an"""
3651 """ eric5 plugin archive. The list is created from the project""" 3660 """ eric5 plugin archive. The list is created from the project"""
3652 """ file.</p>""" 3661 """ file.</p>"""
3653 )) 3662 ))
3654 self.pluginPkgListAct.triggered[()].connect(self.__pluginCreatePkgList) 3663 self.pluginPkgListAct.triggered.connect(self.__pluginCreatePkgList)
3655 self.actions.append(self.pluginPkgListAct) 3664 self.actions.append(self.pluginPkgListAct)
3656 3665
3657 self.pluginArchiveAct = E5Action( 3666 self.pluginArchiveAct = E5Action(
3658 self.tr('Create Plugin Archive'), 3667 self.tr('Create Plugin Archive'),
3659 UI.PixmapCache.getIcon("pluginArchive.png"), 3668 UI.PixmapCache.getIcon("pluginArchive.png"),
3665 """<b>Create Plugin Archive</b>""" 3674 """<b>Create Plugin Archive</b>"""
3666 """<p>This creates an eric5 plugin archive file using the list""" 3675 """<p>This creates an eric5 plugin archive file using the list"""
3667 """ of files given in the PKGLIST file. The archive name is""" 3676 """ of files given in the PKGLIST file. The archive name is"""
3668 """ built from the main script name.</p>""" 3677 """ built from the main script name.</p>"""
3669 )) 3678 ))
3670 self.pluginArchiveAct.triggered[()].connect(self.__pluginCreateArchive) 3679 self.pluginArchiveAct.triggered.connect(self.__pluginCreateArchive)
3671 self.actions.append(self.pluginArchiveAct) 3680 self.actions.append(self.pluginArchiveAct)
3672 3681
3673 self.pluginSArchiveAct = E5Action( 3682 self.pluginSArchiveAct = E5Action(
3674 self.tr('Create Plugin Archive (Snapshot)'), 3683 self.tr('Create Plugin Archive (Snapshot)'),
3675 UI.PixmapCache.getIcon("pluginArchiveSnapshot.png"), 3684 UI.PixmapCache.getIcon("pluginArchiveSnapshot.png"),
3682 """<p>This creates an eric5 plugin archive file using the list""" 3691 """<p>This creates an eric5 plugin archive file using the list"""
3683 """ of files given in the PKGLIST file. The archive name is""" 3692 """ of files given in the PKGLIST file. The archive name is"""
3684 """ built from the main script name. The version entry of the""" 3693 """ built from the main script name. The version entry of the"""
3685 """ main script is modified to reflect a snapshot release.</p>""" 3694 """ main script is modified to reflect a snapshot release.</p>"""
3686 )) 3695 ))
3687 self.pluginSArchiveAct.triggered[()].connect( 3696 self.pluginSArchiveAct.triggered.connect(
3688 self.__pluginCreateSnapshotArchive) 3697 self.__pluginCreateSnapshotArchive)
3689 self.actions.append(self.pluginSArchiveAct) 3698 self.actions.append(self.pluginSArchiveAct)
3690 3699
3691 self.closeAct.setEnabled(False) 3700 self.closeAct.setEnabled(False)
3692 self.saveAct.setEnabled(False) 3701 self.saveAct.setEnabled(False)
4566 return 4575 return
4567 4576
4568 if not "PKGLIST" in self.pdata["OTHERS"]: 4577 if not "PKGLIST" in self.pdata["OTHERS"]:
4569 self.appendFile("PKGLIST") 4578 self.appendFile("PKGLIST")
4570 4579
4580 @pyqtSlot()
4571 def __pluginCreateArchive(self, snapshot=False): 4581 def __pluginCreateArchive(self, snapshot=False):
4572 """ 4582 """
4573 Private slot to create an eric5 plugin archive. 4583 Private slot to create an eric5 plugin archive.
4574 4584
4575 @param snapshot flag indicating a snapshot archive (boolean) 4585 @param snapshot flag indicating a snapshot archive (boolean)

eric ide

mercurial