progressBar->setValue(0);
progressBar->setEnabled(false);
+ closePB->setCursor(Qt::ArrowCursor);
+
bc().setPolicy(ButtonPolicy::OkApplyCancelPolicy);
bc().setOK(okPB);
}
newFileCB->clear();
oldFileCB->clear();
progressBar->setValue(0);
+ statusBar->clearMessage();
BufferList::iterator it = theBufferList().begin();
BufferList::iterator const end = theBufferList().end();
for (; it != end; ++it) {
}
-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);
void GuiCompare::error()
{
Alert::error(_("Error"), _("Error while comparing documents."));
- window_title_ = windowTitle();
finished(true);
}
void GuiCompare::finished(bool aborted)
{
enableControls(true);
- if (old_buffer_)
- old_buffer_->setReadonly(false);
- if (new_buffer_)
- new_buffer_->setReadonly(false);
-
+
if (compare_) {
delete compare_;
compare_ = 0;
dest_buffer_->markClean();
theBufferList().release(dest_buffer_);
}
- setWindowTitle(window_title_);
progressBar->setValue(0);
+ statusBar->showMessage(qt_("Aborted"), 5000);
} else {
hideView();
bc().ok();
dispatch(FuncRequest(LFUN_BUFFER_SWITCH,
dest_buffer_->absFileName()));
}
+ statusBar->showMessage(qt_("Finished"), 5000);
}
}
{
progressBar->setMaximum(max);
}
-
+
+
+void GuiCompare::setStatusMessage(QString msg)
+{
+ statusBar->showMessage(msg);
+}
+
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();
}
}
if (!new_buffer_ || !old_buffer_ || !dest_buffer_)
return 0;
- dest_buffer_->changed();
+ dest_buffer_->changed(true);
dest_buffer_->markDirty();
- // the comparison is done in a separate thread, so don't let
- // the user change the buffers
- old_buffer_->setReadonly(true);
- new_buffer_->setReadonly(true);
-
// get the options from the dialog
CompareOptions options;
options.settings_from_new = newSettingsRB->isChecked();
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;
}