Preferences/ConfigurationPages/EditorHighlightingStylesPage.py

changeset 2408
dc3a7c9d8f6e
parent 2302
f29e9405c851
child 2525
8b507a9a2d40
child 2763
e4794166ad70
equal deleted inserted replaced
2407:b98cc8ee1142 2408:dc3a7c9d8f6e
13 13
14 from .ConfigurationPageBase import ConfigurationPageBase 14 from .ConfigurationPageBase import ConfigurationPageBase
15 from .Ui_EditorHighlightingStylesPage import Ui_EditorHighlightingStylesPage 15 from .Ui_EditorHighlightingStylesPage import Ui_EditorHighlightingStylesPage
16 16
17 from E5Gui import E5MessageBox, E5FileDialog 17 from E5Gui import E5MessageBox, E5FileDialog
18
19 from E5XML.HighlightingStylesWriter import HighlightingStylesWriter
20 from E5XML.HighlightingStylesReader import HighlightingStylesReader
21 18
22 import Preferences 19 import Preferences
23 20
24 21
25 class EditorHighlightingStylesPage(ConfigurationPageBase, 22 class EditorHighlightingStylesPage(ConfigurationPageBase,
381 if ex: 378 if ex:
382 fn += ex 379 fn += ex
383 380
384 f = QFile(fn) 381 f = QFile(fn)
385 if f.open(QIODevice.WriteOnly): 382 if f.open(QIODevice.WriteOnly):
383 from E5XML.HighlightingStylesWriter import HighlightingStylesWriter
386 HighlightingStylesWriter(f, lexers).writeXML() 384 HighlightingStylesWriter(f, lexers).writeXML()
387 f.close() 385 f.close()
388 else: 386 else:
389 E5MessageBox.critical(self, 387 E5MessageBox.critical(self,
390 self.trUtf8("Export Highlighting Styles"), 388 self.trUtf8("Export Highlighting Styles"),
408 if not fn: 406 if not fn:
409 return 407 return
410 408
411 f = QFile(fn) 409 f = QFile(fn)
412 if f.open(QIODevice.ReadOnly): 410 if f.open(QIODevice.ReadOnly):
411 from E5XML.HighlightingStylesReader import HighlightingStylesReader
413 reader = HighlightingStylesReader(f, lexers) 412 reader = HighlightingStylesReader(f, lexers)
414 reader.readXML() 413 reader.readXML()
415 f.close() 414 f.close()
416 else: 415 else:
417 E5MessageBox.critical(self, 416 E5MessageBox.critical(self,

eric ide

mercurial