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.
14 #include "GuiChanges.h"
16 #include "qt_helpers.h"
18 #include "support/lstrings.h"
20 #include <QCloseEvent>
21 #include <QTextBrowser>
23 using lyx::support::bformat;
29 /////////////////////////////////////////////////////////////////////
33 /////////////////////////////////////////////////////////////////////
35 GuiChangesDialog::GuiChangesDialog(GuiChanges * form)
39 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
40 connect(nextPB, SIGNAL(clicked()), this, SLOT(nextPressed()));
41 connect(rejectPB, SIGNAL(clicked()), this, SLOT(rejectPressed()));
42 connect(acceptPB, SIGNAL(clicked()), this, SLOT(acceptPressed()));
46 void GuiChangesDialog::nextPressed()
52 void GuiChangesDialog::acceptPressed()
58 void GuiChangesDialog::rejectPressed()
64 void GuiChangesDialog::closeEvent(QCloseEvent *e)
72 /////////////////////////////////////////////////////////////////////
76 /////////////////////////////////////////////////////////////////////
79 GuiChanges::GuiChanges(Dialog & parent)
80 : GuiView<GuiChangesDialog>(parent, _("Merge Changes"))
85 void GuiChanges::build_dialog()
87 dialog_.reset(new GuiChangesDialog(this));
89 bcview().setCancel(dialog_->closePB);
90 bcview().addReadOnly(dialog_->acceptPB);
91 bcview().addReadOnly(dialog_->rejectPB);
95 void GuiChanges::update_contents()
98 docstring author = controller().getChangeAuthor();
99 docstring date = controller().getChangeDate();
102 text += bformat(_("Change by %1$s\n\n"), author);
104 text += bformat(_("Change made at %1$s\n"), date);
106 dialog_->changeTB->setPlainText(toqstr(text));
110 void GuiChanges::next()
116 void GuiChanges::accept()
118 controller().accept();
122 void GuiChanges::reject()
124 controller().reject();
127 } // namespace frontend
130 #include "GuiChanges_moc.cpp"