]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCompare.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiCompare.cpp
index db56ab24a8ccfd03d15bf6dca14bd2d75bd62328..09139597469be938ccc75fe36574e6d08d32897f 100644 (file)
@@ -66,6 +66,8 @@ GuiCompare::GuiCompare(GuiView & lv)
        progressBar->setValue(0);
        progressBar->setEnabled(false);
 
+       closePB->setCursor(Qt::ArrowCursor);
+
        bc().setPolicy(ButtonPolicy::OkApplyCancelPolicy);
        bc().setOK(okPB);
 }
@@ -106,6 +108,7 @@ void GuiCompare::updateContents()
        newFileCB->clear();
        oldFileCB->clear();
        progressBar->setValue(0);
+       statusBar->clearMessage();
        BufferList::iterator it = theBufferList().begin();
        BufferList::iterator const end = theBufferList().end();
        for (; it != end; ++it) {
@@ -169,8 +172,12 @@ QString GuiCompare::browse(QString const & in_name) const
 }
 
 
-void GuiCompare::enableControls(bool enable) const
+void GuiCompare::enableControls(bool enable)
 {
+       // Set the hourglass cursor for the dialog, but
+       // never for the cancel button.
+       setCursor(enable ? Qt::ArrowCursor : Qt::WaitCursor);
+
        newFileLA->setEnabled(enable);
        newFilePB->setEnabled(enable);
        newFileCB->setEnabled(enable);
@@ -191,7 +198,6 @@ void GuiCompare::enableControls(bool enable) const
 void GuiCompare::error()
 {
        Alert::error(_("Error"), _("Error while comparing documents."));
-       window_title_ = windowTitle();
        finished(true);
 }
 
@@ -209,8 +215,8 @@ void GuiCompare::finished(bool aborted)
                        dest_buffer_->markClean();
                        theBufferList().release(dest_buffer_);
                }
-               setWindowTitle(window_title_);
                progressBar->setValue(0);
+               statusBar->showMessage(qt_("Aborted"), 5000);
        } else {
                hideView();
                bc().ok();
@@ -218,6 +224,7 @@ void GuiCompare::finished(bool aborted)
                        dispatch(FuncRequest(LFUN_BUFFER_SWITCH,
                                dest_buffer_->absFileName()));
                }
+               statusBar->showMessage(qt_("Finished"), 5000);
        }
 }
 
@@ -232,7 +239,13 @@ void GuiCompare::progressMax(int max) const
 {
        progressBar->setMaximum(max);
 }
-       
+
+
+void GuiCompare::setStatusMessage(QString msg)
+{
+       statusBar->showMessage(msg);
+}
+
 
 void GuiCompare::slotOK()
 {
@@ -245,12 +258,12 @@ void GuiCompare::slotOK()
 void GuiCompare::slotCancel()
 {
        if (compare_ && compare_->isRunning()) {
-               window_title_ = windowTitle();
-               setWindowTitle(window_title_ + " " + qt_("(cancelling)"));
+               statusBar->showMessage(qt_("Aborting process..."));
                compare_->abort();
        } else {
                GuiDialog::slotClose();
                progressBar->setValue(0);
+               statusBar->clearMessage();
        }
 }
 
@@ -286,7 +299,7 @@ int GuiCompare::run()
        if (!new_buffer_ || !old_buffer_ || !dest_buffer_)
                return 0;
 
-       dest_buffer_->changed();
+       dest_buffer_->changed(true);
        dest_buffer_->markDirty();
 
        // get the options from the dialog
@@ -299,6 +312,8 @@ int GuiCompare::run()
        connect(compare_, SIGNAL(finished(bool)), this, SLOT(finished(bool)));
        connect(compare_, SIGNAL(progress(int)), this, SLOT(progress(int)));
        connect(compare_, SIGNAL(progressMax(int)), this, SLOT(progressMax(int)));
+       connect(compare_, SIGNAL(statusMessage(QString)),
+               this, SLOT(setStatusMessage(QString)));
        compare_->start(QThread::LowPriority);
        return 1;
 }