From: Edwin Leuven Date: Sun, 23 Jan 2011 09:17:52 +0000 (+0000) Subject: add busy spinner to status bar when threads are running in the background X-Git-Tag: 2.0.0~1023 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=edf0e85f4b41c73048313772fc3ba44bda1578e1;p=lyx.git add busy spinner to status bar when threads are running in the background git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37304 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/images/busy.gif b/lib/images/busy.gif new file mode 100644 index 0000000000..5b33f7e54f Binary files /dev/null and b/lib/images/busy.gif differ diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 1344d4f004..027bcddbba 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -88,9 +88,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -441,6 +443,19 @@ GuiView::GuiView(int id) // For Drag&Drop. setAcceptDrops(true); + // add busy indicator to statusbar + QLabel * busylabel = new QLabel(statusBar()); + statusBar()->addPermanentWidget(busylabel); + QString fn = toqstr(lyx::libFileSearch("images", "busy.gif").absFileName()); + QMovie * busyanim = new QMovie(fn, QByteArray(), busylabel); + busylabel->setMovie(busyanim); + busyanim->start(); + busylabel->hide(); + connect(&d.processing_thread_watcher_, SIGNAL(started()), + busylabel, SLOT(show())); + connect(&d.processing_thread_watcher_, SIGNAL(finished()), + busylabel, SLOT(hide())); + statusBar()->setSizeGripEnabled(true); updateStatusBar();