]> git.lyx.org Git - lyx.git/commitdiff
remove obsolete code: we have now a animation to indicate that LyX is busy
authorPeter Kümmel <syntheticpp@gmx.net>
Mon, 24 Jan 2011 11:38:13 +0000 (11:38 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Mon, 24 Jan 2011 11:38:13 +0000 (11:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37316 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h

index 027bcddbbaab6522ede3c31485ec57e0e5ed317c..d34949bb87530faf7f9f24654387461a10199e29 100644 (file)
@@ -390,9 +390,6 @@ public:
                                   bool (Buffer::*syncFunc)(string const &, bool, bool) const,
                                   bool (Buffer::*previewFunc)(string const &, bool) const);
 
-       QTimer processing_cursor_timer_;
-       bool indicates_processing_;
-       QMap<GuiWorkArea*, Qt::CursorShape> orig_cursors_;
        QVector<GuiWorkArea*> guiWorkAreas();
 };
 
@@ -443,6 +440,8 @@ GuiView::GuiView(int id)
        // For Drag&Drop.
        setAcceptDrops(true);
 
+#if (QT_VERSION >= 0x040400)
+
        // add busy indicator to statusbar
        QLabel * busylabel = new QLabel(statusBar());
        statusBar()->addPermanentWidget(busylabel);
@@ -451,6 +450,7 @@ GuiView::GuiView(int id)
        busylabel->setMovie(busyanim);
        busyanim->start();
        busylabel->hide();
+
        connect(&d.processing_thread_watcher_, SIGNAL(started()), 
                busylabel, SLOT(show()));
        connect(&d.processing_thread_watcher_, SIGNAL(finished()), 
@@ -459,15 +459,14 @@ GuiView::GuiView(int id)
        statusBar()->setSizeGripEnabled(true);
        updateStatusBar();
 
-#if (QT_VERSION >= 0x040400)
        connect(&d.autosave_watcher_, SIGNAL(finished()), this,
                SLOT(autoSaveThreadFinished()));
+
+       connect(&d.autosave_watcher_, SIGNAL(started()), this,
+               SLOT(processingThreadFinished()));
        connect(&d.processing_thread_watcher_, SIGNAL(finished()), this,
                SLOT(processingThreadFinished()));
 
-       d.processing_cursor_timer_.setInterval(1000 * 3);
-       connect(&d.processing_cursor_timer_, SIGNAL(timeout()), this,
-               SLOT(indicateProcessing()));
 #endif
 
        connect(this, SIGNAL(triggerShowDialog(QString const &, QString const &, Inset *)),
@@ -513,53 +512,9 @@ QVector<GuiWorkArea*> GuiView::GuiViewPrivate::guiWorkAreas()
 
 
 #if QT_VERSION >= 0x040400
-void GuiView::setCursorShapes(Qt::CursorShape shape)
-{
-       QVector<GuiWorkArea*> areas = d.guiWorkAreas();
-       Q_FOREACH(GuiWorkArea* wa, areas) {
-               wa->setCursorShape(shape);
-       }
-}
-
-
-void GuiView::restoreCursorShapes()
-{
-       QVector<GuiWorkArea*> areas = d.guiWorkAreas();
-       Q_FOREACH(GuiWorkArea* wa, areas) {
-               if (d.orig_cursors_.contains(wa)) {
-                       wa->setCursorShape(d.orig_cursors_[wa]);
-               }
-       }
-}
-
-
-void GuiView::saveCursorShapes()
-{
-       d.orig_cursors_.clear();
-       QVector<GuiWorkArea*> areas = d.guiWorkAreas();
-       Q_FOREACH(GuiWorkArea* wa, areas) {
-               d.orig_cursors_[wa] = wa->cursorShape();
-       }
-}
-
-
-void GuiView::indicateProcessing()
-{
-       if (d.indicates_processing_) {
-               restoreCursorShapes();
-       } else {
-               setCursorShapes(Qt::BusyCursor);
-       }
-       d.indicates_processing_ = !d.indicates_processing_;
-}
-
 
 void GuiView::processingThreadStarted()
 {
-       saveCursorShapes();
-       d.indicates_processing_ = false;
-       indicateProcessing();
-       d.processing_cursor_timer_.start();
 }
 
 
@@ -572,16 +527,15 @@ void GuiView::processingThreadFinished(bool show_errors)
        if (show_errors) {
                errors(d.last_export_format);
        }
-       d.processing_cursor_timer_.stop();
-       restoreCursorShapes();
-       d.indicates_processing_ = false;
 }
 
+
 void GuiView::processingThreadFinished()
 {
        processingThreadFinished(true);
 }
 
+
 void GuiView::autoSaveThreadFinished()
 {
        processingThreadFinished(false);
@@ -589,25 +543,6 @@ void GuiView::autoSaveThreadFinished()
 
 #else
 
-void GuiView::setCursorShapes(Qt::CursorShape)
-{
-}
-
-
-void GuiView::restoreCursorShapes()
-{
-}
-
-
-void GuiView::saveCursorShapes()
-{
-}
-
-
-void GuiView::indicateProcessing()
-{
-}
-
 
 void GuiView::processingThreadStarted()
 {
@@ -3043,7 +2978,6 @@ bool GuiView::GuiViewPrivate::asyncBufferProcessing(
                format = used_buffer->getDefaultOutputFormat();
 
 #if EXPORT_in_THREAD && (QT_VERSION >= 0x040400)
-       gv_->processingThreadStarted();
        if (!msg.empty()) {
                progress_->clearMessages();
                gv_->message(msg);
index be1e782442ca303089ddd3dbfc3a4c75d75fb7b3..667ce607881ecb7f6b7fb3c084e237c30c3ebfa3 100644 (file)
@@ -82,9 +82,6 @@ public:
        /// are we busy ?
        bool busy() const;
 
-       void saveCursorShapes();
-       void restoreCursorShapes();
-       void setCursorShapes(Qt::CursorShape shape);
 
        /// \name Generic accessor functions
        //@{
@@ -235,7 +232,6 @@ private Q_SLOTS:
        void processingThreadFinished(bool show_errors);
        void processingThreadFinished();
        void autoSaveThreadFinished();
-       void indicateProcessing();
 
        /// must be called in GUI thread
        void doShowDialog(QString const & qname, QString const & qdata,