Project/TranslationPropertiesDialog.py

changeset 248
f4561c24989a
parent 55
b5c84934de9c
child 564
b3d966393ba9
child 792
a13346916170
equal deleted inserted replaced
247:b3da30a52337 248:f4561c24989a
137 @pyqtSlot() 137 @pyqtSlot()
138 def on_addExceptionButton_clicked(self): 138 def on_addExceptionButton_clicked(self):
139 """ 139 """
140 Private slot to add the shown exception to the listwidget. 140 Private slot to add the shown exception to the listwidget.
141 """ 141 """
142 texcept = self.exceptionEdit.text()
142 if self.project.ppath == '': 143 if self.project.ppath == '':
143 ppath = self.parent.getPPath() 144 texcept = texcept.replace(self.parent.getPPath() + os.sep, "")
144 else: 145 else:
145 ppath = self.project.ppath 146 texcept = self.project.getRelativePath(texcept)
146 texcept = self.exceptionEdit.text()
147 texcept = texcept.replace(ppath + os.sep, "")
148 if texcept.endswith(os.sep): 147 if texcept.endswith(os.sep):
149 texcept = texcept[:-1] 148 texcept = texcept[:-1]
150 if texcept: 149 if texcept:
151 QListWidgetItem(texcept, self.exceptionsList) 150 QListWidgetItem(texcept, self.exceptionsList)
152 self.exceptionEdit.clear() 151 self.exceptionEdit.clear()
202 """ 201 """
203 Public method to store the entered/modified data. 202 Public method to store the entered/modified data.
204 """ 203 """
205 tp = Utilities.toNativeSeparators(self.transPatternEdit.text()) 204 tp = Utilities.toNativeSeparators(self.transPatternEdit.text())
206 if tp: 205 if tp:
207 tp = tp.replace(self.project.ppath + os.sep, "") 206 tp = self.project.getRelativePath(tp)
208 self.project.pdata["TRANSLATIONPATTERN"] = [tp] 207 self.project.pdata["TRANSLATIONPATTERN"] = [tp]
209 self.project.translationsRoot = tp.split("%language%")[0] 208 self.project.translationsRoot = tp.split("%language%")[0]
210 else: 209 else:
211 self.project.pdata["TRANSLATIONPATTERN"] = [] 210 self.project.pdata["TRANSLATIONPATTERN"] = []
212 tp = Utilities.toNativeSeparators(self.transBinPathEdit.text()) 211 tp = Utilities.toNativeSeparators(self.transBinPathEdit.text())
213 if tp: 212 if tp:
214 tp = tp.replace(self.project.ppath + os.sep, "") 213 tp = self.project.getRelativePath(tp)
215 self.project.pdata["TRANSLATIONSBINPATH"] = [tp] 214 self.project.pdata["TRANSLATIONSBINPATH"] = [tp]
216 else: 215 else:
217 self.project.pdata["TRANSLATIONSBINPATH"] = [] 216 self.project.pdata["TRANSLATIONSBINPATH"] = []
218 exceptList = [] 217 exceptList = []
219 for i in range(self.exceptionsList.count()): 218 for i in range(self.exceptionsList.count()):

eric ide

mercurial