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 "controllers/ControlChanges.h"
22 #include <QPushButton>
23 #include <QCloseEvent>
24 #include <QTextBrowser>
26 using lyx::support::bformat;
32 /////////////////////////////////////////////////////////////////////
36 /////////////////////////////////////////////////////////////////////
38 GuiChangesDialog::GuiChangesDialog(GuiChanges * form)
42 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
43 connect(nextPB, SIGNAL(clicked()), this, SLOT(nextPressed()));
44 connect(rejectPB, SIGNAL(clicked()), this, SLOT(rejectPressed()));
45 connect(acceptPB, SIGNAL(clicked()), this, SLOT(acceptPressed()));
49 void GuiChangesDialog::nextPressed()
55 void GuiChangesDialog::acceptPressed()
61 void GuiChangesDialog::rejectPressed()
67 void GuiChangesDialog::closeEvent(QCloseEvent *e)
75 /////////////////////////////////////////////////////////////////////
79 /////////////////////////////////////////////////////////////////////
81 typedef QController<ControlChanges, GuiView<GuiChangesDialog> > ChangesBase;
84 GuiChanges::GuiChanges(Dialog & parent)
85 : ChangesBase(parent, _("Merge Changes"))
90 void GuiChanges::build_dialog()
92 dialog_.reset(new GuiChangesDialog(this));
94 bcview().setCancel(dialog_->closePB);
95 bcview().addReadOnly(dialog_->acceptPB);
96 bcview().addReadOnly(dialog_->rejectPB);
100 void GuiChanges::update_contents()
103 docstring author = controller().getChangeAuthor();
104 docstring date = controller().getChangeDate();
107 text += bformat(_("Change by %1$s\n\n"), author);
109 text += bformat(_("Change made at %1$s\n"), date);
111 dialog_->changeTB->setPlainText(toqstr(text));
115 void GuiChanges::next()
121 void GuiChanges::accept()
123 controller().accept();
127 void GuiChanges::reject()
129 controller().reject();
132 } // namespace frontend
135 #include "GuiChanges_moc.cpp"