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, QTextDocumentWriter |
12 QMessageBox |
12 |
|
13 from E5Gui import E5MessageBox |
13 |
14 |
14 from .ExporterBase import ExporterBase |
15 from .ExporterBase import ExporterBase |
15 from .ExporterHTML import HTMLGenerator |
16 from .ExporterHTML import HTMLGenerator |
16 |
17 |
17 import Preferences |
18 import Preferences |
63 doc.setHtml(html) |
64 doc.setHtml(html) |
64 writer = QTextDocumentWriter(filename) |
65 writer = QTextDocumentWriter(filename) |
65 ok = writer.write(doc) |
66 ok = writer.write(doc) |
66 QApplication.restoreOverrideCursor() |
67 QApplication.restoreOverrideCursor() |
67 if not ok: |
68 if not ok: |
68 QMessageBox.critical(self.editor, |
69 E5MessageBox.critical(self.editor, |
69 self.trUtf8("Export source"), |
70 self.trUtf8("Export source"), |
70 self.trUtf8(\ |
71 self.trUtf8(\ |
71 """<p>The source could not be exported to <b>{0}</b>.</p>""")\ |
72 """<p>The source could not be exported to <b>{0}</b>.</p>""")\ |
72 .format(filename)) |
73 .format(filename)) |