Project/PropertiesDialog.py

changeset 564
b3d966393ba9
parent 428
58405c24aa09
child 608
d8fea1e76975
equal deleted inserted replaced
563:e35d2cda9a74 564:b3d966393ba9
60 self.projectTypeComboBox.addItem(projectTypes[projectTypeKey], projectTypeKey) 60 self.projectTypeComboBox.addItem(projectTypes[projectTypeKey], projectTypeKey)
61 61
62 if not new: 62 if not new:
63 name = os.path.splitext(self.project.pfile)[0] 63 name = os.path.splitext(self.project.pfile)[0]
64 self.nameEdit.setText(os.path.basename(name)) 64 self.nameEdit.setText(os.path.basename(name))
65 self.languageComboBox.setCurrentIndex(\ 65 self.languageComboBox.setCurrentIndex(
66 self.languageComboBox.findText(self.project.pdata["PROGLANGUAGE"][0])) 66 self.languageComboBox.findText(self.project.pdata["PROGLANGUAGE"][0]))
67 self.mixedLanguageCheckBox.setChecked(self.project.pdata["MIXEDLANGUAGE"][0]) 67 self.mixedLanguageCheckBox.setChecked(self.project.pdata["MIXEDLANGUAGE"][0])
68 try: 68 try:
69 curIndex = \ 69 curIndex = \
70 self.projectTypeComboBox.findText(\ 70 self.projectTypeComboBox.findText(
71 projectTypes[self.project.pdata["PROJECTTYPE"][0]]) 71 projectTypes[self.project.pdata["PROJECTTYPE"][0]])
72 except KeyError: 72 except KeyError:
73 curIndex = -1 73 curIndex = -1
74 if curIndex == -1: 74 if curIndex == -1:
75 curIndex = self.projectTypeComboBox.findText(projectTypes["Qt4"]) 75 curIndex = self.projectTypeComboBox.findText(projectTypes["Qt4"])
105 .getPluginDisplayStrings("version_control") 105 .getPluginDisplayStrings("version_control")
106 try: 106 try:
107 vcsSystemDisplay = vcsSystemsDict[self.project.pdata["VCS"][0]] 107 vcsSystemDisplay = vcsSystemsDict[self.project.pdata["VCS"][0]]
108 except KeyError: 108 except KeyError:
109 vcsSystemDisplay = "None" 109 vcsSystemDisplay = "None"
110 self.vcsLabel.setText(\ 110 self.vcsLabel.setText(
111 self.trUtf8("The project is version controlled by <b>{0}</b>.") 111 self.trUtf8("The project is version controlled by <b>{0}</b>.")
112 .format(vcsSystemDisplay)) 112 .format(vcsSystemDisplay))
113 self.vcsInfoButton.show() 113 self.vcsInfoButton.show()
114 else: 114 else:
115 self.vcsLabel.setText(\ 115 self.vcsLabel.setText(
116 self.trUtf8("The project is not version controlled.")) 116 self.trUtf8("The project is not version controlled."))
117 self.vcsInfoButton.hide() 117 self.vcsInfoButton.hide()
118 else: 118 else:
119 self.languageComboBox.setCurrentIndex(\ 119 self.languageComboBox.setCurrentIndex(
120 self.languageComboBox.findText("Python3")) 120 self.languageComboBox.findText("Python3"))
121 self.projectTypeComboBox.setCurrentIndex(\ 121 self.projectTypeComboBox.setCurrentIndex(
122 self.projectTypeComboBox.findText(projectTypes["Qt4"])) 122 self.projectTypeComboBox.findText(projectTypes["Qt4"]))
123 hp = os.getcwd() 123 hp = os.getcwd()
124 hp = hp + os.sep 124 hp = hp + os.sep
125 self.dirEdit.setText(hp) 125 self.dirEdit.setText(hp)
126 self.versionEdit.setText('0.1') 126 self.versionEdit.setText('0.1')
130 @pyqtSlot() 130 @pyqtSlot()
131 def on_dirButton_clicked(self): 131 def on_dirButton_clicked(self):
132 """ 132 """
133 Private slot to display a directory selection dialog. 133 Private slot to display a directory selection dialog.
134 """ 134 """
135 directory = QFileDialog.getExistingDirectory(\ 135 directory = QFileDialog.getExistingDirectory(
136 self, 136 self,
137 self.trUtf8("Select project directory"), 137 self.trUtf8("Select project directory"),
138 self.dirEdit.text(), 138 self.dirEdit.text(),
139 QFileDialog.Options(QFileDialog.ShowDirsOnly)) 139 QFileDialog.Options(QFileDialog.ShowDirsOnly))
140 140
179 for pattern, filetype in list(self.project.pdata["FILETYPES"].items()): 179 for pattern, filetype in list(self.project.pdata["FILETYPES"].items()):
180 if filetype == "SOURCES": 180 if filetype == "SOURCES":
181 patterns.append(pattern) 181 patterns.append(pattern)
182 filters = self.trUtf8("Source Files ({0});;All Files (*)")\ 182 filters = self.trUtf8("Source Files ({0});;All Files (*)")\
183 .format(" ".join(patterns)) 183 .format(" ".join(patterns))
184 fn = QFileDialog.getOpenFileName(\ 184 fn = QFileDialog.getOpenFileName(
185 self, 185 self,
186 self.trUtf8("Select main script file"), 186 self.trUtf8("Select main script file"),
187 dir, 187 dir,
188 filters) 188 filters)
189 189

eric ide

mercurial