Author: kuemmel
Date: Mon Jan 24 12:38:13 2011
New Revision: 37316
URL: http://www.lyx.org/trac/changeset/37316
Log:
remove obsolete code: we have now a animation to indicate that LyX is busy
Modified:
lyx-devel/trunk/src/frontends/qt4/GuiView.cpp
lyx-devel/trunk/src/frontends/qt4/GuiView.h
Modified: lyx-devel/trunk/src/frontends/qt4/GuiView.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiView.cpp Mon Jan 24 11:47:01
2011 (r37315)
+++ lyx-devel/trunk/src/frontends/qt4/GuiView.cpp Mon Jan 24 12:38:13
2011 (r37316)
@@ -390,9 +390,6 @@
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 @@
// 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 @@
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 @@
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 @@
#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 @@
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 @@
#else
-void GuiView::setCursorShapes(Qt::CursorShape)
-{
-}
-
-
-void GuiView::restoreCursorShapes()
-{
-}
-
-
-void GuiView::saveCursorShapes()
-{
-}
-
-
-void GuiView::indicateProcessing()
-{
-}
-
void GuiView::processingThreadStarted()
{
@@ -3043,7 +2978,6 @@
format = used_buffer->getDefaultOutputFormat();
#if EXPORT_in_THREAD && (QT_VERSION >= 0x040400)
- gv_->processingThreadStarted();
if (!msg.empty()) {
progress_->clearMessages();
gv_->message(msg);
Modified: lyx-devel/trunk/src/frontends/qt4/GuiView.h
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiView.h Mon Jan 24 11:47:01 2011
(r37315)
+++ lyx-devel/trunk/src/frontends/qt4/GuiView.h Mon Jan 24 12:38:13 2011
(r37316)
@@ -82,9 +82,6 @@
/// are we busy ?
bool busy() const;
- void saveCursorShapes();
- void restoreCursorShapes();
- void setCursorShapes(Qt::CursorShape shape);
/// \name Generic accessor functions
//@{
@@ -235,7 +232,6 @@
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,