From: Peter Kümmel Date: Mon, 24 Jan 2011 11:38:13 +0000 (+0000) Subject: remove obsolete code: we have now a animation to indicate that LyX is busy X-Git-Tag: 2.0.0~1013 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4a1a425213aab1d5e2d34be68fe9bca3119c8f45;p=lyx.git remove obsolete code: we have now a animation to indicate that LyX is busy git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37316 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 027bcddbba..d34949bb87 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -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 orig_cursors_; QVector 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 GuiView::GuiViewPrivate::guiWorkAreas() #if QT_VERSION >= 0x040400 -void GuiView::setCursorShapes(Qt::CursorShape shape) -{ - QVector areas = d.guiWorkAreas(); - Q_FOREACH(GuiWorkArea* wa, areas) { - wa->setCursorShape(shape); - } -} - - -void GuiView::restoreCursorShapes() -{ - QVector 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 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); diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index be1e782442..667ce60788 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -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,