6 """ |
6 """ |
7 Module implementing an exporter for ODT. |
7 Module implementing an exporter for ODT. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import Qt |
10 from PyQt4.QtCore import Qt |
11 from PyQt4.QtGui import QApplication, QCursor, QTextDocument, QTextDocumentWriter |
11 from PyQt4.QtGui import QApplication, QCursor, QTextDocument, \ |
|
12 QTextDocumentWriter |
12 |
13 |
13 from E5Gui import E5MessageBox |
14 from E5Gui import E5MessageBox |
14 |
15 |
15 from .ExporterBase import ExporterBase |
16 from .ExporterBase import ExporterBase |
16 from .ExporterHTML import HTMLGenerator |
17 from .ExporterHTML import HTMLGenerator |
65 doc.setHtml(html) |
66 doc.setHtml(html) |
66 writer = QTextDocumentWriter(filename) |
67 writer = QTextDocumentWriter(filename) |
67 ok = writer.write(doc) |
68 ok = writer.write(doc) |
68 QApplication.restoreOverrideCursor() |
69 QApplication.restoreOverrideCursor() |
69 if not ok: |
70 if not ok: |
70 E5MessageBox.critical(self.editor, |
71 E5MessageBox.critical( |
|
72 self.editor, |
71 self.trUtf8("Export source"), |
73 self.trUtf8("Export source"), |
72 self.trUtf8( |
74 self.trUtf8( |
73 """<p>The source could not be exported to <b>{0}</b>.</p>""")\ |
75 """<p>The source could not be exported to""" |
74 .format(filename)) |
76 """ <b>{0}</b>.</p>""").format(filename)) |