396 if f.open(QIODevice.WriteOnly): |
396 if f.open(QIODevice.WriteOnly): |
397 from E5XML.HighlightingStylesWriter import HighlightingStylesWriter |
397 from E5XML.HighlightingStylesWriter import HighlightingStylesWriter |
398 HighlightingStylesWriter(f, lexers).writeXML() |
398 HighlightingStylesWriter(f, lexers).writeXML() |
399 f.close() |
399 f.close() |
400 else: |
400 else: |
401 E5MessageBox.critical(self, |
401 E5MessageBox.critical( |
|
402 self, |
402 self.trUtf8("Export Highlighting Styles"), |
403 self.trUtf8("Export Highlighting Styles"), |
403 self.trUtf8( |
404 self.trUtf8( |
404 """<p>The highlighting styles could not be exported""" |
405 """<p>The highlighting styles could not be exported""" |
405 """ to file <b>{0}</b>.</p><p>Reason: {1}</p>""")\ |
406 """ to file <b>{0}</b>.</p><p>Reason: {1}</p>""")\ |
406 .format(fn, f.errorString()) |
407 .format(fn, f.errorString()) |
427 from E5XML.HighlightingStylesReader import HighlightingStylesReader |
428 from E5XML.HighlightingStylesReader import HighlightingStylesReader |
428 reader = HighlightingStylesReader(f, lexers) |
429 reader = HighlightingStylesReader(f, lexers) |
429 reader.readXML() |
430 reader.readXML() |
430 f.close() |
431 f.close() |
431 else: |
432 else: |
432 E5MessageBox.critical(self, |
433 E5MessageBox.critical( |
|
434 self, |
433 self.trUtf8("Import Highlighting Styles"), |
435 self.trUtf8("Import Highlighting Styles"), |
434 self.trUtf8( |
436 self.trUtf8( |
435 """<p>The highlighting styles could not be read""" |
437 """<p>The highlighting styles could not be read""" |
436 """ from file <b>{0}</b>.</p><p>Reason: {1}</p>""")\ |
438 """ from file <b>{0}</b>.</p><p>Reason: {1}</p>""")\ |
437 .format(fn, f.errorString()) |
439 .format(fn, f.errorString()) |