72 def initDialog(self): |
72 def initDialog(self): |
73 """ |
73 """ |
74 Public method to initialize the dialogs data. |
74 Public method to initialize the dialogs data. |
75 """ |
75 """ |
76 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) |
76 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) |
77 try: |
77 self.transPatternPicker.setText( |
78 self.transPatternPicker.setText( |
78 self.project.pdata["TRANSLATIONPATTERN"]) |
79 self.project.pdata["TRANSLATIONPATTERN"][0]) |
79 self.transBinPathPicker.setText( |
80 except IndexError: |
80 self.project.pdata["TRANSLATIONSBINPATH"]) |
81 pass |
|
82 try: |
|
83 self.transBinPathPicker.setText( |
|
84 self.project.pdata["TRANSLATIONSBINPATH"][0]) |
|
85 except IndexError: |
|
86 pass |
|
87 self.exceptionsList.clear() |
81 self.exceptionsList.clear() |
88 for texcept in self.project.pdata["TRANSLATIONEXCEPTIONS"]: |
82 for texcept in self.project.pdata["TRANSLATIONEXCEPTIONS"]: |
89 if texcept: |
83 if texcept: |
90 self.exceptionsList.addItem(texcept) |
84 self.exceptionsList.addItem(texcept) |
91 |
85 |
199 Public method to store the entered/modified data. |
193 Public method to store the entered/modified data. |
200 """ |
194 """ |
201 tp = self.transPatternPicker.text() |
195 tp = self.transPatternPicker.text() |
202 if tp: |
196 if tp: |
203 tp = self.project.getRelativePath(tp) |
197 tp = self.project.getRelativePath(tp) |
204 self.project.pdata["TRANSLATIONPATTERN"] = [tp] |
198 self.project.pdata["TRANSLATIONPATTERN"] = tp |
205 self.project.translationsRoot = tp.split("%language%")[0] |
199 self.project.translationsRoot = tp.split("%language%")[0] |
206 else: |
200 else: |
207 self.project.pdata["TRANSLATIONPATTERN"] = [] |
201 self.project.pdata["TRANSLATIONPATTERN"] = "" |
208 tp = self.transBinPathPicker.text() |
202 tp = self.transBinPathPicker.text() |
209 if tp: |
203 if tp: |
210 tp = self.project.getRelativePath(tp) |
204 tp = self.project.getRelativePath(tp) |
211 self.project.pdata["TRANSLATIONSBINPATH"] = [tp] |
205 self.project.pdata["TRANSLATIONSBINPATH"] = tp |
212 else: |
206 else: |
213 self.project.pdata["TRANSLATIONSBINPATH"] = [] |
207 self.project.pdata["TRANSLATIONSBINPATH"] = "" |
214 exceptList = [] |
208 exceptList = [] |
215 for i in range(self.exceptionsList.count()): |
209 for i in range(self.exceptionsList.count()): |
216 exceptList.append(self.exceptionsList.item(i).text()) |
210 exceptList.append(self.exceptionsList.item(i).text()) |
217 self.project.pdata["TRANSLATIONEXCEPTIONS"] = exceptList[:] |
211 self.project.pdata["TRANSLATIONEXCEPTIONS"] = exceptList[:] |