3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
15 #include "QChangesDialog.h"
17 #include "qt_helpers.h"
19 #include "support/lstrings.h"
21 #include "controllers/ControlChanges.h"
23 #include <QPushButton>
24 #include <QTextBrowser>
26 using lyx::support::bformat;
31 typedef QController<ControlChanges, QView<QChangesDialog> > changes_base_class;
34 QChanges::QChanges(Dialog & parent)
35 : changes_base_class(parent, _("Merge Changes"))
40 void QChanges::build_dialog()
42 dialog_.reset(new QChangesDialog(this));
44 bcview().setCancel(dialog_->closePB);
45 bcview().addReadOnly(dialog_->acceptPB);
46 bcview().addReadOnly(dialog_->rejectPB);
50 void QChanges::update_contents()
53 docstring author = controller().getChangeAuthor();
54 docstring date = controller().getChangeDate();
57 text += bformat(_("Change by %1$s\n\n"), author);
59 text += bformat(_("Change made at %1$s\n"), date);
61 dialog_->changeTB->setPlainText(toqstr(text));
71 void QChanges::accept()
73 controller().accept();
77 void QChanges::reject()
79 controller().reject();
82 } // namespace frontend