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 "qt_helpers.h"
17 #include "support/lstrings.h"
19 #include <QCloseEvent>
20 #include <QTextBrowser>
22 using lyx::support::bformat;
28 /////////////////////////////////////////////////////////////////////
32 /////////////////////////////////////////////////////////////////////
34 GuiChangesDialog::GuiChangesDialog(GuiChanges * form)
38 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
39 connect(nextPB, SIGNAL(clicked()), this, SLOT(nextPressed()));
40 connect(rejectPB, SIGNAL(clicked()), this, SLOT(rejectPressed()));
41 connect(acceptPB, SIGNAL(clicked()), this, SLOT(acceptPressed()));
45 void GuiChangesDialog::nextPressed()
51 void GuiChangesDialog::acceptPressed()
57 void GuiChangesDialog::rejectPressed()
63 void GuiChangesDialog::closeEvent(QCloseEvent *e)
71 /////////////////////////////////////////////////////////////////////
75 /////////////////////////////////////////////////////////////////////
78 GuiChanges::GuiChanges(GuiDialog & parent)
79 : GuiView<GuiChangesDialog>(parent, _("Merge Changes"))
84 void GuiChanges::build_dialog()
86 dialog_.reset(new GuiChangesDialog(this));
88 bc().setCancel(dialog_->closePB);
89 bc().addReadOnly(dialog_->acceptPB);
90 bc().addReadOnly(dialog_->rejectPB);
94 void GuiChanges::update_contents()
97 docstring author = controller().getChangeAuthor();
98 docstring date = controller().getChangeDate();
101 text += bformat(_("Change by %1$s\n\n"), author);
103 text += bformat(_("Change made at %1$s\n"), date);
105 dialog_->changeTB->setPlainText(toqstr(text));
109 void GuiChanges::next()
115 void GuiChanges::accept()
117 controller().accept();
121 void GuiChanges::reject()
123 controller().reject();
126 } // namespace frontend
129 #include "GuiChanges_moc.cpp"