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
This commit is contained in:
Edwin Leuven 2011-01-23 09:17:52 +00:00
parent a2435792ce
commit edf0e85f4b
2 changed files with 15 additions and 0 deletions

BIN
lib/images/busy.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -88,9 +88,11 @@
#include <QDesktopWidget>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QLabel>
#include <QList>
#include <QMenu>
#include <QMenuBar>
#include <QMovie>
#include <QPainter>
#include <QPixmap>
#include <QPixmapCache>
@ -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();