2006-03-05 17:24:44 +00:00
|
|
|
/**
|
|
|
|
* \file QChanges.C
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "QChanges.h"
|
|
|
|
#include "QChangesDialog.h"
|
|
|
|
#include "Qt2BC.h"
|
|
|
|
#include "qt_helpers.h"
|
|
|
|
|
|
|
|
#include "support/lstrings.h"
|
|
|
|
|
|
|
|
#include "controllers/ControlChanges.h"
|
|
|
|
|
2006-05-04 07:31:46 +00:00
|
|
|
#include <QPushButton>
|
|
|
|
#include <QTextBrowser>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
using lyx::support::bformat;
|
|
|
|
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
typedef QController<ControlChanges, QView<QChangesDialog> > base_class;
|
|
|
|
|
|
|
|
|
|
|
|
QChanges::QChanges(Dialog & parent)
|
2006-09-09 15:27:44 +00:00
|
|
|
: base_class(parent, lyx::to_utf8(_("Merge Changes")))
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QChanges::build_dialog()
|
|
|
|
{
|
|
|
|
dialog_.reset(new QChangesDialog(this));
|
|
|
|
|
|
|
|
bcview().setCancel(dialog_->closePB);
|
|
|
|
bcview().addReadOnly(dialog_->acceptPB);
|
|
|
|
bcview().addReadOnly(dialog_->rejectPB);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QChanges::update_contents()
|
|
|
|
{
|
|
|
|
next();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QChanges::next()
|
|
|
|
{
|
|
|
|
controller().find();
|
|
|
|
|
|
|
|
string text;
|
|
|
|
string author(controller().getChangeAuthor());
|
|
|
|
string date(controller().getChangeDate());
|
|
|
|
|
|
|
|
if (!author.empty())
|
2006-09-09 15:27:44 +00:00
|
|
|
text += bformat(lyx::to_utf8(_("Change by %1$s\n\n")), author);
|
2006-03-05 17:24:44 +00:00
|
|
|
if (!date.empty())
|
2006-09-09 15:27:44 +00:00
|
|
|
text += bformat(lyx::to_utf8(_("Change made at %1$s\n")), date);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-05-04 07:31:46 +00:00
|
|
|
dialog_->changeTB->setPlainText(toqstr(text));
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QChanges::accept()
|
|
|
|
{
|
|
|
|
controller().accept();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QChanges::reject()
|
|
|
|
{
|
|
|
|
controller().reject();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|