66 """ |
66 """ |
67 Public method to initialize the dialogs data. |
67 Public method to initialize the dialogs data. |
68 """ |
68 """ |
69 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) |
69 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) |
70 try: |
70 try: |
71 self.transPatternEdit.setText(os.path.join(\ |
71 self.transPatternEdit.setText(os.path.join( |
72 self.project.ppath, self.project.pdata["TRANSLATIONPATTERN"][0])) |
72 self.project.ppath, self.project.pdata["TRANSLATIONPATTERN"][0])) |
73 except IndexError: |
73 except IndexError: |
74 pass |
74 pass |
75 try: |
75 try: |
76 self.transBinPathEdit.setText(os.path.join(\ |
76 self.transBinPathEdit.setText(os.path.join( |
77 self.project.ppath, self.project.pdata["TRANSLATIONSBINPATH"][0])) |
77 self.project.ppath, self.project.pdata["TRANSLATIONSBINPATH"][0])) |
78 except IndexError: |
78 except IndexError: |
79 pass |
79 pass |
80 self.exceptionsList.clear() |
80 self.exceptionsList.clear() |
81 for texcept in self.project.pdata["TRANSLATIONEXCEPTIONS"]: |
81 for texcept in self.project.pdata["TRANSLATIONEXCEPTIONS"]: |
88 Private slot to display a file selection dialog. |
88 Private slot to display a file selection dialog. |
89 """ |
89 """ |
90 tp = self.transPatternEdit.text() |
90 tp = self.transPatternEdit.text() |
91 if "%language%" in tp: |
91 if "%language%" in tp: |
92 tp = tp.split("%language%")[0] |
92 tp = tp.split("%language%")[0] |
93 tsfile = QFileDialog.getOpenFileName(\ |
93 tsfile = QFileDialog.getOpenFileName( |
94 self, |
94 self, |
95 self.trUtf8("Select translation file"), |
95 self.trUtf8("Select translation file"), |
96 tp, |
96 tp, |
97 "") |
97 "") |
98 |
98 |
112 @pyqtSlot() |
112 @pyqtSlot() |
113 def on_transBinPathButton_clicked(self): |
113 def on_transBinPathButton_clicked(self): |
114 """ |
114 """ |
115 Private slot to display a directory selection dialog. |
115 Private slot to display a directory selection dialog. |
116 """ |
116 """ |
117 directory = QFileDialog.getExistingDirectory(\ |
117 directory = QFileDialog.getExistingDirectory( |
118 self, |
118 self, |
119 self.trUtf8("Select directory for binary translations"), |
119 self.trUtf8("Select directory for binary translations"), |
120 self.transBinPathEdit.text(), |
120 self.transBinPathEdit.text(), |
121 QFileDialog.Options(QFileDialog.Option(0))) |
121 QFileDialog.Options(QFileDialog.Option(0))) |
122 |
122 |
168 @pyqtSlot() |
168 @pyqtSlot() |
169 def on_exceptDirButton_clicked(self): |
169 def on_exceptDirButton_clicked(self): |
170 """ |
170 """ |
171 Private slot to select a file to exempt from translation. |
171 Private slot to select a file to exempt from translation. |
172 """ |
172 """ |
173 texcept = QFileDialog.getExistingDirectory(\ |
173 texcept = QFileDialog.getExistingDirectory( |
174 self, |
174 self, |
175 self.trUtf8("Exempt directory from translation"), |
175 self.trUtf8("Exempt directory from translation"), |
176 self.project.ppath, |
176 self.project.ppath, |
177 QFileDialog.Options(QFileDialog.ShowDirsOnly)) |
177 QFileDialog.Options(QFileDialog.ShowDirsOnly)) |
178 if texcept: |
178 if texcept: |