30 ) |
30 ) |
31 from PyQt6.QtGui import QKeySequence, QAction |
31 from PyQt6.QtGui import QKeySequence, QAction |
32 from PyQt6.QtWidgets import QLineEdit, QToolBar, QDialog, QInputDialog, QMenu |
32 from PyQt6.QtWidgets import QLineEdit, QToolBar, QDialog, QInputDialog, QMenu |
33 from PyQt6.Qsci import QsciScintilla |
33 from PyQt6.Qsci import QsciScintilla |
34 |
34 |
35 from EricWidgets.EricApplication import ericApp |
35 from eric7.EricWidgets.EricApplication import ericApp |
36 from EricWidgets import EricFileDialog, EricMessageBox |
36 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
37 from EricWidgets.EricListSelectionDialog import EricListSelectionDialog |
37 from eric7.EricWidgets.EricListSelectionDialog import EricListSelectionDialog |
38 from EricWidgets.EricProgressDialog import EricProgressDialog |
38 from eric7.EricWidgets.EricProgressDialog import EricProgressDialog |
39 from EricGui.EricOverrideCursor import EricOverrideCursor, EricOverridenCursor |
39 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor, EricOverridenCursor |
40 |
40 |
41 from Globals import recentNameProject |
41 from eric7.Globals import recentNameProject |
42 |
42 |
43 import UI.PixmapCache |
43 from eric7.EricGui import EricPixmapCache |
44 from UI.NotificationWidget import NotificationTypes |
44 from eric7.UI import Config |
45 |
45 from eric7.UI.NotificationWidget import NotificationTypes |
46 from EricGui.EricAction import EricAction, createActionGroup |
46 |
47 |
47 from eric7.EricGui.EricAction import EricAction, createActionGroup |
48 import Globals |
48 |
49 import Preferences |
49 from eric7 import Globals, Preferences, Utilities |
50 import Utilities |
|
51 |
50 |
52 from .ProjectFile import ProjectFile |
51 from .ProjectFile import ProjectFile |
53 from .UserProjectFile import UserProjectFile |
52 from .UserProjectFile import UserProjectFile |
54 from .DebuggerPropertiesFile import DebuggerPropertiesFile |
53 from .DebuggerPropertiesFile import DebuggerPropertiesFile |
55 |
54 |
56 from Sessions.SessionFile import SessionFile |
55 from eric7.Sessions.SessionFile import SessionFile |
57 |
56 |
58 from Tasks.TasksFile import TasksFile |
57 from eric7.Tasks.TasksFile import TasksFile |
59 |
58 |
60 from CodeFormatting.BlackFormattingAction import BlackFormattingAction |
59 from eric7.CodeFormatting.BlackFormattingAction import BlackFormattingAction |
61 |
60 |
62 |
61 |
63 class Project(QObject): |
62 class Project(QObject): |
64 """ |
63 """ |
65 Class implementing the project management functionality. |
64 Class implementing the project management functionality. |
867 res = self.__projectFile.readFile(fn) |
866 res = self.__projectFile.readFile(fn) |
868 else: |
867 else: |
869 # old XML based format |
868 # old XML based format |
870 f = QFile(fn) |
869 f = QFile(fn) |
871 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
870 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
872 from EricXML.ProjectReader import ProjectReader |
871 from eric7.EricXML.ProjectReader import ProjectReader |
873 |
872 |
874 reader = ProjectReader(f, self) |
873 reader = ProjectReader(f, self) |
875 reader.readXML() |
874 reader.readXML() |
876 res = not reader.hasError() |
875 res = not reader.hasError() |
877 f.close() |
876 f.close() |
1009 # try the old XML based format second |
1008 # try the old XML based format second |
1010 fn = os.path.join(self.getProjectManagementDir(), "{0}.e4q".format(fn1)) |
1009 fn = os.path.join(self.getProjectManagementDir(), "{0}.e4q".format(fn1)) |
1011 if os.path.exists(fn): |
1010 if os.path.exists(fn): |
1012 f = QFile(fn) |
1011 f = QFile(fn) |
1013 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1012 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1014 from EricXML.UserProjectReader import UserProjectReader |
1013 from eric7.EricXML.UserProjectReader import UserProjectReader |
1015 |
1014 |
1016 reader = UserProjectReader(f, self) |
1015 reader = UserProjectReader(f, self) |
1017 reader.readXML() |
1016 reader.readXML() |
1018 f.close() |
1017 f.close() |
1019 else: |
1018 else: |
1085 self.getProjectManagementDir(), "{0}{1}.e5s".format(fn1, indicator) |
1084 self.getProjectManagementDir(), "{0}{1}.e5s".format(fn1, indicator) |
1086 ) |
1085 ) |
1087 if os.path.exists(fn): |
1086 if os.path.exists(fn): |
1088 f = QFile(fn) |
1087 f = QFile(fn) |
1089 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1088 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1090 from EricXML.SessionReader import SessionReader |
1089 from eric7.EricXML.SessionReader import SessionReader |
1091 |
1090 |
1092 reader = SessionReader(f, False) |
1091 reader = SessionReader(f, False) |
1093 reader.readXML(quiet=quiet) |
1092 reader.readXML(quiet=quiet) |
1094 f.close() |
1093 f.close() |
1095 else: |
1094 else: |
1180 # try old style XML file second |
1179 # try old style XML file second |
1181 fn = os.path.join(self.getProjectManagementDir(), "{0}.e6t".format(base)) |
1180 fn = os.path.join(self.getProjectManagementDir(), "{0}.e6t".format(base)) |
1182 if os.path.exists(fn): |
1181 if os.path.exists(fn): |
1183 f = QFile(fn) |
1182 f = QFile(fn) |
1184 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1183 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1185 from EricXML.TasksReader import TasksReader |
1184 from eric7.EricXML.TasksReader import TasksReader |
1186 |
1185 |
1187 reader = TasksReader(f, True) |
1186 reader = TasksReader(f, True) |
1188 reader.readXML() |
1187 reader.readXML() |
1189 f.close() |
1188 f.close() |
1190 else: |
1189 else: |
1259 # try the old XML based format second |
1258 # try the old XML based format second |
1260 fn = os.path.join(self.getProjectManagementDir(), "{0}.e4d".format(fn1)) |
1259 fn = os.path.join(self.getProjectManagementDir(), "{0}.e4d".format(fn1)) |
1261 |
1260 |
1262 f = QFile(fn) |
1261 f = QFile(fn) |
1263 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1262 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1264 from EricXML.DebuggerPropertiesReader import DebuggerPropertiesReader |
1263 from eric7.EricXML.DebuggerPropertiesReader import ( |
|
1264 DebuggerPropertiesReader, |
|
1265 ) |
1265 |
1266 |
1266 reader = DebuggerPropertiesReader(f, self) |
1267 reader = DebuggerPropertiesReader(f, self) |
1267 reader.readXML(quiet=quiet) |
1268 reader.readXML(quiet=quiet) |
1268 f.close() |
1269 f.close() |
1269 self.debugPropertiesLoaded = True |
1270 self.debugPropertiesLoaded = True |
4163 act.triggered.connect(self.createNewProject) |
4166 act.triggered.connect(self.createNewProject) |
4164 self.actions.append(act) |
4167 self.actions.append(act) |
4165 |
4168 |
4166 act = EricAction( |
4169 act = EricAction( |
4167 self.tr("Open project"), |
4170 self.tr("Open project"), |
4168 UI.PixmapCache.getIcon("projectOpen"), |
4171 EricPixmapCache.getIcon("projectOpen"), |
4169 self.tr("&Open..."), |
4172 self.tr("&Open..."), |
4170 0, |
4173 0, |
4171 0, |
4174 0, |
4172 self.actGrp1, |
4175 self.actGrp1, |
4173 "project_open", |
4176 "project_open", |
4195 self.closeAct.triggered.connect(self.closeProject) |
4198 self.closeAct.triggered.connect(self.closeProject) |
4196 self.actions.append(self.closeAct) |
4199 self.actions.append(self.closeAct) |
4197 |
4200 |
4198 self.saveAct = EricAction( |
4201 self.saveAct = EricAction( |
4199 self.tr("Save project"), |
4202 self.tr("Save project"), |
4200 UI.PixmapCache.getIcon("projectSave"), |
4203 EricPixmapCache.getIcon("projectSave"), |
4201 self.tr("&Save"), |
4204 self.tr("&Save"), |
4202 0, |
4205 0, |
4203 0, |
4206 0, |
4204 self, |
4207 self, |
4205 "project_save", |
4208 "project_save", |
4211 self.saveAct.triggered.connect(self.saveProject) |
4214 self.saveAct.triggered.connect(self.saveProject) |
4212 self.actions.append(self.saveAct) |
4215 self.actions.append(self.saveAct) |
4213 |
4216 |
4214 self.saveasAct = EricAction( |
4217 self.saveasAct = EricAction( |
4215 self.tr("Save project as"), |
4218 self.tr("Save project as"), |
4216 UI.PixmapCache.getIcon("projectSaveAs"), |
4219 EricPixmapCache.getIcon("projectSaveAs"), |
4217 self.tr("Save &as..."), |
4220 self.tr("Save &as..."), |
4218 0, |
4221 0, |
4219 0, |
4222 0, |
4220 self, |
4223 self, |
4221 "project_save_as", |
4224 "project_save_as", |
4236 |
4239 |
4237 self.actGrp2 = createActionGroup(self) |
4240 self.actGrp2 = createActionGroup(self) |
4238 |
4241 |
4239 self.addFilesAct = EricAction( |
4242 self.addFilesAct = EricAction( |
4240 self.tr("Add files to project"), |
4243 self.tr("Add files to project"), |
4241 UI.PixmapCache.getIcon("fileMisc"), |
4244 EricPixmapCache.getIcon("fileMisc"), |
4242 self.tr("Add &files..."), |
4245 self.tr("Add &files..."), |
4243 0, |
4246 0, |
4244 0, |
4247 0, |
4245 self.actGrp2, |
4248 self.actGrp2, |
4246 "project_add_file", |
4249 "project_add_file", |
4257 self.addFilesAct.triggered.connect(self.addFiles) |
4260 self.addFilesAct.triggered.connect(self.addFiles) |
4258 self.actions.append(self.addFilesAct) |
4261 self.actions.append(self.addFilesAct) |
4259 |
4262 |
4260 self.addDirectoryAct = EricAction( |
4263 self.addDirectoryAct = EricAction( |
4261 self.tr("Add directory to project"), |
4264 self.tr("Add directory to project"), |
4262 UI.PixmapCache.getIcon("dirOpen"), |
4265 EricPixmapCache.getIcon("dirOpen"), |
4263 self.tr("Add directory..."), |
4266 self.tr("Add directory..."), |
4264 0, |
4267 0, |
4265 0, |
4268 0, |
4266 self.actGrp2, |
4269 self.actGrp2, |
4267 "project_add_directory", |
4270 "project_add_directory", |
4279 self.addDirectoryAct.triggered.connect(self.addDirectory) |
4282 self.addDirectoryAct.triggered.connect(self.addDirectory) |
4280 self.actions.append(self.addDirectoryAct) |
4283 self.actions.append(self.addDirectoryAct) |
4281 |
4284 |
4282 self.addLanguageAct = EricAction( |
4285 self.addLanguageAct = EricAction( |
4283 self.tr("Add translation to project"), |
4286 self.tr("Add translation to project"), |
4284 UI.PixmapCache.getIcon("linguist4"), |
4287 EricPixmapCache.getIcon("linguist4"), |
4285 self.tr("Add &translation..."), |
4288 self.tr("Add &translation..."), |
4286 0, |
4289 0, |
4287 0, |
4290 0, |
4288 self.actGrp2, |
4291 self.actGrp2, |
4289 "project_add_translation", |
4292 "project_add_translation", |
4339 act.triggered.connect(self.__searchProjectFile) |
4342 act.triggered.connect(self.__searchProjectFile) |
4340 self.actions.append(act) |
4343 self.actions.append(act) |
4341 |
4344 |
4342 self.propsAct = EricAction( |
4345 self.propsAct = EricAction( |
4343 self.tr("Project properties"), |
4346 self.tr("Project properties"), |
4344 UI.PixmapCache.getIcon("projectProps"), |
4347 EricPixmapCache.getIcon("projectProps"), |
4345 self.tr("&Properties..."), |
4348 self.tr("&Properties..."), |
4346 0, |
4349 0, |
4347 0, |
4350 0, |
4348 self, |
4351 self, |
4349 "project_properties", |
4352 "project_properties", |
4358 self.propsAct.triggered.connect(self.__showProperties) |
4361 self.propsAct.triggered.connect(self.__showProperties) |
4359 self.actions.append(self.propsAct) |
4362 self.actions.append(self.propsAct) |
4360 |
4363 |
4361 self.userPropsAct = EricAction( |
4364 self.userPropsAct = EricAction( |
4362 self.tr("User project properties"), |
4365 self.tr("User project properties"), |
4363 UI.PixmapCache.getIcon("projectUserProps"), |
4366 EricPixmapCache.getIcon("projectUserProps"), |
4364 self.tr("&User Properties..."), |
4367 self.tr("&User Properties..."), |
4365 0, |
4368 0, |
4366 0, |
4369 0, |
4367 self, |
4370 self, |
4368 "project_user_properties", |
4371 "project_user_properties", |
4715 |
4718 |
4716 self.pluginGrp = createActionGroup(self) |
4719 self.pluginGrp = createActionGroup(self) |
4717 |
4720 |
4718 self.pluginPkgListAct = EricAction( |
4721 self.pluginPkgListAct = EricAction( |
4719 self.tr("Create Package List"), |
4722 self.tr("Create Package List"), |
4720 UI.PixmapCache.getIcon("pluginArchiveList"), |
4723 EricPixmapCache.getIcon("pluginArchiveList"), |
4721 self.tr("Create &Package List"), |
4724 self.tr("Create &Package List"), |
4722 0, |
4725 0, |
4723 0, |
4726 0, |
4724 self.pluginGrp, |
4727 self.pluginGrp, |
4725 "project_plugin_pkglist", |
4728 "project_plugin_pkglist", |
4738 self.pluginPkgListAct.triggered.connect(self.__pluginCreatePkgList) |
4741 self.pluginPkgListAct.triggered.connect(self.__pluginCreatePkgList) |
4739 self.actions.append(self.pluginPkgListAct) |
4742 self.actions.append(self.pluginPkgListAct) |
4740 |
4743 |
4741 self.pluginArchiveAct = EricAction( |
4744 self.pluginArchiveAct = EricAction( |
4742 self.tr("Create Plugin Archives"), |
4745 self.tr("Create Plugin Archives"), |
4743 UI.PixmapCache.getIcon("pluginArchive"), |
4746 EricPixmapCache.getIcon("pluginArchive"), |
4744 self.tr("Create Plugin &Archives"), |
4747 self.tr("Create Plugin &Archives"), |
4745 0, |
4748 0, |
4746 0, |
4749 0, |
4747 self.pluginGrp, |
4750 self.pluginGrp, |
4748 "project_plugin_archive", |
4751 "project_plugin_archive", |
4760 self.pluginArchiveAct.triggered.connect(self.__pluginCreateArchives) |
4763 self.pluginArchiveAct.triggered.connect(self.__pluginCreateArchives) |
4761 self.actions.append(self.pluginArchiveAct) |
4764 self.actions.append(self.pluginArchiveAct) |
4762 |
4765 |
4763 self.pluginSArchiveAct = EricAction( |
4766 self.pluginSArchiveAct = EricAction( |
4764 self.tr("Create Plugin Archives (Snapshot)"), |
4767 self.tr("Create Plugin Archives (Snapshot)"), |
4765 UI.PixmapCache.getIcon("pluginArchiveSnapshot"), |
4768 EricPixmapCache.getIcon("pluginArchiveSnapshot"), |
4766 self.tr("Create Plugin Archives (&Snapshot)"), |
4769 self.tr("Create Plugin Archives (&Snapshot)"), |
4767 0, |
4770 0, |
4768 0, |
4771 0, |
4769 self.pluginGrp, |
4772 self.pluginGrp, |
4770 "project_plugin_sarchive", |
4773 "project_plugin_sarchive", |
5269 @param toolbarManager reference to a toolbar manager object |
5272 @param toolbarManager reference to a toolbar manager object |
5270 (EricToolBarManager) |
5273 (EricToolBarManager) |
5271 @return tuple of the generated toolbars (tuple of two QToolBar) |
5274 @return tuple of the generated toolbars (tuple of two QToolBar) |
5272 """ |
5275 """ |
5273 tb = QToolBar(self.tr("Project"), self.ui) |
5276 tb = QToolBar(self.tr("Project"), self.ui) |
5274 tb.setIconSize(UI.Config.ToolBarIconSize) |
5277 tb.setIconSize(Config.ToolBarIconSize) |
5275 tb.setObjectName("ProjectToolbar") |
5278 tb.setObjectName("ProjectToolbar") |
5276 tb.setToolTip(self.tr("Project")) |
5279 tb.setToolTip(self.tr("Project")) |
5277 |
5280 |
5278 tb.addActions(self.actGrp1.actions()) |
5281 tb.addActions(self.actGrp1.actions()) |
5279 tb.addAction(self.closeAct) |
5282 tb.addAction(self.closeAct) |
5286 toolbarManager.addAction(self.addDirectoryAct, tb.windowTitle()) |
5289 toolbarManager.addAction(self.addDirectoryAct, tb.windowTitle()) |
5287 toolbarManager.addAction(self.addLanguageAct, tb.windowTitle()) |
5290 toolbarManager.addAction(self.addLanguageAct, tb.windowTitle()) |
5288 toolbarManager.addAction(self.propsAct, tb.windowTitle()) |
5291 toolbarManager.addAction(self.propsAct, tb.windowTitle()) |
5289 toolbarManager.addAction(self.userPropsAct, tb.windowTitle()) |
5292 toolbarManager.addAction(self.userPropsAct, tb.windowTitle()) |
5290 |
5293 |
5291 import VCS |
5294 from eric7 import VCS |
5292 |
5295 |
5293 vcstb = VCS.getBasicHelper(self).initBasicToolbar(self.ui, toolbarManager) |
5296 vcstb = VCS.getBasicHelper(self).initBasicToolbar(self.ui, toolbarManager) |
5294 |
5297 |
5295 return tb, vcstb |
5298 return tb, vcstb |
5296 |
5299 |
5672 vcsother = copy.deepcopy(self.pdata["VCSOTHERDATA"]) |
5675 vcsother = copy.deepcopy(self.pdata["VCSOTHERDATA"]) |
5673 vcs.vcsSetOtherData(vcsother) |
5676 vcs.vcsSetOtherData(vcsother) |
5674 |
5677 |
5675 if forProject: |
5678 if forProject: |
5676 if vcs is None: |
5679 if vcs is None: |
5677 import VCS |
5680 from eric7 import VCS |
5678 |
5681 |
5679 self.vcsProjectHelper = VCS.getBasicHelper(self) |
5682 self.vcsProjectHelper = VCS.getBasicHelper(self) |
5680 self.vcsBasicHelper = True |
5683 self.vcsBasicHelper = True |
5681 else: |
5684 else: |
5682 self.vcsProjectHelper = vcs.vcsGetProjectHelper(self) |
5685 self.vcsProjectHelper = vcs.vcsGetProjectHelper(self) |
5779 files = [ |
5782 files = [ |
5780 os.path.join(self.ppath, file) |
5783 os.path.join(self.ppath, file) |
5781 for file in self.pdata["SOURCES"] |
5784 for file in self.pdata["SOURCES"] |
5782 if file.endswith(".py") |
5785 if file.endswith(".py") |
5783 ] |
5786 ] |
5784 from DataViews.CodeMetricsDialog import CodeMetricsDialog |
5787 from eric7.DataViews.CodeMetricsDialog import CodeMetricsDialog |
5785 |
5788 |
5786 self.codemetrics = CodeMetricsDialog() |
5789 self.codemetrics = CodeMetricsDialog() |
5787 self.codemetrics.show() |
5790 self.codemetrics.show() |
5788 self.codemetrics.prepare(files) |
5791 self.codemetrics.prepare(files) |
5789 |
5792 |
5825 files = [ |
5828 files = [ |
5826 os.path.join(self.ppath, file) |
5829 os.path.join(self.ppath, file) |
5827 for file in self.pdata["SOURCES"] |
5830 for file in self.pdata["SOURCES"] |
5828 if os.path.splitext(file)[1].startswith(".py") |
5831 if os.path.splitext(file)[1].startswith(".py") |
5829 ] |
5832 ] |
5830 from DataViews.PyCoverageDialog import PyCoverageDialog |
5833 from eric7.DataViews.PyCoverageDialog import PyCoverageDialog |
5831 |
5834 |
5832 self.codecoverage = PyCoverageDialog() |
5835 self.codecoverage = PyCoverageDialog() |
5833 self.codecoverage.show() |
5836 self.codecoverage.show() |
5834 self.codecoverage.start(fn, files) |
5837 self.codecoverage.start(fn, files) |
5835 |
5838 |
5909 self.tr("Application Diagram"), |
5912 self.tr("Application Diagram"), |
5910 self.tr("""Include module names?"""), |
5913 self.tr("""Include module names?"""), |
5911 yesDefault=True, |
5914 yesDefault=True, |
5912 ) |
5915 ) |
5913 |
5916 |
5914 from Graphics.UMLDialog import UMLDialog, UMLDialogType |
5917 from eric7.Graphics.UMLDialog import UMLDialog, UMLDialogType |
5915 |
5918 |
5916 self.applicationDiagram = UMLDialog( |
5919 self.applicationDiagram = UMLDialog( |
5917 UMLDialogType.APPLICATION_DIAGRAM, self, self.parent(), noModules=not res |
5920 UMLDialogType.APPLICATION_DIAGRAM, self, self.parent(), noModules=not res |
5918 ) |
5921 ) |
5919 self.applicationDiagram.show() |
5922 self.applicationDiagram.show() |
5920 |
5923 |
5921 def __loadDiagram(self): |
5924 def __loadDiagram(self): |
5922 """ |
5925 """ |
5923 Private slot to load a diagram from file. |
5926 Private slot to load a diagram from file. |
5924 """ |
5927 """ |
5925 from Graphics.UMLDialog import UMLDialog, UMLDialogType |
5928 from eric7.Graphics.UMLDialog import UMLDialog, UMLDialogType |
5926 |
5929 |
5927 self.loadedDiagram = None |
5930 self.loadedDiagram = None |
5928 loadedDiagram = UMLDialog(UMLDialogType.NO_DIAGRAM, self, parent=self.parent()) |
5931 loadedDiagram = UMLDialog(UMLDialogType.NO_DIAGRAM, self, parent=self.parent()) |
5929 if loadedDiagram.load(): |
5932 if loadedDiagram.load(): |
5930 self.loadedDiagram = loadedDiagram |
5933 self.loadedDiagram = loadedDiagram |
6289 |
6292 |
6290 progress.setValue(len(selectedLists)) |
6293 progress.setValue(len(selectedLists)) |
6291 |
6294 |
6292 if errors: |
6295 if errors: |
6293 self.ui.showNotification( |
6296 self.ui.showNotification( |
6294 UI.PixmapCache.getPixmap("pluginArchive48"), |
6297 EricPixmapCache.getPixmap("pluginArchive48"), |
6295 self.tr("Create Plugin Archive"), |
6298 self.tr("Create Plugin Archive"), |
6296 self.tr( |
6299 self.tr( |
6297 "<p>The eric plugin archive files were " |
6300 "<p>The eric plugin archive files were " |
6298 "created with some errors.</p>" |
6301 "created with some errors.</p>" |
6299 ), |
6302 ), |
6300 kind=NotificationTypes.CRITICAL, |
6303 kind=NotificationTypes.CRITICAL, |
6301 timeout=0, |
6304 timeout=0, |
6302 ) |
6305 ) |
6303 else: |
6306 else: |
6304 self.ui.showNotification( |
6307 self.ui.showNotification( |
6305 UI.PixmapCache.getPixmap("pluginArchive48"), |
6308 EricPixmapCache.getPixmap("pluginArchive48"), |
6306 self.tr("Create Plugin Archive"), |
6309 self.tr("Create Plugin Archive"), |
6307 self.tr( |
6310 self.tr( |
6308 "<p>The eric plugin archive files were " "created successfully.</p>" |
6311 "<p>The eric plugin archive files were " "created successfully.</p>" |
6309 ), |
6312 ), |
6310 ) |
6313 ) |
6576 """<p>There are changes that require the default""" |
6579 """<p>There are changes that require the default""" |
6577 """ make target to be rebuilt.</p>""" |
6580 """ make target to be rebuilt.</p>""" |
6578 ) |
6581 ) |
6579 |
6582 |
6580 self.ui.showNotification( |
6583 self.ui.showNotification( |
6581 UI.PixmapCache.getPixmap("makefile48"), |
6584 EricPixmapCache.getPixmap("makefile48"), |
6582 title, |
6585 title, |
6583 message, |
6586 message, |
6584 kind=NotificationTypes.WARNING, |
6587 kind=NotificationTypes.WARNING, |
6585 timeout=0, |
6588 timeout=0, |
6586 ) |
6589 ) |
6764 </ul> |
6767 </ul> |
6765 |
6768 |
6766 @param action formatting operation to be performed |
6769 @param action formatting operation to be performed |
6767 @type BlackFormattingAction |
6770 @type BlackFormattingAction |
6768 """ |
6771 """ |
6769 from CodeFormatting.BlackConfigurationDialog import BlackConfigurationDialog |
6772 from eric7.CodeFormatting.BlackConfigurationDialog import ( |
6770 from CodeFormatting.BlackFormattingDialog import BlackFormattingDialog |
6773 BlackConfigurationDialog, |
|
6774 ) |
|
6775 from eric7.CodeFormatting.BlackFormattingDialog import BlackFormattingDialog |
6771 |
6776 |
6772 if ericApp().getObject("ViewManager").checkAllDirty(): |
6777 if ericApp().getObject("ViewManager").checkAllDirty(): |
6773 dlg = BlackConfigurationDialog(withProject=True) |
6778 dlg = BlackConfigurationDialog(withProject=True) |
6774 if dlg.exec() == QDialog.DialogCode.Accepted: |
6779 if dlg.exec() == QDialog.DialogCode.Accepted: |
6775 config = dlg.getConfiguration(saveToProject=True) |
6780 config = dlg.getConfiguration(saveToProject=True) |
6786 def __configureBlack(self): |
6791 def __configureBlack(self): |
6787 """ |
6792 """ |
6788 Private slot to enter the parameters for formatting the project sources with |
6793 Private slot to enter the parameters for formatting the project sources with |
6789 'Black'. |
6794 'Black'. |
6790 """ |
6795 """ |
6791 from CodeFormatting.BlackConfigurationDialog import BlackConfigurationDialog |
6796 from eric7.CodeFormatting.BlackConfigurationDialog import ( |
|
6797 BlackConfigurationDialog, |
|
6798 ) |
6792 |
6799 |
6793 dlg = BlackConfigurationDialog(withProject=True, onlyProject=True) |
6800 dlg = BlackConfigurationDialog(withProject=True, onlyProject=True) |
6794 if dlg.exec() == QDialog.DialogCode.Accepted: |
6801 if dlg.exec() == QDialog.DialogCode.Accepted: |
6795 dlg.getConfiguration(saveToProject=True) |
6802 dlg.getConfiguration(saveToProject=True) |
6796 # The data is saved to the project as a side effect. |
6803 # The data is saved to the project as a side effect. |
6848 Private method to create the embedded virtual environment. |
6855 Private method to create the embedded virtual environment. |
6849 |
6856 |
6850 @param upgrade flag indicating an upgrade operation (defaults to False) |
6857 @param upgrade flag indicating an upgrade operation (defaults to False) |
6851 @type bool (optional) |
6858 @type bool (optional) |
6852 """ |
6859 """ |
|
6860 from eric7.VirtualEnv.VirtualenvExecDialog import VirtualenvExecDialog |
6853 from .ProjectVenvCreationParametersDialog import ( |
6861 from .ProjectVenvCreationParametersDialog import ( |
6854 ProjectVenvCreationParametersDialog, |
6862 ProjectVenvCreationParametersDialog, |
6855 ) |
6863 ) |
6856 |
6864 |
6857 dlg = ProjectVenvCreationParametersDialog( |
6865 dlg = ProjectVenvCreationParametersDialog( |