313 E5MessageBox.critical( |
313 E5MessageBox.critical( |
314 self.ui, |
314 self.ui, |
315 self.trUtf8("Registering Project Type"), |
315 self.trUtf8("Registering Project Type"), |
316 self.trUtf8( |
316 self.trUtf8( |
317 """<p>The Programming Language <b>{0}</b> is not""" |
317 """<p>The Programming Language <b>{0}</b> is not""" |
318 """ supported.</p>""")\ |
318 """ supported.</p>""") |
319 .format(progLanguage) |
319 .format(progLanguage) |
320 ) |
320 ) |
321 return |
321 return |
322 |
322 |
323 if type_ in self.__projectProgLanguages[progLanguage]: |
323 if type_ in self.__projectProgLanguages[progLanguage]: |
325 self.ui, |
325 self.ui, |
326 self.trUtf8("Registering Project Type"), |
326 self.trUtf8("Registering Project Type"), |
327 self.trUtf8( |
327 self.trUtf8( |
328 """<p>The Project type <b>{0}</b> is already""" |
328 """<p>The Project type <b>{0}</b> is already""" |
329 """ registered with Programming Language""" |
329 """ registered with Programming Language""" |
330 """ <b>{1}</b>.</p>""")\ |
330 """ <b>{1}</b>.</p>""") |
331 .format(type_, progLanguage) |
331 .format(type_, progLanguage) |
332 ) |
332 ) |
333 return |
333 return |
334 |
334 |
335 if type_ in self.__projectTypes: |
335 if type_ in self.__projectTypes: |
669 QApplication.restoreOverrideCursor() |
669 QApplication.restoreOverrideCursor() |
670 E5MessageBox.critical( |
670 E5MessageBox.critical( |
671 self.ui, |
671 self.ui, |
672 self.trUtf8("Read project file"), |
672 self.trUtf8("Read project file"), |
673 self.trUtf8( |
673 self.trUtf8( |
674 "<p>The project file <b>{0}</b> could not be read.</p>")\ |
674 "<p>The project file <b>{0}</b> could not be read.</p>") |
675 .format(fn)) |
675 .format(fn)) |
676 return False |
676 return False |
677 |
677 |
678 self.pfile = os.path.abspath(fn) |
678 self.pfile = os.path.abspath(fn) |
679 self.ppath = os.path.abspath(os.path.dirname(fn)) |
679 self.ppath = os.path.abspath(os.path.dirname(fn)) |
971 else: |
971 else: |
972 E5MessageBox.critical( |
972 E5MessageBox.critical( |
973 self.ui, |
973 self.ui, |
974 self.trUtf8("Read tasks"), |
974 self.trUtf8("Read tasks"), |
975 self.trUtf8( |
975 self.trUtf8( |
976 "<p>The tasks file <b>{0}</b> could not be read.</p>")\ |
976 "<p>The tasks file <b>{0}</b> could not be read.</p>") |
977 .format(fn)) |
977 .format(fn)) |
978 |
978 |
979 def writeTasks(self): |
979 def writeTasks(self): |
980 """ |
980 """ |
981 Public method to write the tasks data to an XML file (.e4t). |
981 Public method to write the tasks data to an XML file (.e4t). |
2023 self.menuApidocAct.setEnabled(True) |
2023 self.menuApidocAct.setEnabled(True) |
2024 self.menuPackagersAct.setEnabled(True) |
2024 self.menuPackagersAct.setEnabled(True) |
2025 self.pluginGrp.setEnabled( |
2025 self.pluginGrp.setEnabled( |
2026 self.pdata["PROJECTTYPE"][0] == "E4Plugin") |
2026 self.pdata["PROJECTTYPE"][0] == "E4Plugin") |
2027 self.addLanguageAct.setEnabled( |
2027 self.addLanguageAct.setEnabled( |
2028 len(self.pdata["TRANSLATIONPATTERN"]) > 0 and \ |
2028 len(self.pdata["TRANSLATIONPATTERN"]) > 0 and |
2029 self.pdata["TRANSLATIONPATTERN"][0] != '') |
2029 self.pdata["TRANSLATIONPATTERN"][0] != '') |
2030 |
2030 |
2031 self.projectAboutToBeCreated.emit() |
2031 self.projectAboutToBeCreated.emit() |
2032 |
2032 |
2033 hash = str(QCryptographicHash.hash( |
2033 hash = str(QCryptographicHash.hash( |
2167 self.trUtf8( |
2167 self.trUtf8( |
2168 """Would you like to edit the VCS""" |
2168 """Would you like to edit the VCS""" |
2169 """ command options?""")) |
2169 """ command options?""")) |
2170 if vcores: |
2170 if vcores: |
2171 from VCS.CommandOptionsDialog import \ |
2171 from VCS.CommandOptionsDialog import \ |
2172 vcsCommandOptionsDialog |
2172 VcsCommandOptionsDialog |
2173 codlg = vcsCommandOptionsDialog(self.vcs) |
2173 codlg = VcsCommandOptionsDialog(self.vcs) |
2174 if codlg.exec_() == QDialog.Accepted: |
2174 if codlg.exec_() == QDialog.Accepted: |
2175 self.vcs.vcsSetOptions(codlg.getOptions()) |
2175 self.vcs.vcsSetOptions(codlg.getOptions()) |
2176 # add project file to repository |
2176 # add project file to repository |
2177 if res == 0: |
2177 if res == 0: |
2178 apres = E5MessageBox.yesNo( |
2178 apres = E5MessageBox.yesNo( |
2231 self.trUtf8("New Project"), |
2231 self.trUtf8("New Project"), |
2232 self.trUtf8( |
2232 self.trUtf8( |
2233 """Would you like to edit the VCS command""" |
2233 """Would you like to edit the VCS command""" |
2234 """ options?""")) |
2234 """ options?""")) |
2235 if vcores: |
2235 if vcores: |
2236 codlg = vcsCommandOptionsDialog(self.vcs) |
2236 codlg = VcsCommandOptionsDialog(self.vcs) |
2237 if codlg.exec_() == QDialog.Accepted: |
2237 if codlg.exec_() == QDialog.Accepted: |
2238 self.vcs.vcsSetOptions(codlg.getOptions()) |
2238 self.vcs.vcsSetOptions(codlg.getOptions()) |
2239 |
2239 |
2240 # create the project in the VCS |
2240 # create the project in the VCS |
2241 self.vcs.vcsSetDataFromDict(vcsDataDict) |
2241 self.vcs.vcsSetDataFromDict(vcsDataDict) |
2396 from .UserPropertiesDialog import UserPropertiesDialog |
2396 from .UserPropertiesDialog import UserPropertiesDialog |
2397 dlg = UserPropertiesDialog(self) |
2397 dlg = UserPropertiesDialog(self) |
2398 if dlg.exec_() == QDialog.Accepted: |
2398 if dlg.exec_() == QDialog.Accepted: |
2399 dlg.storeData() |
2399 dlg.storeData() |
2400 |
2400 |
2401 if (self.pdata["VCS"] and \ |
2401 if (self.pdata["VCS"] and |
2402 self.pdata["VCS"][0] != vcsSystem) or \ |
2402 self.pdata["VCS"][0] != vcsSystem) or \ |
2403 (self.pudata["VCSOVERRIDE"] and \ |
2403 (self.pudata["VCSOVERRIDE"] and |
2404 self.pudata["VCSOVERRIDE"][0] != vcsSystemOverride) or \ |
2404 self.pudata["VCSOVERRIDE"][0] != vcsSystemOverride) or \ |
2405 (vcsSystemOverride is not None and \ |
2405 (vcsSystemOverride is not None and |
2406 len(self.pudata["VCSOVERRIDE"]) == 0): |
2406 len(self.pudata["VCSOVERRIDE"]) == 0): |
2407 # stop the VCS monitor thread and shutdown VCS |
2407 # stop the VCS monitor thread and shutdown VCS |
2408 if self.vcs is not None: |
2408 if self.vcs is not None: |
2409 self.vcs.stopStatusMonitor() |
2409 self.vcs.stopStatusMonitor() |
2410 self.vcs.vcsShutdown() |
2410 self.vcs.vcsShutdown() |
2489 |
2489 |
2490 if fn is None: |
2490 if fn is None: |
2491 fn = E5FileDialog.getOpenFileName( |
2491 fn = E5FileDialog.getOpenFileName( |
2492 self.parent(), |
2492 self.parent(), |
2493 self.trUtf8("Open project"), |
2493 self.trUtf8("Open project"), |
2494 Preferences.getMultiProject("Workspace") or \ |
2494 Preferences.getMultiProject("Workspace") or |
2495 Utilities.getHomeDir(), |
2495 Utilities.getHomeDir(), |
2496 self.trUtf8("Project Files (*.e4p)")) |
2496 self.trUtf8("Project Files (*.e4p)")) |
2497 |
2497 |
2498 QApplication.processEvents() |
2498 QApplication.processEvents() |
2499 |
2499 |
2561 vcsSystem = vcsData[0][0] |
2561 vcsSystem = vcsData[0][0] |
2562 self.pdata["VCS"] = [vcsSystem] |
2562 self.pdata["VCS"] = [vcsSystem] |
2563 self.vcs = self.initVCS() |
2563 self.vcs = self.initVCS() |
2564 self.setDirty(True) |
2564 self.setDirty(True) |
2565 if self.vcs is not None and \ |
2565 if self.vcs is not None and \ |
2566 (self.vcs.vcsRegisteredState(self.ppath) != |
2566 (self.vcs.vcsRegisteredState(self.ppath) != |
2567 self.vcs.canBeCommitted): |
2567 self.vcs.canBeCommitted): |
2568 self.pdata["VCS"] = ['None'] |
2568 self.pdata["VCS"] = ['None'] |
2569 self.vcs = self.initVCS() |
2569 self.vcs = self.initVCS() |
2570 self.closeAct.setEnabled(True) |
2570 self.closeAct.setEnabled(True) |
2571 self.saveasAct.setEnabled(True) |
2571 self.saveasAct.setEnabled(True) |
2584 self.menuApidocAct.setEnabled(True) |
2584 self.menuApidocAct.setEnabled(True) |
2585 self.menuPackagersAct.setEnabled(True) |
2585 self.menuPackagersAct.setEnabled(True) |
2586 self.pluginGrp.setEnabled( |
2586 self.pluginGrp.setEnabled( |
2587 self.pdata["PROJECTTYPE"][0] == "E4Plugin") |
2587 self.pdata["PROJECTTYPE"][0] == "E4Plugin") |
2588 self.addLanguageAct.setEnabled( |
2588 self.addLanguageAct.setEnabled( |
2589 len(self.pdata["TRANSLATIONPATTERN"]) > 0 and \ |
2589 len(self.pdata["TRANSLATIONPATTERN"]) > 0 and |
2590 self.pdata["TRANSLATIONPATTERN"][0] != '') |
2590 self.pdata["TRANSLATIONPATTERN"][0] != '') |
2591 |
2591 |
2592 self.__model.projectOpened() |
2592 self.__model.projectOpened() |
2593 self.projectOpenedHooks.emit() |
2593 self.projectOpenedHooks.emit() |
2594 self.projectOpened.emit() |
2594 self.projectOpened.emit() |
2736 |
2736 |
2737 def __closeAllWindows(self): |
2737 def __closeAllWindows(self): |
2738 """ |
2738 """ |
2739 Private method to close all project related windows. |
2739 Private method to close all project related windows. |
2740 """ |
2740 """ |
2741 self.codemetrics and self.codemetrics.close() |
2741 self.codemetrics and self.codemetrics.close() |
2742 self.codecoverage and self.codecoverage.close() |
2742 self.codecoverage and self.codecoverage.close() |
2743 self.profiledata and self.profiledata.close() |
2743 self.profiledata and self.profiledata.close() |
2744 self.applicationDiagram and self.applicationDiagram.close() |
2744 self.applicationDiagram and self.applicationDiagram.close() |
2745 self.loadedDiagram and self.loadedDiagram.close() |
2745 self.loadedDiagram and self.loadedDiagram.close() |
2746 |
2746 |
2747 def closeProject(self, reopen=False, noSave=False): |
2747 def closeProject(self, reopen=False, noSave=False): |
2748 """ |
2748 """ |
2749 Public slot to close the current project. |
2749 Public slot to close the current project. |
2750 |
2750 |
2919 @param normalized flag indicating a normalized filename is wanted |
2919 @param normalized flag indicating a normalized filename is wanted |
2920 (boolean) |
2920 (boolean) |
2921 @return list of the projects scripts (list of string) |
2921 @return list of the projects scripts (list of string) |
2922 """ |
2922 """ |
2923 if normalized: |
2923 if normalized: |
2924 return [os.path.join(self.ppath, fn) for fn in |
2924 return [os.path.join(self.ppath, fn) for fn in |
2925 self.pdata["SOURCES"]] |
2925 self.pdata["SOURCES"]] |
2926 else: |
2926 else: |
2927 return self.pdata["SOURCES"] |
2927 return self.pdata["SOURCES"] |
2928 |
2928 |
2929 def getProjectType(self): |
2929 def getProjectType(self): |
3967 sorted(self.pdata["FILETYPES"].keys())): |
3967 sorted(self.pdata["FILETYPES"].keys())): |
3968 if fnmatch.fnmatch(bfn, pattern): |
3968 if fnmatch.fnmatch(bfn, pattern): |
3969 filetype = self.pdata["FILETYPES"][pattern] |
3969 filetype = self.pdata["FILETYPES"][pattern] |
3970 break |
3970 break |
3971 |
3971 |
3972 if (filetype == "SOURCES" and |
3972 if (filetype == "SOURCES" and |
3973 fn not in self.pdata["SOURCES"]) or \ |
3973 fn not in self.pdata["SOURCES"]) or \ |
3974 (filetype == "FORMS" and |
3974 (filetype == "FORMS" and |
3975 fn not in self.pdata["FORMS"]) or \ |
3975 fn not in self.pdata["FORMS"]) or \ |
3976 (filetype == "INTERFACES" and |
3976 (filetype == "INTERFACES" and |
3977 fn not in self.pdata["INTERFACES"]) or \ |
3977 fn not in self.pdata["INTERFACES"]) or \ |
3978 (filetype == "RESOURCES" and |
3978 (filetype == "RESOURCES" and |
3979 fn not in self.pdata["RESOURCES"]) or \ |
3979 fn not in self.pdata["RESOURCES"]) or \ |
3980 (filetype == "OTHERS" and fn not in self.pdata["OTHERS"]): |
3980 (filetype == "OTHERS" and fn not in self.pdata["OTHERS"]): |
3981 if autoInclude and AI: |
3981 if autoInclude and AI: |
3982 self.appendFile(ns) |
3982 self.appendFile(ns) |
3983 else: |
3983 else: |
4359 if fn is not None: |
4359 if fn is not None: |
4360 tfn = Utilities.getTestFileName(fn) |
4360 tfn = Utilities.getTestFileName(fn) |
4361 basename = os.path.splitext(fn)[0] |
4361 basename = os.path.splitext(fn)[0] |
4362 tbasename = os.path.splitext(tfn)[0] |
4362 tbasename = os.path.splitext(tfn)[0] |
4363 self.codeProfileAct.setEnabled( |
4363 self.codeProfileAct.setEnabled( |
4364 os.path.isfile("{0}.profile".format(basename)) or \ |
4364 os.path.isfile("{0}.profile".format(basename)) or |
4365 os.path.isfile("{0}.profile".format(tbasename))) |
4365 os.path.isfile("{0}.profile".format(tbasename))) |
4366 self.codeCoverageAct.setEnabled( |
4366 self.codeCoverageAct.setEnabled( |
4367 self.isPy3Project() and \ |
4367 self.isPy3Project() and |
4368 (os.path.isfile("{0}.coverage".format(basename)) or \ |
4368 (os.path.isfile("{0}.coverage".format(basename)) or |
4369 os.path.isfile("{0}.coverage".format(tbasename)))) |
4369 os.path.isfile("{0}.coverage".format(tbasename)))) |
4370 else: |
4370 else: |
4371 self.codeProfileAct.setEnabled(False) |
4371 self.codeProfileAct.setEnabled(False) |
4372 self.codeCoverageAct.setEnabled(False) |
4372 self.codeCoverageAct.setEnabled(False) |
4373 |
4373 |
4630 self.ui, |
4630 self.ui, |
4631 self.trUtf8("Create Plugin Archive"), |
4631 self.trUtf8("Create Plugin Archive"), |
4632 self.trUtf8( |
4632 self.trUtf8( |
4633 """<p>The file <b>{0}</b> could not be stored """ |
4633 """<p>The file <b>{0}</b> could not be stored """ |
4634 """in the archive. Ignoring it.</p>""" |
4634 """in the archive. Ignoring it.</p>""" |
4635 """<p>Reason: {1}</p>""")\ |
4635 """<p>Reason: {1}</p>""") |
4636 .format(os.path.join(self.ppath, name), str(why))) |
4636 .format(os.path.join(self.ppath, name), str(why))) |
4637 archiveFile.writestr("VERSION", version.encode("utf-8")) |
4637 archiveFile.writestr("VERSION", version.encode("utf-8")) |
4638 archiveFile.close() |
4638 archiveFile.close() |
4639 |
4639 |
4640 if not archive in self.pdata["OTHERS"]: |
4640 if not archive in self.pdata["OTHERS"]: |
4644 self.ui.showNotification( |
4644 self.ui.showNotification( |
4645 UI.PixmapCache.getPixmap("pluginArchive48.png"), |
4645 UI.PixmapCache.getPixmap("pluginArchive48.png"), |
4646 self.trUtf8("Create Plugin Archive"), |
4646 self.trUtf8("Create Plugin Archive"), |
4647 self.trUtf8( |
4647 self.trUtf8( |
4648 """<p>The eric5 plugin archive file <b>{0}</b> was """ |
4648 """<p>The eric5 plugin archive file <b>{0}</b> was """ |
4649 """created successfully.</p>""")\ |
4649 """created successfully.</p>""") |
4650 .format(os.path.basename(archive))) |
4650 .format(os.path.basename(archive))) |
4651 else: |
4651 else: |
4652 E5MessageBox.information( |
4652 E5MessageBox.information( |
4653 self.ui, |
4653 self.ui, |
4654 self.trUtf8("Create Plugin Archive"), |
4654 self.trUtf8("Create Plugin Archive"), |