190 procStarted = self.process.waitForStarted(5000) |
190 procStarted = self.process.waitForStarted(5000) |
191 if not procStarted: |
191 if not procStarted: |
192 QApplication.restoreOverrideCursor() |
192 QApplication.restoreOverrideCursor() |
193 self.inputGroup.setEnabled(False) |
193 self.inputGroup.setEnabled(False) |
194 self.inputGroup.hide() |
194 self.inputGroup.hide() |
195 E5MessageBox.critical(self, |
195 E5MessageBox.critical( |
|
196 self, |
196 self.trUtf8('Process Generation Error'), |
197 self.trUtf8('Process Generation Error'), |
197 self.trUtf8( |
198 self.trUtf8( |
198 'The process {0} could not be started. ' |
199 'The process {0} could not be started. ' |
199 'Ensure, that it is in the search path.' |
200 'Ensure, that it is in the search path.' |
200 ).format('hg')) |
201 ).format('hg')) |
417 if not ext: |
418 if not ext: |
418 ex = selectedFilter.split("(*")[1].split(")")[0] |
419 ex = selectedFilter.split("(*")[1].split(")")[0] |
419 if ex: |
420 if ex: |
420 fname += ex |
421 fname += ex |
421 if QFileInfo(fname).exists(): |
422 if QFileInfo(fname).exists(): |
422 res = E5MessageBox.yesNo(self, |
423 res = E5MessageBox.yesNo( |
|
424 self, |
423 self.trUtf8("Save Diff"), |
425 self.trUtf8("Save Diff"), |
424 self.trUtf8("<p>The patch file <b>{0}</b> already exists." |
426 self.trUtf8("<p>The patch file <b>{0}</b> already exists." |
425 " Overwrite it?</p>").format(fname), |
427 " Overwrite it?</p>").format(fname), |
426 icon=E5MessageBox.Warning) |
428 icon=E5MessageBox.Warning) |
427 if not res: |
429 if not res: |
432 try: |
434 try: |
433 f = open(fname, "w", encoding="utf-8", newline="") |
435 f = open(fname, "w", encoding="utf-8", newline="") |
434 f.write(eol.join(self.contents.toPlainText().splitlines())) |
436 f.write(eol.join(self.contents.toPlainText().splitlines())) |
435 f.close() |
437 f.close() |
436 except IOError as why: |
438 except IOError as why: |
437 E5MessageBox.critical(self, self.trUtf8('Save Diff'), |
439 E5MessageBox.critical( |
|
440 self, self.trUtf8('Save Diff'), |
438 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.' |
441 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.' |
439 '<br>Reason: {1}</p>') |
442 '<br>Reason: {1}</p>') |
440 .format(fname, str(why))) |
443 .format(fname, str(why))) |
441 |
444 |
442 def on_passwordCheckBox_toggled(self, isOn): |
445 def on_passwordCheckBox_toggled(self, isOn): |