]> git.lyx.org Git - lyx.git/commitdiff
add busy spinner to status bar when threads are running in the background
authorEdwin Leuven <e.leuven@gmail.com>
Sun, 23 Jan 2011 09:17:52 +0000 (09:17 +0000)
committerEdwin Leuven <e.leuven@gmail.com>
Sun, 23 Jan 2011 09:17:52 +0000 (09:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37304 a592a061-630c-0410-9148-cb99ea01b6c8

lib/images/busy.gif [new file with mode: 0644]
src/frontends/qt4/GuiView.cpp

diff --git a/lib/images/busy.gif b/lib/images/busy.gif
new file mode 100644 (file)
index 0000000..5b33f7e
Binary files /dev/null and b/lib/images/busy.gif differ
index 1344d4f0045a17bd28c38f38acf810b1b763b379..027bcddbbaab6522ede3c31485ec57e0e5ed317c 100644 (file)
 #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();