X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiCompare.cpp;h=09139597469be938ccc75fe36574e6d08d32897f;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=03e64c2915fca36bc88faa9c0a510d6824384680;hpb=570f96bc6e9af6c488234c7f261b320844f97dc0;p=lyx.git diff --git a/src/frontends/qt4/GuiCompare.cpp b/src/frontends/qt4/GuiCompare.cpp index 03e64c2915..0913959746 100644 --- a/src/frontends/qt4/GuiCompare.cpp +++ b/src/frontends/qt4/GuiCompare.cpp @@ -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(); } } @@ -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; }