ProjectDjango/DjangoDialog.py

changeset 51
0b60dbff8e9a
parent 47
19da3417eb3d
child 52
cd31c2953b16
equal deleted inserted replaced
48:cf944abf6137 51:0b60dbff8e9a
11 try: 11 try:
12 str = unicode # __IGNORE_WARNING__ 12 str = unicode # __IGNORE_WARNING__
13 except NameError: 13 except NameError:
14 pass 14 pass
15 15
16 from PyQt4.QtCore import pyqtSlot, QProcess, QTimer, QFileInfo 16 from PyQt5.QtCore import pyqtSlot, QProcess, QTimer, QFileInfo
17 from PyQt4.QtGui import QDialog, QDialogButtonBox, QAbstractButton, QTextEdit 17 from PyQt5.QtWidgets import (QDialog, QDialogButtonBox, QAbstractButton,
18 QTextEdit)
18 19
19 from E5Gui import E5MessageBox, E5FileDialog 20 from E5Gui import E5MessageBox, E5FileDialog
20 21
21 from .Ui_DjangoDialog import Ui_DjangoDialog 22 from .Ui_DjangoDialog import Ui_DjangoDialog
22 23
176 procStarted = self.proc.waitForStarted() 177 procStarted = self.proc.waitForStarted()
177 if not procStarted: 178 if not procStarted:
178 self.buttonBox.setFocus() 179 self.buttonBox.setFocus()
179 E5MessageBox.critical( 180 E5MessageBox.critical(
180 self, 181 self,
181 self.trUtf8('Process Generation Error'), 182 self.tr('Process Generation Error'),
182 self.trUtf8( 183 self.tr(
183 'The process {0} could not be started. ' 184 'The process {0} could not be started. '
184 'Ensure, that it is in the search path.' 185 'Ensure, that it is in the search path.'
185 ).format(prog)) 186 ).format(prog))
186 return procStarted 187 return procStarted
187 188
260 """ 261 """
261 Private slot to save the output to a file. 262 Private slot to save the output to a file.
262 """ 263 """
263 fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( 264 fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
264 self, 265 self,
265 self.trUtf8("Select data file"), 266 self.tr("Select data file"),
266 self.workingDir, 267 self.workingDir,
267 self.fileFilters, 268 self.fileFilters,
268 None) 269 None)
269 270
270 if fname: 271 if fname:
281 f.write(txt) 282 f.write(txt)
282 f.close() 283 f.close()
283 except IOError as err: 284 except IOError as err:
284 E5MessageBox.critical( 285 E5MessageBox.critical(
285 self, 286 self,
286 self.trUtf8("Error saving data"), 287 self.tr("Error saving data"),
287 self.trUtf8("""<p>The data could not be written""" 288 self.tr("""<p>The data could not be written"""
288 """ to <b>{0}</b></p><p>Reason: {1}</p>""") 289 """ to <b>{0}</b></p><p>Reason: {1}</p>""")
289 .format(fname, str(err))) 290 .format(fname, str(err)))

eric ide

mercurial