eric6/Project/Project.py

changeset 7759
51aa6c6b66f7
parent 7637
c878e8255972
child 7771
787a6b3f8c9f
equal deleted inserted replaced
7758:dd54d33d21d2 7759:51aa6c6b66f7
1282 """ 1282 """
1283 Private slot to display the debugger properties dialog. 1283 Private slot to display the debugger properties dialog.
1284 """ 1284 """
1285 from .DebuggerPropertiesDialog import DebuggerPropertiesDialog 1285 from .DebuggerPropertiesDialog import DebuggerPropertiesDialog
1286 dlg = DebuggerPropertiesDialog(self) 1286 dlg = DebuggerPropertiesDialog(self)
1287 if dlg.exec_() == QDialog.Accepted: 1287 if dlg.exec() == QDialog.Accepted:
1288 dlg.storeData() 1288 dlg.storeData()
1289 1289
1290 def getDebugProperty(self, key): 1290 def getDebugProperty(self, key):
1291 """ 1291 """
1292 Public method to retrieve a debugger property. 1292 Public method to retrieve a debugger property.
1374 "You have to specify a translation pattern first.")) 1374 "You have to specify a translation pattern first."))
1375 return 1375 return
1376 1376
1377 from .AddLanguageDialog import AddLanguageDialog 1377 from .AddLanguageDialog import AddLanguageDialog
1378 dlg = AddLanguageDialog(self.parent()) 1378 dlg = AddLanguageDialog(self.parent())
1379 if dlg.exec_() == QDialog.Accepted: 1379 if dlg.exec() == QDialog.Accepted:
1380 lang = dlg.getSelectedLanguage() 1380 lang = dlg.getSelectedLanguage()
1381 if self.pdata["PROJECTTYPE"] in [ 1381 if self.pdata["PROJECTTYPE"] in [
1382 "PyQt5", "PyQt5C", "E6Plugin", "PySide2", "PySide2C" 1382 "PyQt5", "PyQt5C", "E6Plugin", "PySide2", "PySide2C"
1383 ]: 1383 ]:
1384 langFile = self.pdata["TRANSLATIONPATTERN"].replace( 1384 langFile = self.pdata["TRANSLATIONPATTERN"].replace(
1618 if startdir is None: 1618 if startdir is None:
1619 startdir = self.ppath 1619 startdir = self.ppath
1620 from .AddFileDialog import AddFileDialog 1620 from .AddFileDialog import AddFileDialog
1621 dlg = AddFileDialog(self, self.parent(), fileTypeFilter, 1621 dlg = AddFileDialog(self, self.parent(), fileTypeFilter,
1622 startdir=startdir) 1622 startdir=startdir)
1623 if dlg.exec_() == QDialog.Accepted: 1623 if dlg.exec() == QDialog.Accepted:
1624 fnames, target, isSource = dlg.getData() 1624 fnames, target, isSource = dlg.getData()
1625 if target != '': 1625 if target != '':
1626 for fn in fnames: 1626 for fn in fnames:
1627 targetfile = os.path.join(target, os.path.basename(fn)) 1627 targetfile = os.path.join(target, os.path.basename(fn))
1628 if not Utilities.samepath(os.path.dirname(fn), target): 1628 if not Utilities.samepath(os.path.dirname(fn), target):
1784 if startdir is None: 1784 if startdir is None:
1785 startdir = self.ppath 1785 startdir = self.ppath
1786 from .AddDirectoryDialog import AddDirectoryDialog 1786 from .AddDirectoryDialog import AddDirectoryDialog
1787 dlg = AddDirectoryDialog( 1787 dlg = AddDirectoryDialog(
1788 self, fileTypeFilter, self.parent(), startdir=startdir) 1788 self, fileTypeFilter, self.parent(), startdir=startdir)
1789 if dlg.exec_() == QDialog.Accepted: 1789 if dlg.exec() == QDialog.Accepted:
1790 filetype, source, target, recursive = dlg.getData() 1790 filetype, source, target, recursive = dlg.getData()
1791 if target == '': 1791 if target == '':
1792 E5MessageBox.critical( 1792 E5MessageBox.critical(
1793 self.ui, 1793 self.ui,
1794 self.tr("Add directory"), 1794 self.tr("Add directory"),
2282 if not self.checkDirty(): 2282 if not self.checkDirty():
2283 return 2283 return
2284 2284
2285 from .PropertiesDialog import PropertiesDialog 2285 from .PropertiesDialog import PropertiesDialog
2286 dlg = PropertiesDialog(self, True) 2286 dlg = PropertiesDialog(self, True)
2287 if dlg.exec_() == QDialog.Accepted: 2287 if dlg.exec() == QDialog.Accepted:
2288 self.closeProject() 2288 self.closeProject()
2289 dlg.storeData() 2289 dlg.storeData()
2290 self.pdata["VCS"] = 'None' 2290 self.pdata["VCS"] = 'None'
2291 self.opened = True 2291 self.opened = True
2292 if not self.pdata["FILETYPES"]: 2292 if not self.pdata["FILETYPES"]:
2516 if vcores: 2516 if vcores:
2517 from VCS.CommandOptionsDialog import ( 2517 from VCS.CommandOptionsDialog import (
2518 VcsCommandOptionsDialog 2518 VcsCommandOptionsDialog
2519 ) 2519 )
2520 codlg = VcsCommandOptionsDialog(self.vcs) 2520 codlg = VcsCommandOptionsDialog(self.vcs)
2521 if codlg.exec_() == QDialog.Accepted: 2521 if codlg.exec() == QDialog.Accepted:
2522 self.vcs.vcsSetOptions(codlg.getOptions()) 2522 self.vcs.vcsSetOptions(codlg.getOptions())
2523 # add project file to repository 2523 # add project file to repository
2524 if res == 0: 2524 if res == 0:
2525 apres = E5MessageBox.yesNo( 2525 apres = E5MessageBox.yesNo(
2526 self.ui, 2526 self.ui,
2568 else: 2568 else:
2569 self.pdata["VCS"] = 'None' 2569 self.pdata["VCS"] = 'None'
2570 self.vcs = self.initVCS() 2570 self.vcs = self.initVCS()
2571 if self.vcs is not None: 2571 if self.vcs is not None:
2572 vcsdlg = self.vcs.vcsOptionsDialog(self, self.name) 2572 vcsdlg = self.vcs.vcsOptionsDialog(self, self.name)
2573 if vcsdlg.exec_() == QDialog.Accepted: 2573 if vcsdlg.exec() == QDialog.Accepted:
2574 vcsDataDict = vcsdlg.getData() 2574 vcsDataDict = vcsdlg.getData()
2575 else: 2575 else:
2576 self.pdata["VCS"] = 'None' 2576 self.pdata["VCS"] = 'None'
2577 self.vcs = self.initVCS() 2577 self.vcs = self.initVCS()
2578 self.setDirty(True) 2578 self.setDirty(True)
2590 if vcores: 2590 if vcores:
2591 from VCS.CommandOptionsDialog import ( 2591 from VCS.CommandOptionsDialog import (
2592 VcsCommandOptionsDialog 2592 VcsCommandOptionsDialog
2593 ) 2593 )
2594 codlg = VcsCommandOptionsDialog(self.vcs) 2594 codlg = VcsCommandOptionsDialog(self.vcs)
2595 if codlg.exec_() == QDialog.Accepted: 2595 if codlg.exec() == QDialog.Accepted:
2596 self.vcs.vcsSetOptions(codlg.getOptions()) 2596 self.vcs.vcsSetOptions(codlg.getOptions())
2597 2597
2598 # create the project in the VCS 2598 # create the project in the VCS
2599 self.vcs.vcsSetDataFromDict(vcsDataDict) 2599 self.vcs.vcsSetDataFromDict(vcsDataDict)
2600 self.saveProject() 2600 self.saveProject()
2707 """ 2707 """
2708 Private slot to display the properties dialog. 2708 Private slot to display the properties dialog.
2709 """ 2709 """
2710 from .PropertiesDialog import PropertiesDialog 2710 from .PropertiesDialog import PropertiesDialog
2711 dlg = PropertiesDialog(self, False) 2711 dlg = PropertiesDialog(self, False)
2712 if dlg.exec_() == QDialog.Accepted: 2712 if dlg.exec() == QDialog.Accepted:
2713 projectType = self.pdata["PROJECTTYPE"] 2713 projectType = self.pdata["PROJECTTYPE"]
2714 dlg.storeData() 2714 dlg.storeData()
2715 self.setDirty(True) 2715 self.setDirty(True)
2716 if self.pdata["MAINSCRIPT"]: 2716 if self.pdata["MAINSCRIPT"]:
2717 if not os.path.isabs(self.pdata["MAINSCRIPT"]): 2717 if not os.path.isabs(self.pdata["MAINSCRIPT"]):
2782 vcsSystem = self.pdata["VCS"] or None 2782 vcsSystem = self.pdata["VCS"] or None
2783 vcsSystemOverride = self.pudata["VCSOVERRIDE"] or None 2783 vcsSystemOverride = self.pudata["VCSOVERRIDE"] or None
2784 2784
2785 from .UserPropertiesDialog import UserPropertiesDialog 2785 from .UserPropertiesDialog import UserPropertiesDialog
2786 dlg = UserPropertiesDialog(self) 2786 dlg = UserPropertiesDialog(self)
2787 if dlg.exec_() == QDialog.Accepted: 2787 if dlg.exec() == QDialog.Accepted:
2788 dlg.storeData() 2788 dlg.storeData()
2789 2789
2790 if ( 2790 if (
2791 (self.pdata["VCS"] and 2791 (self.pdata["VCS"] and
2792 self.pdata["VCS"] != vcsSystem) or 2792 self.pdata["VCS"] != vcsSystem) or
2827 """ 2827 """
2828 Private slot to display the filetype association dialog. 2828 Private slot to display the filetype association dialog.
2829 """ 2829 """
2830 from .FiletypeAssociationDialog import FiletypeAssociationDialog 2830 from .FiletypeAssociationDialog import FiletypeAssociationDialog
2831 dlg = FiletypeAssociationDialog(self) 2831 dlg = FiletypeAssociationDialog(self)
2832 if dlg.exec_() == QDialog.Accepted: 2832 if dlg.exec() == QDialog.Accepted:
2833 dlg.transferData() 2833 dlg.transferData()
2834 self.setDirty(True) 2834 self.setDirty(True)
2835 self.__reorganizeFiles() 2835 self.__reorganizeFiles()
2836 2836
2837 def __showLexerAssociations(self): 2837 def __showLexerAssociations(self):
2838 """ 2838 """
2839 Private slot to display the lexer association dialog. 2839 Private slot to display the lexer association dialog.
2840 """ 2840 """
2841 from .LexerAssociationDialog import LexerAssociationDialog 2841 from .LexerAssociationDialog import LexerAssociationDialog
2842 dlg = LexerAssociationDialog(self) 2842 dlg = LexerAssociationDialog(self)
2843 if dlg.exec_() == QDialog.Accepted: 2843 if dlg.exec() == QDialog.Accepted:
2844 dlg.transferData() 2844 dlg.transferData()
2845 self.setDirty(True) 2845 self.setDirty(True)
2846 self.lexerAssociationsChanged.emit() 2846 self.lexerAssociationsChanged.emit()
2847 2847
2848 def getEditorLexerAssoc(self, filename): 2848 def getEditorLexerAssoc(self, filename):
4698 return 4698 return
4699 4699
4700 # autoInclude is not set, show a dialog 4700 # autoInclude is not set, show a dialog
4701 from .AddFoundFilesDialog import AddFoundFilesDialog 4701 from .AddFoundFilesDialog import AddFoundFilesDialog
4702 dlg = AddFoundFilesDialog(newFiles, self.parent(), None) 4702 dlg = AddFoundFilesDialog(newFiles, self.parent(), None)
4703 res = dlg.exec_() 4703 res = dlg.exec()
4704 4704
4705 # the 'Add All' button was pressed 4705 # the 'Add All' button was pressed
4706 if res == 1: 4706 if res == 1:
4707 for file in newFiles: 4707 for file in newFiles:
4708 self.appendFile(file) 4708 self.appendFile(file)
5322 elif len(pkglists) > 1: 5322 elif len(pkglists) > 1:
5323 dlg = E5ListSelectionDialog( 5323 dlg = E5ListSelectionDialog(
5324 sorted(pkglists), title=self.tr("Create Plugin Archive"), 5324 sorted(pkglists), title=self.tr("Create Plugin Archive"),
5325 message=self.tr("Select package lists:"), 5325 message=self.tr("Select package lists:"),
5326 checkBoxSelection=True) 5326 checkBoxSelection=True)
5327 if dlg.exec_() == QDialog.Accepted: 5327 if dlg.exec() == QDialog.Accepted:
5328 selectedLists = [os.path.join(self.ppath, s) 5328 selectedLists = [os.path.join(self.ppath, s)
5329 for s in dlg.getSelection()] 5329 for s in dlg.getSelection()]
5330 else: 5330 else:
5331 return 5331 return
5332 5332

eric ide

mercurial