Am Montag, den 21.12.2009, 14:54 +0100 schrieb Abdelrazak Younes: > Peter Kümmel wrote: > > Abdelrazak Younes wrote: > > > >> 2) Use the same signal/slot mechanism for Buffer::message(). > >> > > > > Done, > > http://www.lyx.org/trac/changeset/32606/lyx-devel/trunk > > > > Excellent. Now we can also move LFUN_BUFFER_EXPORT to thread. We just > need a new argument to exportAndDestroy() AFAIR. I mean... if you want > to do some more work on this ;-) > > Abdel.
Why do we need a new argument? Wouldn't attached patch be ok? Peter
Index: src/frontends/qt4/GuiView.cpp =================================================================== --- src/frontends/qt4/GuiView.cpp (Revision 32608) +++ src/frontends/qt4/GuiView.cpp (Arbeitskopie) @@ -2691,10 +2691,20 @@ lyx::dispatch(FuncRequest(LFUN_DIALOG_SHOW, "sendto")); break; } +#if EXPORT_in_THREAD && (QT_VERSION >= 0x040400) + ProgressInterface::instance()->clearMessages(); + QString time = QTime::currentTime().toString(Qt::SystemLocaleShortDate); + ProgressInterface::instance()->appendMessage(time + ": Exporting ...\n"); + QFuture<docstring> f = QtConcurrent::run(exportAndDestroy, + doc_buffer->clone(), argument); + d.setPreviewFuture(f); +#else + if (doc_buffer->doExport(argument, false)) { message(bformat(_("Error exporting to format: %1$s."), cmd.argument())); } +#endif break; }