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"
15 #include "ControlChanges.h"
17 #include "qt_helpers.h"
19 #include "support/lstrings.h"
21 #include <QCloseEvent>
22 #include <QTextBrowser>
24 using lyx::support::bformat;
30 GuiChangesDialog::GuiChangesDialog(LyXView & lv)
31 : GuiDialog(lv, "changes")
34 setController(new ControlChanges(*this));
35 setViewTitle(_("Merge Changes"));
37 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
38 connect(nextPB, SIGNAL(clicked()), this, SLOT(nextPressed()));
39 connect(rejectPB, SIGNAL(clicked()), this, SLOT(rejectPressed()));
40 connect(acceptPB, SIGNAL(clicked()), this, SLOT(acceptPressed()));
42 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
43 bc().setCancel(closePB);
44 bc().addReadOnly(acceptPB);
45 bc().addReadOnly(rejectPB);
49 ControlChanges & GuiChangesDialog::controller()
51 return static_cast<ControlChanges &>(GuiDialog::controller());
55 void GuiChangesDialog::closeEvent(QCloseEvent *e)
62 void GuiChangesDialog::updateContents()
65 docstring author = controller().getChangeAuthor();
66 docstring date = controller().getChangeDate();
69 text += bformat(_("Change by %1$s\n\n"), author);
71 text += bformat(_("Change made at %1$s\n"), date);
73 changeTB->setPlainText(toqstr(text));
77 void GuiChangesDialog::nextPressed()
83 void GuiChangesDialog::acceptPressed()
85 controller().accept();
89 void GuiChangesDialog::rejectPressed()
91 controller().reject();
94 } // namespace frontend
97 #include "GuiChanges_moc.cpp"