- QFutureWatcher<docstring> const * watcher =
- static_cast<QFutureWatcher<docstring> const *>(sender());
- message(watcher->result());
+ QFutureWatcher<Buffer::ExportStatus> const * watcher =
+ static_cast<QFutureWatcher<Buffer::ExportStatus> const *>(sender());
+
+ Buffer::ExportStatus const status = watcher->result();
+ docstring msg;
+ switch (status) {
+ case Buffer::ExportSuccess:
+ msg = _("Successful export to format: %1$s");
+ break;
+ case Buffer::ExportError:
+ case Buffer::ExportNoPathToFormat:
+ case Buffer::ExportTexPathHasSpaces:
+ case Buffer::ExportConverterError:
+ msg = _("Error while exporting format: %1$s");
+ break;
+ case Buffer::PreviewSuccess:
+ msg = _("Successful preview of format: %1$s");
+ break;
+ case Buffer::PreviewError:
+ msg = _("Error while previewing format: %1$s");
+ break;
+ }
+ message(bformat(msg, from_utf8(d.processing_format)));
+