Project/Project.py

changeset 1871
15376fad2097
parent 1864
1c8d0747ba9f
child 1874
7d5589d8699a
equal deleted inserted replaced
1870:2fb653ff32ec 1871:15376fad2097
1799 """ 1799 """
1800 if not self.checkDirty(): 1800 if not self.checkDirty():
1801 return 1801 return
1802 1802
1803 dlg = PropertiesDialog(self, True) 1803 dlg = PropertiesDialog(self, True)
1804 # TODO: add check box to dialog asking for a version controlled project
1805 # option should be disabled, if no VCS is available
1806 # create a separate function to determine availability of VCS systems
1804 if dlg.exec_() == QDialog.Accepted: 1807 if dlg.exec_() == QDialog.Accepted:
1805 self.closeProject() 1808 self.closeProject()
1806 dlg.storeData() 1809 dlg.storeData()
1807 self.__makePpathRe() 1810 self.__makePpathRe()
1808 self.pdata["VCS"] = ['None'] 1811 self.pdata["VCS"] = ['None']
1922 if os.path.exists(os.path.join(self.ppath, indicator)): 1925 if os.path.exists(os.path.join(self.ppath, indicator)):
1923 if len(vcsData) > 1: 1926 if len(vcsData) > 1:
1924 vcsList = [] 1927 vcsList = []
1925 for vcsSystemStr, vcsSystemDisplay in vcsData: 1928 for vcsSystemStr, vcsSystemDisplay in vcsData:
1926 vcsList.append(vcsSystemDisplay) 1929 vcsList.append(vcsSystemDisplay)
1930 # TODO: only give the selection if there is more than one entry
1927 res, vcs_ok = QInputDialog.getItem( 1931 res, vcs_ok = QInputDialog.getItem(
1928 None, 1932 None,
1929 self.trUtf8("New Project"), 1933 self.trUtf8("New Project"),
1930 self.trUtf8("Select Version Control System"), 1934 self.trUtf8("Select Version Control System"),
1931 vcsList, 1935 vcsList,
1969 self.saveProject() 1973 self.saveProject()
1970 break 1974 break
1971 1975
1972 # put the project under VCS control 1976 # put the project under VCS control
1973 if self.vcs is None: 1977 if self.vcs is None:
1978 # TODO: only follow this path, if a VCS is available and user wants
1979 # a versioned project
1974 vcsSystemsDict = e5App().getObject("PluginManager")\ 1980 vcsSystemsDict = e5App().getObject("PluginManager")\
1975 .getPluginDisplayStrings("version_control") 1981 .getPluginDisplayStrings("version_control")
1976 vcsSystemsDisplay = [self.trUtf8("None")] 1982 vcsSystemsDisplay = [self.trUtf8("None")]
1977 keys = sorted(vcsSystemsDict.keys()) 1983 keys = sorted(vcsSystemsDict.keys())
1978 for key in keys: 1984 for key in keys:
3754 self.vcsBasicHelper = True 3760 self.vcsBasicHelper = True
3755 else: 3761 else:
3756 self.vcsProjectHelper = vcs.vcsGetProjectHelper(self) 3762 self.vcsProjectHelper = vcs.vcsGetProjectHelper(self)
3757 self.vcsBasicHelper = False 3763 self.vcsBasicHelper = False
3758 if self.vcsMenu is not None: 3764 if self.vcsMenu is not None:
3765 # TODO: disable menu if no VCS is available
3759 self.vcsProjectHelper.initMenu(self.vcsMenu) 3766 self.vcsProjectHelper.initMenu(self.vcsMenu)
3760 return vcs 3767 return vcs
3761 3768
3762 def __showContextMenuVCS(self): 3769 def __showContextMenuVCS(self):
3763 """ 3770 """

eric ide

mercurial